• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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?
 
Level 5
Joined
Nov 27, 2004
Messages
153
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...
 
Level 9
Joined
Jan 13, 2005
Messages
553
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)
 
Level 10
Joined
Aug 2, 2004
Messages
703
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.
Top