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

Timer

Status
Not open for further replies.
Level 1
Joined
Nov 20, 2012
Messages
3
How creat timer whith minutes and seconds in the upper right corner of the?
[ _x_ : _y_ ]

x-miutes
y-secods

Please help me.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
First, you'll need two integer values to keep track of the time.
integer - Minutes
integer - Seconds

Then you need a trigger that increments it.
  • Time
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • none
  • Actions
    • Set Seconds = Seconds +1
    • ----- Next we need to increment minutes when seconds reaches 60.
    • If Then Else - Multiple Actions
      • If - Conditions
        • Integer - (Seconds equal to 60)
      • Then - Actions
        • Set Seconds = 0
        • Set Minutes = Minutes + 1
      • Else - Actions
        • Do Nothing
Now we need to display this to the players, I'm assuming you want it like in DotA, where it replaces Lumber and Food.

So Pick every player in all players, and set Lumber = minutes, and Food Used = seconds.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Where is action create timer?

I want create timer in window.

this is all the list of actions for timer. you need two kind of variable (one is Timer variable and the other is Timer Window variable) to keep track of each Timer started or Timer Window created, so you can stop or destroy it afterwards.

  • Countdown Timer - Start YourTimer as a one-shot timer that will expire in x.xx seconds
  • Countdown Timer - Create a timer window for YourTimer
  • Countdown Timer - Pause YourTimer
  • Countdown Timer - Destroy YourTimerWindow
  • Countdown Timer - Hide YourTimerWindow for Player 1 (Red)
  • Countdown Timer - Hide YourTimerWindow
  • Countdown Timer - Change the title of YourTimerWindow to YourTitle
  • Countdown Timer - Change the color of the title for YourTimerWindow to (100.00%, 80.00%, 20.00%) with 0.00% transparency
  • Countdown Timer - Change the color of the time for YourTimerWindow to (100.00%, 80.00%, 20.00%) with 0.00% transparency
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Wait, you want a countdown timer (one that goes from 5:00 to 0:00 for example), or a timer that shows the elapsed game time?
You have to be more specific.

Also, ruler: I know you don't usually use "Do Nothing" and it's probably just for clarification, but please don't use it.
People who are new to the editor will think "oh, that belongs there", while it certainly doesn't.
 
Level 1
Joined
Nov 20, 2012
Messages
3
So.. I want create timer 2 minutes 1:59, 1:58, ... 0:01, 0:00, next to strat the new timer 0:01, 0:02, 0:03 to the end game.

Bath timer must be in window. When first is end, next to start second timer.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
If you want the game time to be exact you can do:

  • GameTime
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set udg_GameTime_Window = CreateTimerDialog(bj_gameStartedTimer)
      • Countdown Timer - Show GameTime_Window
This timer will count the game time upwards.
(Not sure if I'm using this correctly, but I can vaguely recall that it was done in this sort of way)
 
Status
Not open for further replies.
Top