Timers

Status
Not open for further replies.
Level 4
Joined
Aug 6, 2004
Messages
52
Ok, i want a timer that tells how long until a hero is to be revived.
TimerWindow
Events
Unit - A unit owned by Player 1 (Red) Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Countdown Timer - Start Player1Timer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 3.00) seconds
Countdown Timer - Create a timer window for Player1Timer with title (Name of (Owner of (Dying unit)))
Wait ((Real((Hero level of (Dying unit)))) x 3.00) game-time seconds
Countdown Timer - Destroy Last Created Timer Window


you obviously see the problem with this, because if another hero dies, then it wont destroy the timer for the first hero. what do i do to fix this?
 
I don't think you should destroy the timer window...
Here's my suggestion...


Events
Unit - A unit owned by Player 1 (Red) Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Countdown Timer - Start Player1Timer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 3.00) seconds
Countdown Timer - Create a timer window for Player1Timer with title (Name of (Owner of (Dying unit)))
Wait - 3.0 seconds
Hide timer window for (Player1Timer)

.....When the timer expires in 3 seconds, it can be restarted with the same event...I think...
 
This is just my idea:

REVIVE
E: a unit of player 1 dies
C: unit type of dying unit=hero
A:
turn on TIME
wait xx sec
revive dying unit/hero at the position of xx

TIME
E: MI
C:
turn off this trigger

Countdown Timer - Start Player1Timer as a One-shot timer that will expire in xx sec (note: xx sec=xx sec in REVIVE)

Countdown Timer - Create a timer window for Player1Timer with title (Name of (Owner of (Dying unit)))

Wait xx sec

Hide timer window for (Player1Timer)
 
This should work

Timer window
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
Countdown Timer - Start Death_Timer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (Real((Hero level of (Dying unit)))) seconds
Countdown Timer - Create a timer window for Death_Timer[(Player number of (Owner of (Dying unit)))] with title (Name of (Owner of (Dying unit)))
Wait (Real((Hero level of (Dying unit)))) seconds
Countdown Timer - Destroy Death_window[(Player number of (Owner of (Dying unit)))]

Make sure that both variables have arrays of 12

Have fun :wink: 8)
 
Status
Not open for further replies.
Back
Top