HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

hey everyone need some help with death timer and hero reivie

01-03-2014, 03:53 PM#1
shanghai
Trigger:
HeroDies
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Owner of (Triggering unit)) Not equal to Neutral Hostile
((Triggering unit) is A Hero) Equal to True
Collapse Actions
Trigger - Run Timer 2 <gen> (checking conditions)

Trigger:
Timer 2
Events
Conditions
Collapse Actions
Countdown Timer - Start Timer_2 as a One-shot timer that will expire in 6.00 seconds
Countdown Timer - Create a timer window for Timer_2 with title Your Hero Revives I...
Set Timer_Window_2 = (Last created timer window)
Countdown Timer - Show Timer_Window_2

Trigger:
Timer 2 Ends
Collapse Events
Time - Timer_2 expires
Conditions
Collapse Actions
Trigger - Run Revive <gen> (checking conditions)

Trigger:
Revive
Events
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Triggering unit) is alive) Equal to False
Collapse Then - Actions
Set loc = ((Owner of (Triggering unit)) start location)
Camera - Pan camera for (Player((Player number of (Owner of (Triggering unit))))) to loc over 0.00 seconds
Hero - Instantly revive Player_MMA[(Player number of (Owner of (Triggering unit)))] at loc, Hide revival graphics
Animation - Play Player_MMA[(Player number of (Owner of (Triggering unit)))]'s birth animation
Countdown Timer - Hide DeathTimerWindow[(Player number of (Owner of (Triggering unit)))]
Special Effect - Create a special effect at loc using Abilities\Spells\Other\Awaken\Awaken.mdl
Special Effect - Destroy (Last created special effect)
Selection - Select (Triggering unit) for (Owner of (Triggering unit))
Custom script: call RemoveLocation(udg_loc)
Else - Actions

Trigger:
Destroy Copy
Collapse Events
Time - Timer_2 expires
Conditions
Collapse Actions
Countdown Timer - Destroy (Last created timer window)

I have made this triggers and its not working. I want so when hero dies show timer 6 seconds and then when it expires hero should revive.
01-03-2014, 04:49 PM#2
Yrth
whoa i have never seen so much encapsulation in gui triggers. thats maybe a good thing though

i don't have too much experience with wc3 but that timer might be causing some issues...

okay so let me put it in terms of a hypothetical scenario

in your game:
a hero dies, starting a timer
while that timer is ticking down, something else happens. the question then is does that cause "Triggering Unit" (seen below in your "Revive" trigger) to be replaced by the new triggering unit (is it a global variable, shared by all triggers) or does TriggerUnit get passed down this chain reaction of Triggers and remain the original triggering unit? If the former is happening, than your trigger is functioning as it should but it's losing track of what it should be reviving. An easy way to test if this is the case is to have the triggers \print out some ingame chat messages displaying back end data about what's happening.
the timer finishes and potentially we try to revive the wrong thing (probably alive) and so nothing appears to happen in game