1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Dialog Buttons

Discussion in 'World Editor Help Zone' started by Lee_Go, Nov 27, 2009.

  1. Lee_Go

    Lee_Go

    Joined:
    May 1, 2009
    Messages:
    156
    Resources:
    0
    Resources:
    0
    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?
     
  2. Dark Soul

    Dark Soul

    Joined:
    Nov 6, 2009
    Messages:
    156
    Resources:
    0
    Resources:
    0
    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: Nov 27, 2009
  3. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    This is the dialog-trigger I use for one of my maps (in progress):

    Dialog Trigger - Init

    • 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)


    Dialog Triggers - Click Dialog

    • 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:



    Dialog Triggers - Click Dialog

    • 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.
     
  4. FlameSoul

    FlameSoul

    Joined:
    Nov 7, 2009
    Messages:
    69
    Resources:
    0
    Resources:
    0
    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)
     
  5. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    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...
     
  6. Lee_Go

    Lee_Go

    Joined:
    May 1, 2009
    Messages:
    156
    Resources:
    0
    Resources:
    0
    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.