• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hero Death Timer Stall

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2004
Messages
70
Hi, well I was reading the Forums of wc3sear.ch and well i came across a nifty hero death timer and i thought hey that would be sweet in my map, anyways I tossed it in and well im having an issue with it and a quick fix would be appreciated a bunch. THIS trigger i have no clue on how to fix so I could use some help.


hero timer
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
Set hero_to_be_revived = (Unit-type of (Dying unit))
Game - Display to (Player group((Owner of (Triggering unit)))) for 5.00 seconds the text: (|CFF00FF00Your Hero Will Be Revived In + ((String((Hero level of (Dying unit)))) + |CFF00FF00Seconds.))
Countdown Timer - Start death_time[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in (3.00 x (Real((Hero level of (Dying unit))))) seconds
Set death_time[(Player number of (Owner of (Dying unit)))] = (Last started timer)
Countdown Timer - Create a timer window for death_time[(Player number of (Owner of (Dying unit)))] with title (Name of (Owner of (Dying unit)))
Wait (Real(((Hero level of (Dying unit)) x 3))) seconds
Hero - Instantly revive (Dying unit) at ((Owner of (Dying unit)) start location), Show revival graphics
Countdown Timer - Destroy (Last created timer window)
------------------------------------------------------------------------------------


Anyways the problem with that is as you can see is this "Countdown Timer - Destroy (Last created timer window)" If another hero dies while one hero is still in the countdown, it will destroy the last hero's timer window and not the previous so I end up having like 20 Timer windows at the top of my map. :? unfortunatly, I don't know of any alternatives to destroying a timer window other than last created so plz help.
 
Level 6
Joined
Sep 17, 2005
Messages
276
try creating a timer-variable (array with size of max players like TimerOfPlayerX[x]) and store immediately after creating you timer for player x in that variable.

set (last created timer) to TimerOfPlayerX [player number of owner of dying unit]

and at the end destroy it:

destroy TimerOfPlayerX [player number of owner of dying unit]

btw i saw u have used once or twice the 'triggering unit' function >>> replace with 'dying unit'. i dont know if triggering player works too, but dying unit is 100% correct. :wink:
 
Status
Not open for further replies.
Top