recruits to die with leader
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.
recruits to die with leader
ive been trying to get all of a side to die when the leader dies but have only been able to find coding that will make the leader die and not the recruites aswell.Who can help me
Like this:
Code: Select all
# kill leaderless minions
[event]
name=die
first_time_only=no
[filter]
canrecruit=1
[/filter]
{STORE_UNIT_VAR x,y=$x1,$y1 side deadleader_side}
[unhide_unit]
[/unhide_unit]
[hide_unit]
x=$x1
y=$y1
[/hide_unit]
[kill]
animate=yes
fire_event=no
side=$deadleader_side
canrecruit=0
[/kill]
[/event]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
If it doesn't work, then what version of Wesnoth are you using? I'm assuming that macro is defined in your version.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Well, you should have specified your version of Wesnoth. Here's an example that doesn't use any utility macros. I'm not going to reinstall Wesnoth 1.0.2 just to test it though. Let me know if it works.
Code: Select all
# kill leaderless minions
[event]
name=die
first_time_only=no
[filter]
canrecruit=1
[/filter]
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
kill=no
variable=stored_unit
[/store_unit]
[set_variable]
name=deadleader_side
format=$stored_unit.side
[/set_variable]
[clear_variable]
name=stored_unit
[/clear_variable]
[unhide_unit]
[/unhide_unit]
[hide_unit]
x=$x1
y=$y1
[/hide_unit]
[kill]
animate=yes
fire_event=no
side=$deadleader_side
canrecruit=0
[/kill]
[/event]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."