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

Dialog Buttons

Status
Not open for further replies.
Level 6
Joined
May 1, 2009
Messages
156
I was working with multiple dialog buttons, as in one button leads to another section of buttons, and i seems to have messed up somewhere. The first 5 buttons go to the next button screen they should but... from there, they don't do what i tell them to in their trigger. Anyone know what could be wrong?
 
Level 5
Joined
Nov 6, 2009
Messages
185
Lol, please show the trigger. :)

EDIT*
I dont think you can open another dialog from dialog button, ive tried too and didnt work. What about If/Than/Else or make the second dialog initially off, havent tried but see if it works.

DOUBLE EDIT*
I tried it and it worked! I assume you know the trigger for the first dialog. This is how to open the second.

  • Events
    • Dialog - A dialog button is clicked for Dialog1
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to Button1
      • Then - Actions
        • Dialog - Change the title of Dialog2 to Dialog 2
        • Dialog - Create a dialog button for Dialog2 labelled Button3
        • Set Button3 = (Last created dialog Button)
        • Dialog - Create a dialog button for Dialog2 labelled Button4
        • Set Button4 = (Last created dialog Button)
        • Dialog - Show Dialog2 for Player 1 (Red)
      • Else - Actions
        • Do Nothing
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
This is the dialog-trigger I use for one of my maps (in progress):


  • Init Dialogs
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • -------- Settings Overview --------
      • Dialog - Change the title of Dialog1 to Settings Overview
      • Dialog - Create a dialog button for Dialog1 labelled |c00444488Change Te...
      • Set D_Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled |c00444488Change Vi...
      • Set D_Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled |c00444488Change Po...
      • Set D_Button[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled |c00884444Done|r
      • Set D_Button[4] = (Last created dialog Button)
      • -------- Change Teams --------
      • Dialog - Change the title of Dialog2 to Change Teams
      • Dialog - Create a dialog button for Dialog2 labelled |c004444884 Corners...
      • Set D_Button[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled |c00444488East vs W...
      • Set D_Button[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled |c00444488North vs ...
      • Set D_Button[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled |c00884444Back|r
      • Set D_Button[8] = (Last created dialog Button)
      • -------- Change Victory Conditions --------
      • Dialog - Change the title of Dialog3 to Change Victory Cond...
      • Dialog - Create a dialog button for Dialog3 labelled |c00444488200 kills...
      • Set D_Button[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled |c00444488Custom Ki...
      • Set D_Button[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled |c00444488Custom K/...
      • Set D_Button[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled |c00444488Custom Po...
      • Set D_Button[12] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled |c00884444Back|r
      • Set D_Button[13] = (Last created dialog Button)
      • -------- Change Point Limit --------
      • Dialog - Change the title of Dialog4 to Change Point Limit
      • Dialog - Create a dialog button for Dialog4 labelled |c00444488Infinite ...
      • Set D_Button[14] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog4 labelled |c00444488200 Point...
      • Set D_Button[15] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog4 labelled |c00444488500 Point...
      • Set D_Button[16] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog4 labelled |c00444488Custom Po...
      • Set D_Button[17] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog4 labelled |c00884444Back|r
      • Set D_Button[18] = (Last created dialog Button)
      • Dialog - Show Dialog1 for Player 1 (Red)

  • Button Clicked
    • Events
      • Dialog - A dialog button is clicked for Dialog1
      • Dialog - A dialog button is clicked for Dialog2
      • Dialog - A dialog button is clicked for Dialog3
      • Dialog - A dialog button is clicked for Dialog4
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[1]
        • Then - Actions
          • Dialog - Show Dialog2 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[2]
        • Then - Actions
          • Dialog - Show Dialog3 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[3]
        • Then - Actions
          • Dialog - Show Dialog4 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[4]
        • Then - Actions
          • Trigger - Run Done <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[5]
        • Then - Actions
          • Game - Display to (All players) for 10.00 seconds the text: ((((String((Number of players in Force[1]))) + / ) + (String((Number of players in Force[2])))) + <Empty String>)
          • Player Group - Remove all players from Force[1]
          • Player Group - Remove all players from Force[2]
          • Player Group - Remove all players from Force[3]
          • Player Group - Remove all players from Force[4]
          • For each (Integer i[1]) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(i[1])) controller) Equal to User
                  • ((Player(i[1])) slot status) Equal to Is playing
                • Then - Actions
                  • Player Group - Add (Player(i[1])) to Force[1]
                • Else - Actions
              • For each (Integer i[2]) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • For each (Integer i[1]) from 4 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(i[1])) controller) Equal to User
                  • ((Player(i[1])) slot status) Equal to Is playing
                • Then - Actions
                  • Player Group - Add (Player(i[1])) to Force[2]
                • Else - Actions
              • For each (Integer i[2]) from 4 to 6, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • For each (Integer i[1]) from 7 to 9, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(i[1])) controller) Equal to User
                  • ((Player(i[1])) slot status) Equal to Is playing
                • Then - Actions
                  • Player Group - Add (Player(i[1])) to Force[3]
                • Else - Actions
              • For each (Integer i[2]) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • For each (Integer i[1]) from 10 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(i[1])) controller) Equal to User
                  • ((Player(i[1])) slot status) Equal to Is playing
                • Then - Actions
                  • Player Group - Add (Player(i[1])) to Force[4]
                • Else - Actions
              • For each (Integer i[2]) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • Set GameMode[4] = True
          • Set GameMode[5] = False
          • Set GameMode[6] = False
          • Game - Display to (All players) for 10.00 seconds the text: ((((String((Number of players in Force[1]))) + / ) + (String((Number of players in Force[2])))) + <Empty String>)
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[6]
        • Then - Actions
          • Player Group - Remove all players from Force[1]
          • Player Group - Remove all players from Force[2]
          • Player Group - Remove all players from Force[3]
          • Player Group - Remove all players from Force[4]
          • For each (Integer i[1]) from 7 to 9, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[1]
          • For each (Integer i[1]) from 1 to 3, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[1]
              • For each (Integer i[2]) from 7 to 9, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
                  • Player - Make (Player(i[2])) treat (Player(i[1])) as an Ally with shared vision
          • For each (Integer i[1]) from 10 to 12, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[2]
          • For each (Integer i[1]) from 4 to 6, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[2]
              • For each (Integer i[2]) from 10 to 12, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
                  • Player - Make (Player(i[2])) treat (Player(i[1])) as an Ally with shared vision
          • Set GameMode[4] = False
          • Set GameMode[5] = True
          • Set GameMode[6] = False
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[7]
        • Then - Actions
          • Player Group - Remove all players from Force[1]
          • Player Group - Remove all players from Force[2]
          • Player Group - Remove all players from Force[3]
          • Player Group - Remove all players from Force[4]
          • For each (Integer i[1]) from 1 to 6, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[1]
              • For each (Integer i[2]) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • For each (Integer i[1]) from 7 to 12, do (Actions)
            • Loop - Actions
              • Player Group - Add (Player(i[1])) to Force[2]
              • For each (Integer i[2]) from 7 to 12, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(i[1])) treat (Player(i[2])) as an Ally with shared vision
          • Set GameMode[4] = False
          • Set GameMode[5] = False
          • Set GameMode[6] = True
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Clicked dialog button) Equal to D_Button[8]
              • (Clicked dialog button) Equal to D_Button[13]
              • (Clicked dialog button) Equal to D_Button[18]
        • Then - Actions
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[9]
        • Then - Actions
          • Set GameMode[1] = True
          • Set GameMode[2] = False
          • Set GameMode[3] = False
          • Set VictoryInteger = 200
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[10]
        • Then - Actions
          • Set GameMode[1] = True
          • Set GameMode[2] = False
          • Set GameMode[3] = False
          • Trigger - Turn on Custom Kills <gen>
          • Game - Display to (All players) for 10.00 seconds the text: |c00dd7907Type in a...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[11]
        • Then - Actions
          • Set GameMode[1] = False
          • Set GameMode[2] = True
          • Set GameMode[3] = False
          • Game - Display to (All players) for 10.00 seconds the text: |c00dd7907Type in a...
          • Trigger - Turn on Custom Time <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[12]
        • Then - Actions
          • Set GameMode[1] = False
          • Set GameMode[2] = False
          • Set GameMode[3] = True
          • Game - Display to (All players) for 10.00 seconds the text: |c00dd7907Type in a...
          • Trigger - Turn on Custom Points <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[14]
        • Then - Actions
          • Set PointLimit = 999999
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[15]
        • Then - Actions
          • Set PointLimit = 200
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[16]
        • Then - Actions
          • Set PointLimit = 500
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[17]
        • Then - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |c00dd7907Type in a...
          • Trigger - Turn on Custom Points <gen>
        • Else - Actions

