• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Event: Life of [VARIABLE] becomes... ? Not possible? Workarounds?

Status
Not open for further replies.
Level 3
Joined
Mar 30, 2013
Messages
22
Hey there,

another short question today..

I want to make a trigger, that should start, when a units health drops below 200. I want the trigger to start every time when the units health drops below the 200 border.
But since the Unit will be a randomized Hero, it is not set in the WE from start.

Somehow i cant put variables into the "Units life becomes..." event, whats wrong there? any workarounds?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@Linaze: that is exactly the problem, it doesn't work.
GUI doesn't allow this, and if you try it in JASS, then it won't work either because the event is created before the variable has a value (and it will only work with the initial value of that variable, not the current value).

UndeadImmortal's option is a good one.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
  • Untitled Trigger
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • -------- to create the unit or any unit event you want --------
      • Set temp_Unit = (Last created unit)
      • -------- if you want to save the unit --------
      • Trigger - Add to (Your trigger) the event (Unit - (Last created unit)'s life becomes Less than 200.00)
      • -------- that adds the trigger you made "without any event first" for the last created unit when it's life comes less than 200 --------
      • -------- use last created unit in the trigger [or any kind of unit event you want] --------
:grin: as undead immortal said
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Untitled Trigger
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • -------- to create the unit or any unit event you want --------
      • Set temp_Unit = (Last created unit)
      • -------- if you want to save the unit --------
      • Trigger - Add to (Your trigger) the event (Unit - (Last created unit)'s life becomes Less than 200.00)
      • -------- that adds the trigger you made "without any event first" for the last created unit when it's life comes less than 200 --------
      • -------- use last created unit in the trigger [or any kind of unit event you want] --------
:grin: as undead immortal said

Why do you assign a variable if you are not using it?
 
Status
Not open for further replies.
Top