How do I change a unit's side once defeated?
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.
How do I change a unit's side once defeated?
Hi, I'm working on a scenario where the player is meant to "capture" some ogres by defeating them in battle. Basically, I'd like to make it so that once an ogre is killed, it switches to the player's side.
I currently created this bit of code here:
However, it seems using "unit" only works for dialog, and not unit modifications. I'd appreciate any help I can get with this. Thank you very much!
I currently created this bit of code here:
Code: Select all
[event]
name=last breath
[filter]
side=2
[/filter]
[filter_second]
side=1
[/filter_second]
[message]
speaker=unit
message=_ "Me surrender!"
[/message]
[heal_unit]
[filter]
id=unit
[/filter]
[/heal_unit]
{MODIFY_UNIT (id=unit) side 1 }
[/event]
Re: How do I change a unit's side once defeated?
id=$unit.id
Also, you might want
first_time_only=no
Re: How do I change a unit's side once defeated?
Yup, that did it. Thank you very much for the help; I really appreciate it!