- Joined
- Mar 13, 2009
- Messages
- 1,411
I was helping someone else with a trigger that had to revive units when killed after 120 seconds on the spot they started at when the map started. I tested this trigger and it apparently stops working when it actually comes to creating the units.
Please help me help someone else and I'll +rep you
-
Melee Initialization
-
Events
- Map initialization
- Conditions
-
Actions
- Hashtable - Create a hashtable
- Set HashtableRevive = (Last created hashtable)
- Set TempGroup = (Units in (Playable map area))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is A Hero) Equal to False
-
Then - Actions
- Unit Group - Add (Picked unit) to GroupReviveLiving
- Set TempLoc = (Position of (Picked unit))
- Set TempTypeString = (String((Unit-type of (Picked unit))))
- Hashtable - Save Handle OfTempLoc as 1 of (Key (Picked unit)) in HashtableRevive
- Hashtable - Save TempTypeString as 3 of (Key (Picked unit)) in HashtableRevive
- Custom script: call RemoveLocation( udg_TempLoc )
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup( udg_TempGroup )
-
Events
-
Unit Killed
-
Events
- Unit - A unit Dies
-
Conditions
- ((Triggering unit) is in GroupReviveLiving) Equal to True
-
Actions
- Unit Group - Add (Triggering unit) to GroupReviveDead
- Hashtable - Save 120 as 2 of (Key (Triggering unit)) in HashtableRevive
-
Events
-
Unit Revive
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in GroupReviveDead and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load 2 of (Key (Picked unit)) from HashtableRevive) Equal to 0
-
Then - Actions
- Set TempTypeString = (Load 3 of (Key (Picked unit)) from HashtableRevive)
- Set TempLoc = (Load 1 of (Key (Picked unit)) in HashtableRevive)
- Unit - Create 1 (Unit-type(TempTypeString)) for (Owner of (Picked unit)) at TempLoc facing Default building facing degrees
- Hashtable - Save Handle Of(Load 1 of (Key (Picked unit)) in HashtableRevive) as 1 of (Key (Last created unit)) in HashtableRevive
- Hashtable - Save (Load 3 of (Key (Picked unit)) from HashtableRevive) as 3 of (Key (Last created unit)) in HashtableRevive
- Unit Group - Add (Last created unit) to GroupReviveLiving
- Custom script: call RemoveLocation( udg_TempLoc )
- Unit Group - Remove (Picked unit) from GroupReviveDead
-
Else - Actions
- Set TempInteger = (Load 2 of (Key (Picked unit)) from HashtableRevive)
- Hashtable - Save ((Load 2 of (Key (Picked unit)) from HashtableRevive) - 1) as 2 of (Key (Picked unit)) in HashtableRevive
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in GroupReviveDead and do (Actions)
-
Events