• 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.

Makeing a Timer

Status
Not open for further replies.
Level 14
Joined
Nov 18, 2007
Messages
1,084
Example trigger:
  • LeaveRoom
    • Events
      • Unit - A unit leaves MyRoom <gen>
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for MyTimer with title My Countdown Timer
      • Set MyTimerWindow = (Last created timer window)
      • -------- Turn off the trigger so that it won't get fired repeatedly unless you want that. I suppose you could also destroy the trigger too with custom script. --------
      • Trigger - Turn off (This trigger)
  • TimerExpires
    • Events
      • Time - MyTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy MyTimerWindow
      • -------- Do things here --------
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Use [TRIGGER]*text goes here[/TRIGGER] tags. There's an icon for it also.

Right click the trigger's name on the right pane in trigger editor, and select "copy as text". Then paste it.

To create the variable, open trigger editor (F4) and then variable editor (Ctrl + B). Then create new variable of type timer and give it some name.
 
Level 6
Joined
May 26, 2010
Messages
212
  • Spore Spawning
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 5.00 seconds
      • Countdown Timer - Create a timer window for MyTimer with title My Countdown Timer ...
      • Trigger - Turn off (This trigger)
 
Level 6
Joined
May 26, 2010
Messages
212
  • Destroy Timer
    • Events
      • Time - MyTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Spore Eggs have bee...
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 300.00 seconds
      • Unit - Create 1 Spore Eggs for Player 12 (Brown) at (Random point in (Playable map area)) facing Default building facing degrees
 
Level 6
Joined
May 26, 2010
Messages
212
ok well after both go down it just starts over again and the expired ones are staying on the screen
  • Eggs Are Lain
    • Events
      • Unit - A unit leaves Region 001 <gen>
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for MyTimer with title Eggs are Lain
      • Countdown Timer - Show (Last created timer window)
      • Trigger - Turn off (This trigger)
  • Eggs Hatch
    • Events
      • Time - MyTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Spore Eggs have bee...
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 300.00 seconds
      • Countdown Timer - Create a timer window for EndingTimer with title Eggs Hatch
      • Countdown Timer - Show (Last created timer window)
      • Unit - Create 1 Spore Eggs for Player 12 (Brown) at (Random point in (Playable map area)) facing Default building facing degrees
 
Status
Not open for further replies.
Top