KILLJAW
New Member
- Reaction score
- 0
> Set TempUnit1 = (Dying unit)
Any unit that dies, espectially while this trigger is waiting, will overwrite the variable...
Instead, forget the variable and work with "triggering unit".
Also, the "is a Hero" condition would be better on the trigger.
> Countdown Timer - Destroy (Last created timer window)
This is not necessarily the correct window...
Since setting a variable = dying unit will let the variable be overwritten any time a unit dies, I can rightfully assume that setting a variable = last created timer window would also be overwritten any time a new timer window is created, especially since I have the trigger wait for amounts of time, so how can I get the trigger to reference the proper window, even if a new window is created before the trigger is done waiting?
Here is my revised trigger, about which I am asking this question:
Code:
Hero Respawn
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Countdown Timer - Start RespawnTime[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
Countdown Timer - Create a timer window for RespawnTime[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + 's Revival)
Set RespawnWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
Wait 24.50 seconds
Set TempPoint = (Center of Respawn <gen>)
Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 5.00 seconds
Custom script: call RemoveLocation(udg_TempPoint)
Wait 5.50 seconds
Set TempPoint = (Random point in Respawn <gen>)
Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
Countdown Timer - Destroy RespawnWindow[(Player number of (Owner of (Triggering unit)))]
Custom script: call RemoveLocation(udg_TempPoint)