• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Action Boxes?

Status
Not open for further replies.
Level 7
Joined
May 21, 2009
Messages
289
Sorry if the title is incorrect, but how to you trigger the "boxes" that appear and allow you to choose actions from, like if you hit "esc" in some games they appear, can this be done in GUI? I would like to use them in my game.

I +rep! thanks!
 
Level 7
Joined
Mar 26, 2009
Messages
345
I could swear the hive had a dialog box tutorial - but I can't find it.

ANYWAY:

Below is a sample trigger I wrote to remind myself how it's done. I used two variables:
ChoicesDialog - Dialog - New Dialog (Default)
DialogButton - Dialog Buton Array (2) - None

  • MissionDialog
    • Events
    • Conditions
    • Actions
      • Dialog - Clear ChoicesDialog
      • Dialog - Change the title of ChoicesDialog to Will you do this?
      • Dialog - Create a dialog button for ChoicesDialog labelled Yes
      • Set DialogButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for ChoicesDialog labelled No
      • Set DialogButton[2] = (Last created dialog Button)
      • Dialog - Show ChoicesDialog for Player 1 (Red)
  • MissionYES
    • Events
      • Dialog - A dialog button is clicked for ChoicesDialog
    • Conditions
      • (Clicked dialog button) Equal to DialogButton[1]
    • Actions
      • Dialog - Hide ChoicesDialog for Player 1 (Red)
      • Game - Display to (All players) the text: You have chosen to do this
  • MissionNO
    • Events
      • Dialog - A dialog button is clicked for ChoicesDialog
    • Conditions
      • (Clicked dialog button) Equal to DialogButton[2]
    • Actions
      • Dialog - Hide ChoicesDialog for Player 1 (Red)
      • Game - Display to (All players) the text: You have chosen not to do this
 
Ehh, yes... this is the tutorial ;)

Anyhow, instead of using 1 trigger for each action, you can also do this:

  • Dialog Actions
    • Events
      • Dialog - A dialog button is clicked for MyDialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[1]
        • Then - Actions
          • Player - Add 100 to Player 1 (Red) Current gold
          • Game - Display to Player Group - Player 1 (Red) the text: You have recieved 100 gold
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: You didn't want any gold
This is more efficient than using 2 triggers (1 for receiving gold, 1 if you didn't want any gold).
 
Status
Not open for further replies.
Top