HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What is wrong with this revive trig?

01-24-2006, 06:24 PM#1
SmileyJeff
It won't work when only 1 hero dies. Why?
Trigger:
Revive Check
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Dying unit) is A Hero) Equal to True
Collapse Actions
Set deadhero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
Countdown Timer - Start revivetimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 2.00) seconds
Countdown Timer - Create a timer window for (Last started timer) with title Revive in
Set revivewindow[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
Countdown Timer - Hide revivewindow[(Player number of (Owner of (Dying unit)))]
Countdown Timer - Show revivewindow[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
Trigger:
Revive
Collapse Events
Time - revivetimer[3] expires
Time - revivetimer[4] expires
Time - revivetimer[5] expires
Time - revivetimer[6] expires
Time - revivetimer[7] expires
Time - revivetimer[8] expires
Conditions
Collapse Actions
Collapse For each (Integer A) from 3 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Remaining time for revivetimer[(Integer A)]) Less than 1.00
(deadhero[(Integer A)] is alive) Equal to False
Collapse Then - Actions
Countdown Timer - Destroy revivewindow[(Integer A)]
Camera - Pan camera for (Owner of deadhero[(Integer A)]) to (Center of HE heal <gen>) over 1.00 seconds
Hero - Instantly revive deadhero[(Integer A)] at (Center of HE heal <gen>), Show revival graphics
Else - Actions
Collapse For each (Integer A) from 6 to 8, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Remaining time for revivetimer[(Integer A)]) Less than 1.00
(deadhero[(Integer A)] is alive) Equal to False
Collapse Then - Actions
Countdown Timer - Destroy revivewindow[(Integer A)]
Camera - Pan camera for (Owner of deadhero[(Integer A)]) to (Center of NE heal <gen>) over 1.00 seconds
Hero - Instantly revive deadhero[(Integer A)] at (Center of NE heal <gen>), Show revival graphics
Else - Actions
01-24-2006, 07:28 PM#2
Anitarf
There are two events, "a unit dies" and "a hero becomes revivable". The second event happens with a certain delay after the first, about 5 seconds or something like that. During that time, you can't revive your hero yet. If you are testing this with a low level hero, chances are this is your problem, because you would try to revive a level 1 hero after only 2 seconds. If this is the problem, try increasing the revive times or use the "becomes revivable" event.
01-24-2006, 07:40 PM#3
SmileyJeff
"a hero becomes revivable"
I think i will use this event then.

I tested out a few times just now, i notice that player 3 - 5 revive normally, but not 6 - 8. I think its something to do with the looping, i guess i will just combine those 3 with 1 more IF statement.

Thanks.
01-24-2006, 07:49 PM#4
Vexorian
only explanation would be, are you initializing the deadhero array correctly?
01-24-2006, 08:48 PM#5
Chuckle_Brother
Pfft, that delay time = no matter at all.

I revive dead heroes all the time before any sort of delay, that "Becomes Revivable" ONLY applies to revival from a tavern or altar
01-25-2006, 03:59 PM#6
SmileyJeff
Prob solved, dying unit and rivivalbe unit works fine. The only prob is the loop, i just combined them together in 1 loop with 1 more condition "hero level (interger A) less than 6". It works nicely now :)

Thanks to all.