Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Revive Timer

Events


Unit - A unit Dies

Conditions


((Dying unit) is A Hero) Equal to True


((Owner of (Dying unit)) slot status) Equal to Is playing

Actions


Set Hero[(Player number of (Owner of (Dying unit)))] = (Dying unit)


Countdown Timer - Start Timer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in 10.00 seconds


Countdown Timer - Create a timer window for (Last started timer) with title Reviving in...


Set Timer_Window[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
Revive

Events


Time - Timer[1] expires


Time - Timer[2] expires

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Remaining time for Timer[1]) Less than or equal to 0.00



Then - Actions




Hero - Instantly revive Hero[1] at (Center of (Playable map area)), Hide revival graphics




Countdown Timer - Destroy Timer_Window[1]



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Remaining time for Timer[2]) Less than or equal to 0.00



Then - Actions




Hero - Instantly revive Hero[2] at (Center of (Playable map area)), Hide revival graphics




Countdown Timer - Destroy Timer_Window[2]



Else - Actions
You could do it like this.
Revive Timer
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
((Owner of (Dying unit)) slot status) Equal to Is playing
Actions
Set Hero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
Countdown Timer - Start Timer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in 10.00 seconds
Countdown Timer - Create a timer window for (Last started timer) with title Reviving in...
Set Timer_Window[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
Revive
Events
Time - Timer[1] expires
Time - Timer[2] expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Remaining time for Timer[1]) Less than or equal to 0.00
Then - Actions
Hero - Instantly revive Hero[1] at (Center of (Playable map area)), Hide revival graphics
Countdown Timer - Destroy Timer_Window[1]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Remaining time for Timer[2]) Less than or equal to 0.00
Then - Actions
Hero - Instantly revive Hero[2] at (Center of (Playable map area)), Hide revival graphics
Countdown Timer - Destroy Timer_Window[2]
Else - Actions
https://www.hiveworkshop.com/forums/world-editor-help-zone-98/timers-230384/index2.html - another way that uses a hashtable.
You may want to check the whole thread in the above link as it is devoted to the same topic.
Initialization

Events


Time - Elapsed game time is 0.00 seconds

Conditions

Actions


Hashtable - Create a hashtable


Set ReviveSystem_Hashtable = (Last created hashtable)


Set Select_Players = (All players)
Player Group - Pick every player in Select_Players and do (Actions)

Loop - Actions


Set Select_Player = (Picked player)


Set Select_Number = (Player number of Select_Player)


Leaderboard - Create a leaderboard for (Player group((Player(Select_Number)))) titled Your hero has fa...


Set ReviveSystem_Board[Select_Number] = (Last created leaderboard)


Leaderboard - Add Select_Player to ReviveSystem_Board[Select_Number] with label You will respawn in... and value 0


Leaderboard - Hide ReviveSystem_Board[Select_Number]
Revive Becomes Revivable

Events


Unit - A unit Becomes revivable

Conditions

Actions


-------- Death --------


Set ReviveSystem_RevivingHero = (Triggering unit)


Set ReviveSystem_Player = (Triggering player)


Set ReviveSystem_PlayerNumber = (Player number of ReviveSystem_Player)


Set ReviveSystem_Duration = ((Real((Level of ReviveSystem_RevivingHero))) x 2.00)


Unit Group - Add ReviveSystem_RevivingHero to ReviveSystem_RevivingGroup


Hashtable - Save ReviveSystem_Duration as 1 of (Key (Triggering unit)) in ReviveSystem_Hashtable


Hashtable - Save ReviveSystem_PlayerNumber as 2 of (Key (Triggering unit)) in ReviveSystem_Hashtable


Leaderboard - Show ReviveSystem_Board[ReviveSystem_PlayerNumber]


Leaderboard - Change the value for ReviveSystem_Player in ReviveSystem_Board[ReviveSystem_PlayerNumber] to (Integer(ReviveSystem_Duration))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Number of units in ReviveSystem_RevivingGroup) Equal to 1



Then - Actions




Trigger - Turn on Revive Revivable Hero <gen>



Else - Actions
Revive Revivable Hero

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in ReviveSystem_RevivingGroup and do (Actions)



Loop - Actions




Set ReviveSystem_PickedUnit = (Picked unit)




Set ReviveSystem_Duration = (Load 1 of (Key (Picked unit)) from ReviveSystem_Hashtable)




Set ReviveSystem_PlayerNumber = (Load 2 of (Key (Picked unit)) from ReviveSystem_Hashtable)




Set ReviveSystem_Duration = (ReviveSystem_Duration - 0.03)




Set ReviveSystem_Player = (Owner of ReviveSystem_PickedUnit)




Leaderboard - Change the value for ReviveSystem_Player in ReviveSystem_Board[ReviveSystem_PlayerNumber] to (Integer(ReviveSystem_Duration))




