• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Timer

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
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.
 
Level 18
Joined
Mar 7, 2005
Messages
824
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: 37
Status
Not open for further replies.
Top