• 🏆 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!

Dynamically updated turn timer count per minute elapsed

Status
Not open for further replies.
Level 2
Joined
Nov 15, 2010
Messages
16
Hi,

How can I create a dynamically updated timer that will change the title every minute?
e.g. when I just create the timer the first time it would say:

time passed 1 minute 0:60

then it will tick every second going:
time passed 1 minute 0:59
time passed 1 minute 0:58
time passed 1 minute 0:57
...
time passed 1 minute 0:01
  • Income Timer
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start TestTimer as a Repeating timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Time Passed + 1 minute)
Then once it reaches 60 second countdown, it would go:
time passed 2 minutes 0:60
time passed 2 minutes 0:59
time passed 2 minutes 0:58
time passed 2 minutes 0:57
...
time passed 2 minutes 0:01
  • Income
    • Events
      • Time - TestTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start TestTimer as a Repeating timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Time Passed + 2 minute)
but after that I am not sure how to make it update dynamically that variable before minute... Do I create 60-120 triggers like this or is there an easy way to arithmetically increment that? something like set minute = minute + 1?
...
Bonus if this can be done via the GUI-only
 
Last edited:
Level 2
Joined
Nov 15, 2010
Messages
16
Thank you Warseeker, based on the OP's first post from the thread you've mentioned and your suggestion I was able to produce what I was after

  • Income Timer
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set GameTimePlayed = 0
      • Countdown Timer - Start TimeElapsed as a Repeating timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title ((String(GameTimePlayed)) + minutes elapsed)
      • Set GameTimerWindow = (Last created timer window)
  • Income
    • Events
      • Time - TimeElapsed expires
    • Conditions
    • Actions
      • Set GameTimePlayed = (GameTimePlayed + 1)
      • Countdown Timer - Change the title of GameTimerWindow to ((String(GameTimePlayed)) + minutes elapsed)
 
Last edited:
Status
Not open for further replies.
Top