Turning multiple units into loyals
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Turning multiple units into loyals
I'm trying to turn multiple units into loyals with a macro but it gives some weird Game Load error.
Code: Select all
#define MAKE_LOYALS
[store_unit]
variable=loyaldudes
[filter]
[filter_wml]
side=1
#TODO exclude the leader
[/filter_wml]
[/filter]
[/store_unit]
{FOREACH loyaldudes dude}
[unit]
id=$loyaldudes[$dude].id
[modifications]
{TRAIT_LOYAL}
[/modifications]
[/unit]
{NEXT dude}
{CLEAR_VARIABLE loyaldudes}
#enddef
I'm using version 1.6
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: Turning multiple units into loyals
[unit] doesn't go there. You need [object] and [effect].
Also, you don't need [filter_wml]. It will work, but the side key is part of http://www.wesnoth.org/wiki/StandardUnitFilter .
Also, you don't need [filter_wml]. It will work, but the side key is part of http://www.wesnoth.org/wiki/StandardUnitFilter .
Re: Turning multiple units into loyals
Thanks alot! Now it works, but is it possible to disable the promt-screen that displays the name? It's rather frustrating when you have like 30 units. Leaving it blank doesn't work. It only opens a tiny blank window and at first I thought the game crashed.
Code: Select all
{FOREACH loyaldudes dude}
[object]
name= _ "$loyaldudes[$dude].name is now loyal"
duration=forever
[filter]
id=$loyaldudes[$dude].id
[/filter]
[effect]
apply_to=loyal
[/effect]
[/object]
{NEXT dude}
I'm using version 1.6
Re: Turning multiple units into loyals
silent=yes inside [object]
Somewhere, between the sacred silence and sleep.
Disorder.
Disorder.