how would i go about starting a timer, like a timer in the top right corner of the screen that every player can see, i needs to count up from 1 to 7min and 30 seconds. The timer window would read- Player [playername] has controlled unit X for [time]. It should start when any player gains control of unit X, and reset if he loses control. Any help is appreciated (maybe having the window with the timer change color according the player that owns the unit would be cool).
Thx
I would to it with Dialogs. Make a variabale countdown (Integer). Make a Dialog, make it visible for all players, add dialog item (label), set text of dialog item to name of player, add dialog item (label), set text of dialog item to (convert Integer to text) countdown
Add trigger with periodic event every 1 second. Modify countdown +1
If you want your timer displayed like 00:00 then do something like: set text of dialog item to\ combine text multiple: countdown/60, " : ", countdown - (countdown/60*60)
There is a timer function, but I dont know how to use it. :)
A Timer Window variable (May not be needed in all cases, but I recommend using it as a matter of "good habit")
To create the timer initially (in your Map Initialization trigger, for example):
Start Timer "TimerVariableName" as a One Shot timer that will expire in 450 seconds (that's your 7:30)
Create a Timer Window for Last Created Timer with the title "Whatever text you want next to the timer:", initially Hidden
Set TimerWindowVariableName to Last Created Timer window
Pause TimerVariableName
Then, any time Unit X changes owners, run:
Restart TimerVariableName
Show TimerWindowVariableName
You may need an Unpause TimerVariableName too - not sure if that's rolled into the Restart
(optional) A Switch tied to the Owner of Unit X, with a Set Timer Window Color based on the number of the controlling player. (I can explain further if you don't know how Switches work)
And finish it off with a Timer Expires event to detect someone hitting the 7:30 mark.
how would i go about starting a timer, like a timer in the top right corner of the screen that every player can see, i needs to count up from 1 to 7min and 30 seconds. The timer window would read- Player [playername] has controlled unit X for [time]. It should start when any player gains control of unit X, and reset if he loses control. Any help is appreciated (maybe having the window with the timer change color according the player that owns the unit would be cool). Thx
@Conradjd: Go
I would to it with Dialogs. Make a variabale countdown (Integer). Make a Dialog, make it visible for all players, add dialog item (label), set text of dialog item to name of player, add dialog item (label), set text of dialog item to (convert Integer to text) countdown
Add trigger with periodic event every 1 second. Modify countdown +1
If you want your timer displayed like 00:00 then do something like: set text of dialog item to\ combine text multiple: countdown/60, " : ", countdown - (countdown/60*60)
There is a timer function, but I dont know how to use it. :)
@Conradjd: Go
First, the things you need to make a timer:
To create the timer initially (in your Map Initialization trigger, for example):
Then, any time Unit X changes owners, run:
And finish it off with a Timer Expires event to detect someone hitting the 7:30 mark.
@Telthalion: Go
Thank you soooooooo MUCH!!! you explained it perfectly and i now understand how timers work!!!!