If I leave the non-important things out:



  • Button Clicked
    • Events
      • Dialog - A dialog button is clicked for Dialog1
      • Dialog - A dialog button is clicked for Dialog2
      • Dialog - A dialog button is clicked for Dialog3
      • Dialog - A dialog button is clicked for Dialog4
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[1]
        • Then - Actions
          • Dialog - Show Dialog2 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[2]
        • Then - Actions
          • Dialog - Show Dialog3 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to D_Button[3]
        • Then - Actions
          • Dialog - Show Dialog4 for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Clicked dialog button) Equal to D_Button[8]
              • (Clicked dialog button) Equal to D_Button[13]
              • (Clicked dialog button) Equal to D_Button[18]
        • Then - Actions
          • Dialog - Show Dialog1 for Player 1 (Red)
        • Else - Actions
There are 4 dialogs: the base dialog (Dialog1) and 3 other dialogs to change options.
The first dialog only contains dialog buttons which direct to other dialogs (so you can only click Done and other dialogs in it).
The other dialogs each contain 3-4 more options + the "Back" option (to go back ot the first dialog).

Every time an option is clicked, you will go back to the first dialog (you have to click "Done" in order to start the game).

If you wish to see how it works, I can send you the map.
 
Level 4
Joined
Nov 7, 2009
Messages
83
I think you should split up your dialog triggers a bit.
I worked once with something like this, it's a pitty it was about four or five years ago, so I don't have the triggers with me any more and I've forgotten how I did it.
Still, I recomend you, create one trigger for Dialog1 Button Is pressed, another one for Dialog2, another one for Dialog3, and so on.
That way it will be clearer to you and to everyone else what happens with each dialog.
You'll also avoid a lot of mysterious things that happen because things work slightly different than you thought and you were not seeing a tiny mistake (it's like 2+3*2 being diferent from (2+3)*2, the important thing is precedence)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think you should split up your dialog triggers a bit.
I worked once with something like this, it's a pitty it was about four or five years ago, so I don't have the triggers with me any more and I've forgotten how I did it.
Still, I recomend you, create one trigger for Dialog1 Button Is pressed, another one for Dialog2, another one for Dialog3, and so on.
That way it will be clearer to you and to everyone else what happens with each dialog.
You'll also avoid a lot of mysterious things that happen because things work slightly different than you thought and you were not seeing a tiny mistake (it's like 2+3*2 being diferent from (2+3)*2, the important thing is precedence)

I like it this way ^^
It's a bit clearer indeed, but it should be clear enough when I add custom text (which I will), since those have another color (one of the world editor's best features: you can set colors for each different action :p that helps me a lot).
Most of the time, I know exactly what I'm doing, but other people might find it hard to understand since there are so many actions, that's true...
 
Level 6
Joined
May 1, 2009
Messages
156
I figured it out on my own and its pretty simple, just alota room for error when i first did it. I dont want to even quote all the triggers i have but basically you have first 3 buttons, buttons 1 and 2 lead to 2 new options, 3rd button exits. They turn themselves off after they run so the variable numbers arent mixed.
 
Status
Not open for further replies.
Top