- Joined
- Jul 18, 2008
- Messages
- 19
Hallo. I want to make a countdown timer to count down time until a hero is revived. I am using 1 trigger to start the timer, show it, and revive a each hero, and 1 to destroy a timer window. The problem is that when 1 hero dies just a few seconds after another, only one timer window is deleted when the timer expires, even after both heroes are revived. I use a trigger to set a timer window variable to last created window, and then destroy it, but it seams not working. Let me show you my Triggers. There are 2 Heroes.
Hero 01 Respawn:
Events:
-Unit - A unit owned by Player 1 (Red) Dies
Conditions:
-(Owner of (Dying unit)) Equal to Player 1 (Red)
-((Dying unit) is A Hero) Equal to True
Actions:
-Countdown Timer - Create a timer window for TimerHero01 with title Reviving in:
-Countdown Timer - Show TimerHeroWindow01 for Player 1 (Red)
-Countdown Timer - Hide TimerHeroWindow01 for Player 2 (Blue)
-Countdown Timer - Start TimerHero01 as a One-shot timer that will expire in 10.00 seconds
-Wait 10.00 seconds
-Hero - Instantly revive (Dying unit) at (Center of Region 003 <gen>), Show revival graphics
Hero 01 Timer Finish
Events:
-Time - TimerHero01 expires
Conditions:
Actions:
-Set TimerHeroWindow01 = (Last created timer window)
-Countdown Timer - Destroy (Last created timer window)
Hero 02 Respawn:
Events:
-Unit - A unit owned by Player 2 (Blue) Dies
Conditions:
-(Owner of (Dying unit)) Equal to Player 2 (Blue)
-((Dying unit) is A Hero) Equal to True
Actions:
-Countdown Timer - Create a timer window for TimerHero02 with title Reviving in:
-Countdown Timer - Show TimerHeroWindow02 for Player 2 (Blue)
-Countdown Timer - Hide TimerHeroWindow02 for Player 1 (Red)
-Countdown Timer - Start TimerHero02 as a One-shot timer that will expire in 10.00 seconds
-Wait 10.00 seconds
-Hero - Instantly revive (Dying unit) at (Center of Region 002 <gen>), Show revival graphics
Hero 02 Timer Finish
Events:
Time - TimerHero02 expires
Conditions:
Actions:
-Set TimerHeroWindow02 = (Last created timer window)
-Countdown Timer - Destroy (Last created timer window)
Variables Used:
TimerHero01
Type: Timer
TimerHero02
Type: Timer
TimerHeroWindow01
Type: Timer Window
TimerHeroWindow02
Type: Timer Window
I hope you understand my problem...
Edit: The problem is that only lastly created window is destroyed, like there is no:
-Set TimerHeroWindow01 = (Last created timer window) and,
-Set TimerHeroWindow02 = (Last created timer window) actions!
Hero 01 Respawn:
Events:
-Unit - A unit owned by Player 1 (Red) Dies
Conditions:
-(Owner of (Dying unit)) Equal to Player 1 (Red)
-((Dying unit) is A Hero) Equal to True
Actions:
-Countdown Timer - Create a timer window for TimerHero01 with title Reviving in:
-Countdown Timer - Show TimerHeroWindow01 for Player 1 (Red)
-Countdown Timer - Hide TimerHeroWindow01 for Player 2 (Blue)
-Countdown Timer - Start TimerHero01 as a One-shot timer that will expire in 10.00 seconds
-Wait 10.00 seconds
-Hero - Instantly revive (Dying unit) at (Center of Region 003 <gen>), Show revival graphics
Hero 01 Timer Finish
Events:
-Time - TimerHero01 expires
Conditions:
Actions:
-Set TimerHeroWindow01 = (Last created timer window)
-Countdown Timer - Destroy (Last created timer window)
Hero 02 Respawn:
Events:
-Unit - A unit owned by Player 2 (Blue) Dies
Conditions:
-(Owner of (Dying unit)) Equal to Player 2 (Blue)
-((Dying unit) is A Hero) Equal to True
Actions:
-Countdown Timer - Create a timer window for TimerHero02 with title Reviving in:
-Countdown Timer - Show TimerHeroWindow02 for Player 2 (Blue)
-Countdown Timer - Hide TimerHeroWindow02 for Player 1 (Red)
-Countdown Timer - Start TimerHero02 as a One-shot timer that will expire in 10.00 seconds
-Wait 10.00 seconds
-Hero - Instantly revive (Dying unit) at (Center of Region 002 <gen>), Show revival graphics
Hero 02 Timer Finish
Events:
Time - TimerHero02 expires
Conditions:
Actions:
-Set TimerHeroWindow02 = (Last created timer window)
-Countdown Timer - Destroy (Last created timer window)
Variables Used:
TimerHero01
Type: Timer
TimerHero02
Type: Timer
TimerHeroWindow01
Type: Timer Window
TimerHeroWindow02
Type: Timer Window
I hope you understand my problem...
Edit: The problem is that only lastly created window is destroyed, like there is no:
-Set TimerHeroWindow01 = (Last created timer window) and,
-Set TimerHeroWindow02 = (Last created timer window) actions!