HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Extremely fast Timer question

02-18-2004, 10:46 PM#1
volatile
How do you make a timer display to just one player? By default it displays to everyone. How to set it up for just 1 player at a time? Here's my trig, let me know what I'm doing wrong...

Countdown Timer Setup
Events
Unit - A unit Dies
Conditions
((Dying unit) is Summoned) Equal to False
((Dying unit) is an illusion) Equal to False
((Dying unit) is A Hero) Equal to True
Actions
Countdown Timer - Start (Create a timer that is One-shot, of duration ((Real((Hero level of (Dying unit)))) x 10.00)) as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 10.00) seconds
Set PlayerTimer[(Player number of (Owner of (Dying unit)))] = (Last started timer)
Countdown Timer - Create a timer window for PlayerTimer[(Player number of (Owner of (Dying unit)))] with title Hero Wait...
Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
Set TimerVar[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
Wait ((Real((Hero level of (Dying unit)))) x 10.00) game-time seconds
Countdown Timer - Hide TimerVar[(Player number of (Owner of (Dying unit)))]
02-18-2004, 11:30 PM#2
LegolasArcher
Its only dosplaying to the owner of the dieing unit- not everyone. I dont see why it would.

Also event responces wont work after waits. Im not sure it that sjust casting or not thhough.
02-18-2004, 11:37 PM#3
volatile
ok, so the wait is stopping the timer window from hiding after it's done counting down? How do I get the timer window to be hidden after the countdown?
02-18-2004, 11:45 PM#4
RaeVanMorlock
Code:
Define:
    DeathTimer        Timer Array (12)
    DeathTimerWindow  Timer Window Array (12)

Function: Hero Dies
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) is Summoned) Equal to False
        ((Dying unit) is an illusion) Equal to False
    Actions
        Countdown Timer - Start DeathTimer[(Player number of (Owner of (Dying unit)))] as a
            One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 10.00) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in....
        Set DeathTimerWindow[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
        Countdown Timer - Hide (Last created timer window)
        Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))

Function: Hero Revives
    Events
        Time - DeathTimer[1] expires
        Time - DeathTimer[2] expires
        Time - DeathTimer[3] expires
        Time - DeathTimer[4] expires
        Time - DeathTimer[5] expires
        Time - DeathTimer[6] expires
        Time - DeathTimer[7] expires
        Time - DeathTimer[8] expires
        Time - DeathTimer[9] expires
        Time - DeathTimer[10] expires
        Time - DeathTimer[11] expires
        Time - DeathTimer[12] expires
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Integer((Remaining time for DeathTimer[(Integer A)]))) Equal to 0
                    Then - Actions
                        Countdown Timer - Destroy DeathTimerWindow[(Integer A)]
                    Else - Actions
02-18-2004, 11:57 PM#5
volatile
Thx.