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

Game Time

Status
Not open for further replies.
Level 5
Joined
Jun 24, 2009
Messages
118
Hello, I want to create GAME TIME to my multiboard but I don't now how. Can somebody help me?And not only seconds,but minutes too.
 
Level 5
Joined
Jun 24, 2009
Messages
118
I need just game time . 1-60sec = 1:00 1-61sec ir 1:01 etc. .. Did you get it what I need? :) I need trigger or a little tut how to do it.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Multib
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 1 rows, titled Elapsed Time
      • Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 5.00% of the total screen width
      • Multiboard - Show (Last created multiboard)
  • Update Multiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set GAME_TIME = (GAME_TIME + 1)
      • Set Temp_Integer_1 = GAME_TIME
      • Set Temp_Integer_2 = 0
      • Set Temp_Integer_3 = 0
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_1 Greater than or equal to 3600
            • Then - Actions
              • Set Temp_Integer_1 = (Temp_Integer_1 - 3600)
              • Set Temp_Integer_2 = (Temp_Integer_2 + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Integer_1 Greater than or equal to 60
                • Then - Actions
                  • Set Temp_Integer_1 = (Temp_Integer_1 - 60)
                  • Set Temp_Integer_3 = (Temp_Integer_3 + 1)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer_2 Greater than or equal to 1
        • Then - Actions
          • Set Temp_String_1 = ((String(Temp_Integer_2)) + ( h + ((String(Temp_Integer_3)) + ( m + ((String(Temp_Integer_1)) + s)))))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_3 Greater than or equal to 1
            • Then - Actions
              • Set Temp_String_1 = ((String(Temp_Integer_3)) + ( m + ((String(Temp_Integer_1)) + s)))
            • Else - Actions
              • Set Temp_String_1 = ((String(Temp_Integer_1)) + s)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Temp_String_1
 
Level 5
Joined
Jun 24, 2009
Messages
118
Well,thanks but when I tested game this isn't working - shows only ''s'' word.And that's all. I need numbers.. 1-60 ,60= 1:00 etc.
 
Level 12
Joined
Mar 10, 2008
Messages
869
Maker,
That way is bad, difficult for newbies.
Try:
  • Game Time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Seconds = (Seconds + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Seconds Equal to 60
        • Then - Actions
          • Set Seconds = 0
          • Set Minutes = (Minutes + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Minutes Equal to 60
            • Then - Actions
              • Set Minutes = 0
              • Set Hours = (Hours + 1)
            • Else - Actions
        • Else - Actions
Then just do your multiboard stuff.
 
Level 5
Joined
Jun 24, 2009
Messages
118
Now my trigger looks like this:

  • GameTimer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempString = ((String[Hours] + (: + (String[Minutes] + :))) + String[Seconds])
      • Set Seconds = (Seconds + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Seconds Equal to 60
        • Then - Actions
          • Set Seconds = 0
          • Set Minutes = (Minutes + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Minutes Equal to 60
            • Then - Actions
              • Set Minutes = 0
              • Set Hours = (Hours + 1)
            • Else - Actions
        • Else - Actions
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 4 to TempString
But when I test map,then there are no numbers - only ::. Why?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Maker,
That way is bad, difficult for newbies.
Then just do your multiboard stuff.

Yeah, your is better :)

Now my trigger looks like this:
But when I test map,then there are no numbers - only ::. Why?

Your set Temp_string should be just before Multiboard - set text...not in the beginning.

You don't need to use a string array if you have variables for minutes hours and seconds.

Set TempString = ((String(Hours) + :) + (String(Minutes) + :))) + String(Seconds))
 
Level 5
Joined
Jun 24, 2009
Messages
118
Yeah, but anyway then I tested the map I had other /mistake/ - if minute isn't passed then anyway I see 0:1:1~ at the start.Something is wrong... :O

Anyway I get it about the String. :)
 
Status
Not open for further replies.
Top