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

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
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
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