- Joined
- Mar 2, 2010
- Messages
- 3,069
i am working on a project where i use mana as an oxygen gauge and that when empty dies. how can i trigger it.
i cant apply a condition to a pick every unit in unit group and do action so that wont work. the problem therefore remains unsolved.
And why is that?i cant apply a condition to a pick every unit in unit group and do action...
i cant apply a condition to a pick every unit in unit group and do action so that wont work. the problem therefore remains unsolved.
Really? Then what are these?the trigger just dont have that option.
Tested. Works. Does not kill buildings. Does not kill units with no mana. Kills units who's actual mana is less then 1.
- Untitled Trigger 001
- Events
- Time - Every 0.10 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Max mana of (Picked unit)) Less than or equal to 0.00
- Then - Actions
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Max mana of (Picked unit)) Greater than 0.00
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Mana of (Picked unit)) Less than 1.00
- Then - Actions
- Unit - Kill (Picked unit)
- Else - Actions
- Else - Actions
EDIT: NOT leak-checked, though. Also probably not the best way, but it works.
deathismyfriend said:Also it can miss units that are healing mana since it runs at a 0.10 second delay rather than the event that detects mana amount.
That's kind of the point. If their mana even drops below 1, they die. No time to let them regen mana.
I thought about this:
as well, but won't this cause same issues like with "Unit takes damage" event for every unit in the map?
- Trigger - Add to Kill units with no mana <gen> the event (Unit - (Triggering unit)'s mana becomes Equal to 0.00)