- Joined
- Aug 6, 2009
- Messages
- 697
I tried making a respawn trigger that gives the dead unit a 30 second timer, then when the 30 second timer expires it revives the unit in the position it died in.
I haven't worked with hashtables for 6 months so i kind of forgot them.
This doesn't work, can someone find the problem please?
Trigger 1:
I haven't worked with hashtables for 6 months so i kind of forgot them.
This doesn't work, can someone find the problem please?
Trigger 1:
-
Respawn
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Dying unit)) Equal to Saibaman
-
-
Actions
-
Set RespawnDyingUnit = (Dying unit)
-
Custom script: set udg_ID = GetHandleId (udg_RespawnDyingUnit)
-
Set RespawnTimer = 30.00
-
Hashtable - Save Handle Of(Position of (Dying unit)) as 0 of ID in RespawnHash
-
Hashtable - Save RespawnTimer as 1 of ID in RespawnHash
-
Unit Group - Add RespawnDyingUnit to RespawnGroup
-
-
-
RespawnLoop
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in RespawnGroup and do (Actions)
-
Loop - Actions
-
Custom script: set udg_ID = GetHandleId(GetEnumUnit())
-
Set LocRespawn = (Load 0 of ID in RespawnHash)
-
Set RespawnTimer = (Load 1 of ID from RespawnHash)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RespawnTimer Greater than 0.00
-
-
Then - Actions
-
Hashtable - Save (RespawnTimer - 1.00) as 1 of (Key (Picked unit)) in RespawnHash
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RespawnTimer Equal to 0.00
-
-
Then - Actions
-
Hero - Instantly revive (Picked unit) at LocRespawn, Hide revival graphics
-
Unit Group - Remove (Picked unit) from RespawnGroup
-
Hashtable - Clear all child hashtables of child ID in RespawnHash
-
-
Else - Actions
-
-
-
-
-
-
-