• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

countdown timer [Reviewed: Ralle]

Level 14
Joined
Nov 4, 2006
Messages
1,241
1. What is a Countdown Timer?
Countdown Timers are some kind of clock used to indicate the remaining time until an event

2. How do you create Countdown Timers?
First of all, there are two types of Countdown Timers, periodic timers and one-time timers

a) One-time Timers

Let's start with one-time timers:
First we need two variables, one for the timer itself and one for the timerwindow. Go to Triggereditor and press CTRL + B, then a little window labelled variables appears. then press CTRL + N and another window titled variable shows up.
There you can select type and name of your variable. for the timer i used the name "Timer" , for the variable type look for "timer", then press OK.
Now create a second variable, i called it "timer_window", the variabletype is "timer-window"

Now let's create the Timer:
Make a Trigger with any title, e.g. Eventtimer:
  • Eventtimer
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a one-time timer that will expire in 60.00 seconds
      • Set Timer = (Last started timer)
      • Countdown Timer - Create a timer window for Timer with title time until next Event
      • Set timer_window = (Last created timer window)
      • Countdown Timer - Show timer_window
of course you can edit the time until it expires and the title of the window to anything you like


b) Periodic Timers

periodic timers are as simple to create, they can be used if you have a periodic event and want everybody being able to see when the next event happens

  • Eventtimer
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a periodic timer that will expire in 60.00 seconds
      • Set Timer = (Last started timer)
      • Countdown Timer - Create a timer window for Timer with title time until next Event
      • Set timer_window = (Last created timer window)
      • Countdown Timer - Show timer_window
you can use the same variables (of course you need to make one additional variable for each timer/timer-window you have) for this.
as you see the only difference is in this line:
Timer - Start timer as a periodic timer that will expire in 60.00 seconds

if you want to show the timer only to specific players, then don't use the "show timer_window" action. there is another action called "show timer window for player" there you can select any player you want

Note: the Event "Elapsed game time is 0.01 seconds" is necessary because timerwindows can't be displayed on map initalization, of course it doesn't matter if you choose any other event

3. Timer based Events
This is just some additional information, if you want to use this timer for triggering an event just make a trigger, go to Events -> Time -> Timer expires then select the variable of the timer you have. It should look like this then:
  • Timer-Event
  • Events
    • Time - Timer expires
  • Actions
    • ....
I know this is some kind of basics, but i didn't see any tutorial dealing with this, so i thought it might help some people
(pls tell me if i did any mistakes in translating the WE terms, cause i have the german version and i don't know if i used the correct terms, although the meaning should be correct)
 
Last edited:
Top