• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Timer

Status
Not open for further replies.
Level 3
Joined
Nov 17, 2009
Messages
42
This is probably really simple but.

Is it possible to make a timer in a leader bored box. That counts down?

I can't seem to get this right in Gui.

Any help is much appreciated and +rep :thumbs_up:
 
Is this what your looking for?

  • Create Leaderbord
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • Set Timer = 360
      • Leaderboard - Add Neutral Passive to (Last created leaderboard) with label Time and value Timer
      • Leaderboard - Change the label for Neutral Passive in (Last created leaderboard) to Timer
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Timer = (Timer - 1)
      • Leaderboard - Change the value for Neutral Extra in (Last created leaderboard) to Timer
      • -------- You could add an If/Then/Else/Muliple functions here to make the trigger do stuff when the timer reaches 0 --------
You can of course change 360 to whatever you want.

Hope that helps
 
Yeah, but what is the index on the variable? I cant just do set timer = x amount of time
is the variable an array? I cant set the value it gives me the "timer window (timer dialog)" window. This is the part i'm stuck at.
 
Im abit confused about what your asking now. Im not actual creating a timer with the set timer = x part im just setting an integer variable. The variable is not an array and you can edit globals (used in Gui) in the Variable editor (control - B). You could also check the array box if you wanted to use the array multiple different times (like have 5 different counters in the leader box). Is that what you where asking? If not please clarify.
 
Sorry about not being completely clear on this. I just need a number like 60 to count down every second in a leaderbored box to 0.

The rest after that I know what to do its just getting the actual timer to work.
 
He told you already, actually. Try this one:
  • Create Leaderbord
  • Events
    • Time - Elapsed game time is 0.00 seconds
  • Conditions
  • Actions
    • Leaderboard - Create a leaderboard for (All players) titled Kills
    • Leaderboard - Add Neutral Passive to (Last created leaderboard) with label Time and value 60
    • Leaderboard - Change the label for Neutral Passive in (Last created leaderboard) to Timer
    • Trigger - Turn on Trigger2 <gen>
  • Trigger2
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Set Timer = (Timer + 1)
    • Leaderboard - Change the value for Neutral Extra in (Last created leaderboard) to (60 - (Timer))
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • Timer Equal to 60 //This is an Integer Comparison
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
Timer is an integer variable, as Arcmage already mentioned.
 
Last edited:
  • Set Timer = (Timer - 1)
Shouldn't that be:
  • Set Timer = (Timer + 1)
Unless I'm missing something here. =P Else it can just be:
  • Trigger2
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Set Timer = (Timer - 1)
    • Leaderboard - Change the value for Neutral Extra in (Last created leaderboard) to (Timer)
    • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • Timer Equal to 0 //This is an Integer Comparison
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
If the Timer integer is initially set to 60. Right?
 
Status
Not open for further replies.
Back
Top