Game Clock Sync Problem

Bloodydood

New Member
Reaction score
14
Working on a hero arena and it seems my clock won't go in sync with the countdown timer for duels.

I've filtered the initialization trigger to just what affects the actual clock trigger.

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 1.00 seconds
      • Trigger - Turn on Clock <gen>
      • Trigger - Run Time <gen> (ignoring conditions)

And here's the actual clock trigger, (Initially Off)

Variable used: Time (Integer Array (6))

Trigger:
  • Clock
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 1.00 seconds
      • Set Time[1] = (Time[1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Time[1] Greater than or equal to 10
        • Then - Actions
          • Set Time[1] = 0
          • Set Time[2] = (Time[2] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Time[2] Greater than or equal to 6
            • Then - Actions
              • Set Time[2] = 0
              • Set Time[3] = (Time[3] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Time[3] Greater than or equal to 10
                • Then - Actions
                  • Set Time[3] = 0
                  • Set Time[4] = (Time[4] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Time[4] Greater than or equal to 6
                    • Then - Actions
                      • Set Time[4] = 0
                      • Set Time[5] = (Time[5] + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Time[5] Greater than or equal to 10
                        • Then - Actions
                          • Set Time[5] = 0
                          • Set Time[6] = (Time[6] + 1)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • Multiboard - Change the title of Multiboard to (Time Played: |cffffffff + ((String(Time[6])) + ((String(Time[5])) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + ((String(Time[4])) + ((String(Time[3])) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + ((String(Time[2])) + ((String(Time[1])) + |r)))))))))
      • Trigger - Run (This trigger) (ignoring conditions)

And yes I set up the clock to be shown as the Multiboard title, (It was a huge pain to set it up correctly last night).

Here's how I have the countdown timer set up (Filtered out everything to do with the actual duel)

Trigger:
  • Timer
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Countdown Timer - Create a timer window for Temp_Timer with title Duel in:
      • Set Temp_TimerWindow = (Last created timer window)
      • Countdown Timer - Show Temp_TimerWindow
      • Countdown Timer - Start Temp_Timer as a One-shot timer that will expire in 590.00 seconds

Trigger:
  • Timer Expire
    • Events
      • Time - Temp_Timer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy Temp_TimerWindow
      • Trigger - Turn on Timer 2 &lt;gen&gt;

Trigger:
  • Timer 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Duel Area &lt;gen&gt; contains (Triggering unit)) Equal to True
    • Actions
      • Wait 5.00 seconds
      • Countdown Timer - Create a timer window for Temp_Timer with title Duel in:
      • Set Temp_TimerWindow = (Last created timer window)
      • Countdown Timer - Show Temp_TimerWindow
      • Countdown Timer - Start Temp_Timer as a One-shot timer that will expire in 595.00 seconds


I have an alternative to just warn players of the upcoming duel in x seconds, wait x seconds, and then go on with the duel.
 

Bloodydood

New Member
Reaction score
14
I'm trying to figure out why I get a 5 minute warning for a duel at a sooner time than 00:05:00 when the duel's intended to be at 00:10:00
 

TheCrystal

New Member
Reaction score
36
To me, it looks like a Jumbled mess. is the "Clock" trigger basically a Multiboard countup timer?
It seems like you're using way too many triggers to do a simple "Every 10 minutes do a duel" kind of thing.
 

Bloodydood

New Member
Reaction score
14
To me, it looks like a Jumbled mess. is the "Clock" trigger basically a Multiboard countup timer?
It seems like you're using way too many triggers to do a simple "Every 10 minutes do a duel" kind of thing.

4 Triggers for the Duel.

1st warns of the upcoming duel.
2nd prepares the duel and then starts the countdown.
3rd is the countdown and starts the duel.
4th gives the results once one of the duelers die and the game continues with all heroes in their original positions as before the duel.

triggers 2 and 3 can be compressed to 1 trigger but I like to cut it up and change things if need be.

1 Trigger to keep track of time. (Now)

Trigger:
  • Clock
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Wait 1.00 seconds
      • Set Time[1] = (Time[1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Time[1] Equal to 10
        • Then - Actions
          • Set Time[1] = 0
          • Set Time[2] = (Time[2] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Time[2] Equal to 6
            • Then - Actions
              • Set Time[2] = 0
              • Set Time[3] = (Time[3] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Time[3] Equal to 10
                • Then - Actions
                  • Set Time[3] = 0
                  • Set Time[4] = (Time[4] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Time[4] Equal to 6
                    • Then - Actions
                      • Set Time[4] = 0
                      • Set Time[5] = (Time[5] + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Time[5] Equal to 10
                        • Then - Actions
                          • Set Time[5] = 0
                          • Set Time[6] = (Time[6] + 1)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • Multiboard - Change the title of Multiboard to (Time Played: |cffffffff + ((String(Time[6])) + ((String(Time[5])) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + ((String(Time[4])) + ((String(Time[3])) + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + ((String(Time[2])) + ((String(Time[1])) + |r)))))))))
      • Trigger - Run (This trigger) (ignoring conditions)
 

TheCrystal

New Member
Reaction score
36
You're warning with a Game - Text Message?
Can you show us this trigger?
I suggest you use Elapsed Time: 0:00, I believe that even works with Multiboards, or just do 0:01 as to be safe. The "Wait" isn't really needed.

Does the Duel start at the INTENDED time or does it decide to start a little bit later, like five minutes after the warning (which is showing up at the wrong time)? The whole thing is confusing me without the whole puzzle.
 

Bloodydood

New Member
Reaction score
14
Trigger:
  • Warning
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Temp_PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to Temp_PlayerGroup the text: Next duel in |cffff...
      • Custom script: call DestroyForce( udg_Temp_PlayerGroup )
      • Wait 420.00 seconds
      • Set Temp_PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to Temp_PlayerGroup the text: Next duel in |cffff...
      • Custom script: call DestroyForce( udg_Temp_PlayerGroup )
      • Wait 60.00 seconds
      • Set Temp_PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to Temp_PlayerGroup the text: Next duel in |cffff...
      • Custom script: call DestroyForce( udg_Temp_PlayerGroup )
      • Wait 60.00 seconds
      • Set Temp_PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to Temp_PlayerGroup the text: Next duel in |cffff...
      • Custom script: call DestroyForce( udg_Temp_PlayerGroup )
      • Wait 30.00 seconds
      • Set Temp_PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to Temp_PlayerGroup the text: Next duel in |cffff...
      • Custom script: call DestroyForce( udg_Temp_PlayerGroup )
      • Wait 30.00 seconds
      • Trigger - Run Setup &lt;gen&gt; (ignoring conditions)


Elapsed time is used to keep from interfering with creating the Multiboard.

Warnings and duels start sooner than intended.

Recent thought: Could base it all on the clock instead of a separate system like this.
So if Timer[4] = 1 then Trigger - Run Setup <gen> (ignoring conditions)
Timer[4] being the 2nd digit for minutes or 00:#0:00
 

TheCrystal

New Member
Reaction score
36
"Waits" are always off by at least .25 seconds (tested), this could be part of your problem.

Set TempReal = (Remaining time for Timer)
I'm pretty this may be useful for you, at least. Could always make a periodic event that checks how much time is left (Every 1 second) and if it's within a certain Integer do shit (may be off a small amount since you're using a periodic). Hey, here's an idea, do a periodic .01 and set the multiboard the amount of time left in the Timer, (Do a Integer Conversion so it doesn't show 15.2545).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top