• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Referring to previously selected units

Status
Not open for further replies.
Level 1
Joined
Mar 6, 2010
Messages
1
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
 
Status
Not open for further replies.
Top