Hashtable - Save ReviveSystem_Duration as 1 of (Key (Picked unit)) in ReviveSystem_Hashtable




Hashtable - Save ReviveSystem_PlayerNumber as 2 of (Key (Picked unit)) in ReviveSystem_Hashtable




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






ReviveSystem_Duration Less than or equal to 0.00





Then - Actions






Set ReviveSystem_RevivePoint = (Center of Your Location <gen>)






Leaderboard - Hide ReviveSystem_Board[ReviveSystem_PlayerNumber]






Hero - Instantly revive ReviveSystem_PickedUnit at ReviveSystem_RevivePoint, Show revival graphics






Camera - Pan camera for ReviveSystem_Player to ReviveSystem_RevivePoint over 0.00 seconds






Custom script: call RemoveLocation(udg_ReviveSystem_RevivePoint)






Selection - Clear selection for ReviveSystem_Player






Selection - Select ReviveSystem_PickedUnit for ReviveSystem_Player






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in ReviveSystem_Hashtable






Unit Group - Remove ReviveSystem_PickedUnit from ReviveSystem_RevivingGroup






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Number of units in ReviveSystem_RevivingGroup) Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions
Hero Respawn

Events


Time - HeroRespawnTimer[0] expires


Time - HeroRespawnTimer[1] expires


Time - HeroRespawnTimer[2] expires


Time - HeroRespawnTimer[3] expires

Conditions

Actions


Set TempTimer[0] = (Expiring timer)


For each (Integer Integer) from 1 to 10, do (Actions)



Loop - Actions




Custom script: if udg_TempTimer[0] == udg_HeroRespawnTimer[udg_Integer-1] then




Game - Display to (All players) the text: (Hero of + ((Name of (Player(Integer))) + has respawned.))




Custom script: endif
Hero Respawn

Events


Unit - A unit Dies

Conditions


And - All (Conditions) are true



Conditions




((Dying unit) is A Hero) Equal to True




(Owner of (Dying unit)) Not equal to Player 11 (Dark Green)




(Owner of (Dying unit)) Not equal to Player 12 (Brown)

Actions


Set HeroRespawnHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)


Set HeroRespawnTime[(Player number of (Owner of (Dying unit)))] = (15 + (Hero level of (Dying unit)))


Countdown Timer - Start HeroRespawnTimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (Real(HeroRespawnTime[(Player number of (Owner of (Dying unit)))])) seconds


Countdown Timer - Change the title of (Last created timer window) to Respawn Time


Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))


Game - Display to (Player group((Owner of (Dying unit)))) the text: |cff7777aaYour hero...


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Remaining time for HeroRespawnTimer[(Player number of (Owner of (Dying unit)))]) Equal to 0.00



Then - Actions




Hero - Instantly revive HeroRespawnHero[(Player number of (Owner of (Dying unit)))] at (Center of Hero Spawn <gen>), Show revival graphics




Camera - Pan camera for (Triggering player) to (Center of Hero Spawn <gen>) over 0.00 seconds




Game - Display to (Player group((Owner of (Dying unit)))) the text: |cff7777aaYour hero...



Else - Actions




Countdown Timer - Destroy HeroRespawnTimerWindow[(Player number of (Owner of (Dying unit)))]
You need 2 triggers:You can also just do something like this:
Hero dies

Events


Unit - A unit Dies

Conditions


And - All (Conditions) are true



Conditions




((Dying unit) is A Hero) Equal to True




(Owner of (Dying unit)) Not equal to Player 11 (Dark Green)




(Owner of (Dying unit)) Not equal to Player 12 (Brown)

Actions


Set HeroRespawnHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)


Set HeroRespawnTime[(Player number of (Owner of (Dying unit)))] = (15 + (Hero level of (Dying unit)))


Countdown Timer - Start HeroRespawnTimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (Real(HeroRespawnTime[(Player number of (Owner of (Dying unit)))])) seconds


Countdown Timer - Change the title of (Last created timer window) to Respawn Time


1st hide window for all players, then:


Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
Hero Respawn

Events


Time - HeroRespawnTimer[1] expires


Time - HeroRespawnTimer[2] expires


Time - HeroRespawnTimer[3] expires


Time - HeroRespawnTimer[4] expires


Time - HeroRespawnTimer[5] expires


Time - HeroRespawnTimer[6] expires


Time - HeroRespawnTimer[7] expires


Time - HeroRespawnTimer[8] expires


Time - HeroRespawnTimer[9] expires


Time - HeroRespawnTimer[10] expires

Conditions

Actions


For each (Integer TempInteger) from 1 to 10, do (Actions)



Loop - Actions




