I'm new to the editor, only been using it about a week, but think I have an OK grasp on triggers (although without variables) but have reached a roadblock. I'm trying to make something along these lines:
Pick random [Unit]
[Unit] announces [message]
Special effect on [Unit]
[Unit]'s life becomes X
Wait
[Unit]'s life returns to value prior to trigger
Repeat
My main issue is I don't know how to refer back to the selected unit in the same trigger (or multiple triggers if necessary). Note that the selection is entriely random, there are no events and the trigger is activated by another trigger, and this trigger will repeat itself over and over so it needs to be able to forget the previous unit and remember the new one.
From what I've read I think it involves using variables to remember the unit, but I'm having a hard time understanding how to use variables to improve my triggers (thus far my triggers are probably horribly inefficient and clunky by expert standards). Any input or tutorial links would be appreciated. thanks
Pick random [Unit]
[Unit] announces [message]
Special effect on [Unit]
[Unit]'s life becomes X
Wait
[Unit]'s life returns to value prior to trigger
Repeat
My main issue is I don't know how to refer back to the selected unit in the same trigger (or multiple triggers if necessary). Note that the selection is entriely random, there are no events and the trigger is activated by another trigger, and this trigger will repeat itself over and over so it needs to be able to forget the previous unit and remember the new one.
From what I've read I think it involves using variables to remember the unit, but I'm having a hard time understanding how to use variables to improve my triggers (thus far my triggers are probably horribly inefficient and clunky by expert standards). Any input or tutorial links would be appreciated. thanks