• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] How to make simple timer? (+rep)

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
yes. i made this and its not starting?

  • Countdown
    • Events
    • Conditions
    • Actions
      • Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in 3.00 seconds
      • Unit - Unpause all units
and i have another trigger that activates this trigger.
 
Here you go, requires two variables.
  1. Timer of type Countdown Timer
  2. TimerWindow of type Timer Window

  • StartTimer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for Timer with title Countdown
      • Set TimerWindow = (Last created timer window)
      • Countdown Timer - Show TimerWindow
If you're never going to use the window or timer again, you should destroy them to prevent leaks.

  • DestroyTimer
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Custom script: call DestroyTimer(udg_Timer)
      • Countdown Timer - Destroy TimerWindow
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
hey

i made this so far

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 3.00 seconds
      • Countdown Timer - Create a timer window for Timer with title Game starts in
      • Set TimerWindow = (Last created timer window)
      • Countdown Timer - Show TimerWindow
      • Unit - Unpause all units
  • Destroy
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Custom script: Custom script: call DestroyTimer(udg_Timer)
      • Countdown Timer - Destroy (Last created timer window)
and i get an error when saving the map?
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
says

//===========================================================================
// Trigger: Destroy
//===========================================================================
function Trig_Destroy_Actions takes nothing returns nothing
Custom script: call DestroyTimer(udg_Timer)
call DestroyTimerDialogBJ( GetLastCreatedTimerDialogBJ() )
endfunction
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
lmao. ok man sry for this easy...

yay it works saving now + rep for you and this other guy!

btw can i have this wait inside it?

  • Timer
    • Events
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 3.00 seconds
      • Countdown Timer - Create a timer window for Timer with title Game starts in
      • Set TimerWindow = (Last created timer window)
      • Countdown Timer - Show TimerWindow
      • Wait 3.00 seconds
      • Unit - Unpause all units
because all units gona be paused till 3 seconds elapsed ;)
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
yes im serious. i dident understand what he means man.

Don't use wait.

Use a trigger with event timer ends. Do he mean change the trigger i have to timer ends?
Then do the action you want. And then do action ?

And also i have dyslexia hard for me understand this. dont be rude man!

And its more easy to understand if i see whole trigger in trigger tags.

Dyslexia is characterized by difficulty with learning to read fluently and with accurate comprehension despite normal intelligence.[1][2] [3] This includes difficulty with phonological awareness, phonological decoding, processing speed, orthographic coding, auditory short-term memory, language skills/verbal comprehension, and/or rapid naming.
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
thnx.

like this?

Timer Ends
Events
Time - Timer expires (Timer is the variable)
Conditions
Actions
Unit - Unpause all units (And unpause all units)

And thnx for the help i can get here.

I needed to read that text for about 20 times before i understod :p sry
 
Last edited:
Status
Not open for further replies.
Top