• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Timer

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,614
Hello guys.

I have a minor problem I tried, but couldn't do it. I'm going to add a timer that shows how long player have played.

Could you quickly create a new map and add a trigger to it; when player writes in the chat a number, instantly comes that number in this format as game message: "Game played: 00:00:00." The first two numbers means hours, the second two minutes and the last two seconds.

Thanks for the help.
 
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • If/Then/Else(Multiple functions)
      • If
        • Seconds Smaller then 60
      • Then
        • Set Seconds = Seconds + 1
      • Else
        • Set Miniutes = Miniutes + 1
        • Set Seconds = 0
          • If/Then/Else Multiple functions
            • If
              • Miniutes smaller then 60
            • then
              • Set Miniutes equal to 0
              • Set Hours = Hours + 1
  • Events
    • Any player types -Time as an exact match (make 12 events for this)
  • Conditions
  • Actions
    • Display timed text to player, (Triggering player), "Game Played: " + Integer to string(Hours) + ":" + Integer to string(Miniutes) + ":" + Integer to string(Seconds)
should work.
 
Level 7
Joined
Jul 18, 2009
Messages
272
  • Count Time
    • Ereignisse
      • Zeit - Every 1.00 seconds of game time
    • Bedingungen
    • Aktionen
      • Set Seconds = (Seconds + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Seconds Gleich 60
        • 'THEN'-Aktionen
          • Set Seconds = 0
          • Set Minutes = (Minutes + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Minutes Gleich 60
            • 'THEN'-Aktionen
              • Set Minutes = 0
              • Set Hours = (Hours + 1)
            • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
With this you will have seconds, minutes and hours each in a separate variable. Then all you need is "Concentrate Strings" and "Convert Integer to String" and you can show your time.

/edit: too slow :(

/edit2: ikillforeyou's trigger is wrong.
 
Could be something easy like this:

  • Custom Gametime
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing / as Ein Teil-String
    • Bedingungen
    • Aktionen
      • Set h_custom = (Integer((Substring((Entered chat string), 2, 3))))
      • Set m_custom = (Integer((Substring((Entered chat string), 4, 5))))
      • Set s_custom = (Integer((Substring((Entered chat string), 6, 7))))
      • Spiel - Display to (All players) the text: (Game played: + (((String(h_custom)) + :) + (((String(m_custom)) + :) + (String(s_custom)))))
added normal Elapsed Game time in attached map..


PS: Damn, was just reading this and triggered something fast, get something to drink in between and posted.. and wtf many other posts?!?! LOL :D (hm okay looked at the time, was too lazy to be fast, just chilled and did some stuff, meh )

Well you have a lot of ideas and solutions now haha :)
 

Attachments

  • Gameplay-Time.w3x
    17.5 KB · Views: 41
Status
Not open for further replies.
Top