• 🏆 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!

[Trigger] Help with hiding a dialog.

Status
Not open for further replies.
Level 2
Joined
Oct 29, 2010
Messages
6
Hi there.

Basically I have these triggers already.

  • DriverSelectDialog
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to DriverHasntSelected
      • Dialog - Clear DriverSelectDialog
      • Dialog - Change the title of DriverSelectDialog to Please select one:
      • Dialog - Create a dialog button for DriverSelectDialog labelled |cff00FF00Shooter|r
      • Set DriverSelectButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for DriverSelectDialog labelled |cffFF0000Driver|r
      • Set DriverSelectButton[2] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show DriverSelectDialog for (Picked player)
      • Player Group - Pick every player in DriverHasBeen and do (Actions)
        • Loop - Actions
          • Dialog - Hide DriverSelectDialog for (Picked player)
  • DriverSelectDialogPlayer
    • Events
      • Dialog - A dialog button is clicked for DriverSelectDialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DriverSelectButton[1]
        • Then - Actions
          • Player Group - Add (Triggering player) to ShooterPlayerGroup
          • Player Group - Remove (Triggering player) from DriverHasntSelected
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DriverSelectButton[2]
        • Then - Actions
          • Player Group - Add (Triggering player) to DriverPlayerGroup
          • Player Group - Remove (Triggering player) from DriverHasntSelected
        • Else - Actions
  • DriverSelectPlayer
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Hide DriverSelectDialog for (Picked player)
      • Player Group - Pick every player in DriverHasntSelected and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to ShooterPlayerGroup
      • Trigger - Turn off DriverSelectDialogPlayer <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in DriverPlayerGroup) Equal to 0
        • Then - Actions
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text: Not enough players ...
          • Set DriverPlayer = (Random player from ShooterPlayerGroup)
          • Player Group - Add DriverPlayer to DriverHasBeen
          • Wait 2.00 seconds
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text:
          • Game - Display to (All players) the text: ((Name of DriverPlayer) + has been selected as the |cffFF0000Driver|r.)
          • Trigger - Run DriverInit <gen> (checking conditions)
          • Trigger - Run ShooterInit <gen> (checking conditions)
          • Trigger - Run GameMultiboardInit <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in DriverPlayerGroup) Greater than 1
        • Then - Actions
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text: More than one playe...
          • Set DriverPlayer = (Random player from DriverPlayerGroup)
          • Player Group - Add DriverPlayer to DriverHasBeen
          • Wait 2.00 seconds
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text:
          • Game - Display to (All players) the text: ((Name of DriverPlayer) + has been selected as the |cffFF0000Driver|r.)
          • Trigger - Run DriverInit <gen> (checking conditions)
          • Trigger - Run ShooterInit <gen> (checking conditions)
          • Trigger - Run GameMultiboardInit <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in DriverPlayerGroup) Equal to 1
        • Then - Actions
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text: Only one player has...
          • Set DriverPlayer = (Random player from DriverPlayerGroup)
          • Player Group - Add DriverPlayer to DriverHasBeen
          • Wait 2.00 seconds
          • Sound - Play AutoCastButtonClick1 <gen>
          • Game - Display to (All players) the text:
          • Game - Display to (All players) the text: ((Name of DriverPlayer) + has been selected as the |cffFF0000Driver|r.)
          • Trigger - Run DriverInit <gen> (checking conditions)
          • Trigger - Run ShooterInit <gen> (checking conditions)
          • Trigger - Run GameMultiboardInit <gen> (checking conditions)
        • Else - Actions
This is just a system for the players selecting what role they want to perform. If someone dosnt choose within the 10 second time frame they automatically get added to the shooter group. However when testing it, the final trigger which is supposed to happen at 10 seconds, doesn't happen until 10 seconds after i select, so therefore it will not hide the dialog for everyone at 10 seconds game time.. Which is what i want it to do.

How come this isn't working? Does a dialog pause the game? If it does how will this affect the game when there are multiple players. eg. One player has selected but one hasn't, will the 10 second trigger fire?

Any and all help is welcome. Thanks.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Have you tryed using timers instead?

I don't see why this doesn't hide the dialog after 10 seconds. I'll have to open up the editor myself to find out but I'm at school atm so I can only suggest you try it with timers for now :)
 
Last edited:
The event "Time - Elapsed Game time" uses a timer which are paused by some actions like this. You should use a wait in this case, like this for example :
  • DriverSelectDialog
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • ---- Blah Blah Blah ----
      • Dialog - Show DriverSelectDialog for (Picked player)
      • ---- Blah ----
      • Wait 10.00 seconds
      • Trigger - Run DriverSelectPlayer
 
Level 2
Joined
Oct 29, 2010
Messages
6
Hi there, thanks for your reply. I tried a timer and it seems as though the game is paused whilst the dialog is open. I have tried unpausing it via trigger, but that doesn't help either. However the timer looks good ingame. :p Problem still not solved though. :S

Tirlititi, I added a wait to my trigger as you said, and removed the even from the DriverSelectPlayer trigger.

  • DriverSelectDialog
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to DriverHasntSelected
      • Dialog - Clear DriverSelectDialog
      • Dialog - Change the title of DriverSelectDialog to Please select one:
      • Dialog - Create a dialog button for DriverSelectDialog labelled |cff00FF00Shooter|r
      • Set DriverSelectButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for DriverSelectDialog labelled |cffFF0000Driver|r
      • Set DriverSelectButton[2] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show DriverSelectDialog for (Picked player)
      • Player Group - Pick every player in DriverHasBeen and do (Actions)
        • Loop - Actions
          • Dialog - Hide DriverSelectDialog for (Picked player)
      • Wait 10.00 seconds
      • Trigger - Run DriverSelectPlayer <gen> (checking conditions)
However the problem still occurs. Is there something i've done wrong here?
 
Last edited:
Level 2
Joined
Oct 29, 2010
Messages
6
Oh ok, I am yet to add a trigger for stopping single player mode because of all the testing. I guess i will go with the timer for visual purposes. Thanks for all your help. +rep to both, (if i can, im new here :p)
 
Status
Not open for further replies.
Top