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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Basics of a Dialog

Discussion in 'Trigger (GUI) Editor Tutorials' started by Orc_Tamer, Mar 7, 2007.

  1. Orc_Tamer

    Orc_Tamer

    Joined:
    Jan 5, 2007
    Messages:
    41
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Basics of a Dialog

    by ragingspeedhorn & Orc_Tamer


    Note: In this tutorial we will show you how you create a simple multiply choice dialog for 1 player. Keep in mind that this is directed towards the beginners within the Trigger Editor and is in no way meant to teach the experienced modders anything that they probably didn't knew already.

    1) What is a dialog?

    A "Dialog" is a litle window that pops up which contains some buttons that you can click. An example of what a Dialog can be used for is a simple thing like if you would like to have a 100 gold. Instead of having the choice based on chat commands where you write -yes or -no it is (and looks) better to have a Dialog window apearing asking you if you would like to have a 100 gold and then having 2 buttons which says "Yes" or "No". We will now show you how you make a Dialog like I just told you about in the simpliest way (that we know of).

    2) Getting Started.

    To get started you should (ofcourse) open up the World Editor and enter the Trigger Editor (Hotkey for it is F4), the icon for it is located inbetween the Terrain Editor & the Sound Editor.

    1.jpg

    3) Creating The Variables.

    Once you entered the Trigger Editor the first thing to do is finding the Variable Editor (Hotkey for it is Ctrl+B), the icon for it is located to the left of the New Category icon.

    4.jpg

    When you are inside the Variable Editor you click on the green x with a + infront of it greenx5yy.jpg to create a new variable, then you make the two variables needed for the Dialog as shown below.

    2.jpg


    4) Creating The Dialog Window.

    Once you made your two variables you can start with the actual triggers for getting the Dialog Window to apear.

    First you create a new trigger and do as shown below.

    • The Dialog Window
      • Events
        • Time - Elapsed game time is 1.00 seconds
      • Conditions
        • None
      • Actions
        • Dialog - Clear MyDialog
        • Dialog - Change the title of MyDialog to Do you want a 100 gold?
        • Dialog - Create a dialog button for MyDialog labelled Yes
        • Set DialogButton[1] = (Last created dialog Button)
        • Dialog - Create a dialog button for MyDialog labelled No
        • Set DialogButton[2] = (Last created dialog Button)
        • Dialog - Show MyDialog for Player 1 (Red)


    Once this is done the Dialog will apear perfectly but there will be no effect when clicking the buttons.


    5) Creating The Buttons.

    To make the buttons actually do something you create two triggers as shown below.

    • Yes Button
      • Events
        • Dialog - A dialog button is clicked for MyDialog
      • Conditions
        • (Clicked dialog button) Equal to DialogButton[1]
      • 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


    • No Button
      • Events
        • Dialog - A dialog button is clicked for MyDialog
      • Conditions
        • (Clicked dialog button) Equal to DialogButton[2]
      • Actions
        • Game - Display to Player Group - Player 1 (Red) the text: You didn't want any gold


    Once these two triggers have been made your Dialog should work and look like shown below.

    3.jpg
     
    Last edited by a moderator: Jun 26, 2007
  2. BiroN

    BiroN

    Joined:
    Sep 10, 2013
    Messages:
    359
    Resources:
    0
    Resources:
    0
    Simple and very useful. Thank you!
     
  3. DarkRanger2

    DarkRanger2

    Joined:
    Mar 2, 2017
    Messages:
    218
    Resources:
    0
    Resources:
    0
    Finally a simple Tuto that didn't pyt fire to my brain, thank you.
     
  4. SSJ7107

    SSJ7107

    Joined:
    Oct 16, 2015
    Messages:
    131
    Resources:
    0
    Resources:
    0
    How can I remove a Dialogue via triggers
     
  5. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,287
    Resources:
    0
    Resources:
    0
    Removing title and all buttons:
    • Dialog - Clear MyDialog


    If you want to destroy it, use:
    Code (vJASS):

    call DialogDestroy(udg_MyDialog)
     
     
  6. SSJ7107

    SSJ7107

    Joined:
    Oct 16, 2015
    Messages:
    131
    Resources:
    0
    Resources:
    0
    Only the JASS code works but still it's helpful THanks
     
  7. tough_zai

    tough_zai

    Joined:
    Nov 10, 2012
    Messages:
    227
    Resources:
    0
    Resources:
    0