• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Dialog Timeout Not Working

Status
Not open for further replies.
Level 3
Joined
Mar 10, 2019
Messages
32
Hey,
I tried a timeout for the Dialog. "Wait Gametime" and also normal "Wait"! But it does not work! It only gets executed after I press a button...

What do I do wrong?

  • CreateTeamDialog
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Dialog - Clear TeamDialog
      • Dialog - Change the title of TeamDialog to Teams
      • Dialog - Create a dialog button for TeamDialog labelled Free For All (FFA)
      • Set TeamDialogButton[0] = (Last created dialog Button)
      • Dialog - Create a dialog button for TeamDialog labelled Duo (2)
      • Set TeamDialogButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for TeamDialog labelled Squad (4)
      • Set TeamDialogButton[2] = (Last created dialog Button)
      • Dialog - Show TeamDialog for Player 1 (Red)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LocalPlayer Not equal to Player 1 (Red)
        • Then - Actions
          • Dialog - Clear WaitDialog
          • Dialog - Change the title of WaitDialog to Host Choosing Game ...
          • Dialog - Show WaitDialog for LocalPlayer
        • Else - Actions
          • Do nothing
      • Game - Display to (All players) the text: testestestsetes
      • Wait 2.00 seconds
      • Dialog - Hide TeamDialog for Player 1 (Red)
      • Game - Display to (All players) the text: Host AFK choosing d...
      • Player Group - Pick every player in (All players) and do (If ((Picked player) Not equal to Player 1 (Red)) then do (Dialog - Hide WaitDialog for (Picked player)) else do (Do nothing))
      • Player Group - Make (All players) treat (All players) as an Enemy
      • Trigger - Run HeroInit <gen> (checking conditions)
      • Trigger - Run ReduceCreepDiffFFA <gen> (checking conditions)
      • Trigger - Turn on WinConditionInit <gen>
      • Trigger - Turn off (This trigger)
 
Using a countdown timer instead of the wait wouldn't really help. I believe the problem is you're probably testing only in singleplayer, but the game gets automatically paused after a short moment when you show a dialog in singleplayer. In singleplayer you need to catch the "Dialog - Button Clicked" event.

This should not happen in Multiplayer. :)
 
Level 3
Joined
Mar 10, 2019
Messages
32
Using a countdown timer instead of the wait wouldn't really help. I believe the problem is you're probably testing only in singleplayer, but the game gets automatically paused after a short moment when you show a dialog in singleplayer. In singleplayer you need to catch the "Dialog - Button Clicked" event.

This should not happen in Multiplayer. :)
Ah thank you! Yeah right now I only test in singleplayer! Didn't think that there would be a difference in multiplayer!

One additional question:
Should I use wait or wait gametime?
 
Just a normal wait, but you can use WaitGameTime, too. But we can have a little look:
  • Timers are accurate

    (normal wait: )
  • Waits have always some minimum amount of duration, which depends on current ping ( very short timeout like 0.01 may become like 0.2 )
  • Waits are inaccurate, in mutliplayer even more (depends on pings)
  • Waits do not pause on multiplayer if game is paused or waiting for player which may lead to unwanted behaviour if there are long waits that continue at a paused game
.. WaitGameTime now is a combination of both:
  1. It uses a normal timer which runs in background (this timer is accurate)
  2. It uses then the "normal wait" but with a lower duration (1/10 of wait-time remaining) in a loop
  3. Each loop run, after such a normal wait action it makes check if the before started timer has already expired.
    And if the timer says that the time is over, then the WaitGameTime does stop, too.
So the good thing is WaitGameTime won't break too much if for example a game gets paused for longer time. But in the end it still uses normal waits to check this periodically, so this will never result in a very accurate result, too.

For such cases where precise accuracy is not very important, I would personally not care. And if I would care I then timers are maybe the way to go anyway. Neither you choose won't be really bad for this.
 
Status
Not open for further replies.
Top