• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

How do you make dynamic dialogs?

Level 7
Joined
Nov 3, 2015
Messages
76
I have to idea of a dialog. It's really simple but I'm not skilled enough to understand how to make it.

2 Buttons.

1 button the toggles a boolean true/false on every press. But the dialog stays open.
1 button to confirm the choice and clsoe the dialog.

As I understand it, with each button press the dialog must be killed and reopened with the new boolean states. But how do you write this? Can someone show me please?
 
You should be able to do that with a couple triggers

  • Show Dialog
    • Events
      • // Your event here
    • Conditions
    • Actions
      • Dialog - Clear MyDialog
      • Dialog - Change the title of MyDialog to This is a dialog
      • -------- ----------------------------- --------
      • Dialog - Create a dialog button for MyDialog labelled Set to true
      • Set VariableSet MyDialogButton[1] = (Last created dialog Button)
      • -------- ----------------------------- --------
      • Dialog - Create a dialog button for MyDialog labelled Confirm
      • Set VariableSet MyDialogButton[2] = (Last created dialog Button)
      • -------- ----------------------------- --------
      • Dialog - Show MyDialog for Player 1 (Red)
  • Button 1
    • Events
      • Dialog - A dialog button is clicked for MyDialog
    • Conditions
      • (Clicked dialog button) Equal to MyDialogButton[1]
    • Actions
      • Dialog - Clear MyDialog
      • Dialog - Change the title of MyDialog to This is a dialog
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MyBoolean Equal to False
        • Then - Actions
          • Dialog - Create a dialog button for MyDialog labelled Set to false
          • Set VariableSet MyDialogButton[1] = (Last created dialog Button)
          • Set VariableSet MyBoolean = True
        • Else - Actions
          • Dialog - Create a dialog button for MyDialog labelled Set to true
          • Set VariableSet MyDialogButton[1] = (Last created dialog Button)
          • Set VariableSet MyBoolean = False
      • -------- ----------------------------- --------
      • Dialog - Create a dialog button for MyDialog labelled Confirm
      • Set VariableSet MyDialogButton[2] = (Last created dialog Button)
      • -------- ----------------------------- --------
      • Dialog - Show MyDialog for Player 1 (Red)
This is supposing that the boolean is false by default, change the text depending on what you're doing in your map. The thing to keep in mind is that a dialog must be cleared before you make any changes to it, otherwise more buttons will add up and it'll be a mess. Then you don't even need a trigger for the 2nd button because it close the dialog by default
 
It is in GUI :) First you need to create variables (the yellow X in the trigger editor)

1760260523706.png


then you set them with this action

1760260424557.png
 
Back
Top