Custom script: if (GetExpiredTimer() == udg_HeroRespawnTimer[udg_TempInteger]) then




Countdown Timer - Destroy HeroRespawnTimerWindow[(Player number of (Triggering player))]




Hero - Instantly revive HeroRespawnHero[(Player number of (Triggering player))] at (Center of HeroSpawn Exit <gen>), Show revival graphics




Camera - Pan camera for (Triggering player) to (Position of (Reviving Hero)) over 0.00 seconds




Game - Display to (All players) the text: (Hero of + ((Name of (Player(Integer))) + has respawned.))




Custom script: endif
Hey,
use Wietlol's solution, only this one is right.
You need 2 triggers:
Hero dies
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Dying unit) is A Hero) Equal to True
(Owner of (Dying unit)) Not equal to Player 11 (Dark Green)
(Owner of (Dying unit)) Not equal to Player 12 (Brown)
Actions
Set HeroRespawnHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
Set HeroRespawnTime[(Player number of (Owner of (Dying unit)))] = (15 + (Hero level of (Dying unit)))
Countdown Timer - Start HeroRespawnTimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (Real(HeroRespawnTime[(Player number of (Owner of (Dying unit)))])) seconds
Countdown Timer - Change the title of (Last created timer window) to Respawn Time
1st hide window for all players, then:
Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
and 2nd:
Hero Respawn
Events
Time - HeroRespawnTimer[1] expires
Time - HeroRespawnTimer[2] expires
Time - HeroRespawnTimer[3] expires
Time - HeroRespawnTimer[4] expires
Time - HeroRespawnTimer[5] expires
Time - HeroRespawnTimer[6] expires
Time - HeroRespawnTimer[7] expires
Time - HeroRespawnTimer[8] expires
Time - HeroRespawnTimer[9] expires
Time - HeroRespawnTimer[10] expires
Conditions
Actions
For each (Integer TempInteger) from 1 to 10, do (Actions)
Loop - Actions
Custom script: if (GetExpiredTimer() == udg_HeroRespawnTimer[udg_TempInteger]) then
Countdown Timer - Destroy HeroRespawnTimerWindow[(Player number of (Triggering player))]
Hero - Instantly revive HeroRespawnHero[(Player number of (Triggering player))] at (Center of HeroSpawn Exit <gen>), Show revival graphics
Camera - Pan camera for (Triggering player) to (Position of (Reviving Hero)) over 0.00 seconds
Game - Display to (All players) the text: (Hero of + ((Name of (Player(Integer))) + has respawned.))
Custom script: endif
be sure you have TempInteger variable (integer type no array)
be sure you have HeroRespawnTimer in variable list set to array 10
zibi
Dont remove the problem Sirade278 in the first post... other may have the same...
Hey,
use Wietlol's solution, only this one is right.
You need 2 triggers:
Hero dies
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Dying unit) is A Hero) Equal to True
(Owner of (Dying unit)) Not equal to Player 11 (Dark Green)
(Owner of (Dying unit)) Not equal to Player 12 (Brown)
Actions
Set HeroRespawnHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
Set HeroRespawnTime[(Player number of (Owner of (Dying unit)))] = (15 + (Hero level of (Dying unit)))
Countdown Timer - Start HeroRespawnTimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (Real(HeroRespawnTime[(Player number of (Owner of (Dying unit)))])) seconds
Countdown Timer - Change the title of (Last created timer window) to Respawn Time
1st hide window for all players, then:
Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
and 2nd:
Hero Respawn
Events
Time - HeroRespawnTimer[1] expires
Time - HeroRespawnTimer[2] expires
Time - HeroRespawnTimer[3] expires
Time - HeroRespawnTimer[4] expires
Time - HeroRespawnTimer[5] expires
Time - HeroRespawnTimer[6] expires
Time - HeroRespawnTimer[7] expires
Time - HeroRespawnTimer[8] expires
Time - HeroRespawnTimer[9] expires
Time - HeroRespawnTimer[10] expires
Conditions
Actions
For each (Integer TempInteger) from 1 to 10, do (Actions)
Loop - Actions
Custom script: if (GetExpiredTimer() == udg_HeroRespawnTimer[udg_TempInteger]) then
Countdown Timer - Destroy HeroRespawnTimerWindow[(Player number of (Triggering player))]
Hero - Instantly revive HeroRespawnHero[(Player number of (Triggering player))] at (Center of HeroSpawn Exit <gen>), Show revival graphics
Camera - Pan camera for (Triggering player) to (Position of (Reviving Hero)) over 0.00 seconds
Game - Display to (All players) the text: (Hero of + ((Name of (Player(Integer))) + has respawned.))
Custom script: endif
be sure you have TempInteger variable (integer type no array)
be sure you have HeroRespawnTimer in variable list set to array 10
zibi
