Tutorial Dialog Boxes (In-Depth)

tooltiperror

Super Moderator
Reaction score
231
ToolTipError Dialog Tutorial

Author: ToolTipError (also known as Tool.Tip.Error)
Contact: Private Message or Fantasy Life Forum
Battle.net Name: Tool.Tip.Error (USEast)​

----

- Reason for this Tutorial:
٭ I fealt that the World Edit Tutorial website was not indepth enough for beginners, so I created this in hopes of helping those new to Dialog's.

٭ A, "Hello" Move, this is my first forum post.

٭ I was bored and wanted a way to do something.

===


- Why Use a Dialog Box? (And what is it?)
Dialog Boxes are the menu boxes within Warcraft III, and they are extremely customizable in triggers and customizing your game. Because Dialog Boxes are not as commonly used as string based commands (i.e. (-ar)), they provide a splash of fresh water in many games.​

- Creating your First Dialog Box

So you want a Dialog Box? This here little guide should help you quite nicely.

Even though Camera Angle isn't a good example to start the tutorial off with, it will show you how to do a basic Dialog Box.

Although Dialog Boxes are easy to create, you need to follow this order of actions.

Trigger:
  • Dialog
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Dialog - Clear (Dialog)
      • -------- Clear has to be First --------
      • Dialog - Create a dialog button for (Dialog) labelled Text
      • -------- Show has to be Last --------
      • Dialog - Show (Dialog) for Player 1 (Red)


You see from above that the dialog box has three required functions for it to work properly.
  • Trigger:
    • Dialog - Clear (Dialog)

    This removes all left over functions from the last trigger.

  • Trigger:
    • Dialog - Create a dialog button for (Dialog) labelled Button Name

    This actually creates the Dialog button. The button can have any name, and color codes can be used. "Button Name" should be replaced with what you want players to see.

  • Trigger:
    • Dialog - Show (Dialog) for Player 1 (Red)

    This shows the finished Dialog to the player. Player 1 (Red) can be replaced by other players, or more usually, Triggering Player. There are also many other thing to replace Player 1 (Red). This must always be last, unless advanced triggering says differently, but I have never done that.

    You might also use:

  • Trigger:
    • Dialog - Change the title of (Clicked dialog) to Your Title
    This gives your Dialog a title.

You also need variables to do all of these things. Dialog Buttons and the Dialog must all be Variables. Here is a list of variables you need:

  • [Variable Type: Dialog] Name_Of_Your_Dialog

  • [Variable Type: Dialog Button] Generic_Button_Name

Now, when you want to give a button meaning, use a set variable action.
Trigger:
  • Actions
    • Set Dialog_Button_Enable_Camera = (Last created dialog Button)


Just position that below the dialog button you want it to be. For example:
Trigger:
  • Actions
    • Dialog - Create a dialog button for (Camera_Dialog) labelled Enable Camera
    • Set Dialog_Button_Enable_Camera = (Last created dialog Button)


Now, the dialog button needs meaning. So this kind of trigger would work.
Trigger:
  • Camera Enabled
    • Events
      • Dialog - A dialog button is clicked for Camera Dialog
    • Conditions
      • (Clicked dialog button) Equal to Dialog_Button_Enable_Camera
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to (Your Unit), offset by (0.00, 0.00) using Default rotation

- Arrays!

You can use arrays in all different ways, with buttons or Dialogs. This section will cover how to use them and give some helpful hints, and when to use them.​

- Dialog Arrays

Dialog Arrays are mostly used for grouping dialogs or many dialogs at once. I, personally, never use them.​

- Dialog Button Arrays

Now, Dialog Button Arrays (Which will be known as DBA's for the time being) are more useful in my opinion. What you could do is to use it for categories, or for double pages. Let me explain.

Let's pretend I have two DBA's, one named PageOne, and the other, PageTwo. Both are four slots. Here are two triggers I could use.

Trigger:
  • Actions
    • Dialog - Create a dialog button for (SelectUnits) labelled Peasant
      • Set PageOne[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for (SelectUnits) labelled Peon
      • Set PageOne[2] = (Last created dialog Button)
    • Dialog - Create a dialog button for (SelectUnits) labelled Wisp
      • Set PageOne[3] = (Last created dialog Button)
    • Dialog - Create a dialog button for (SelectUnits) labelled Next Page
      • Set PageOne[4] = (Last created dialog Button)
      • -------- ------------- --------
      • Set PageTwo[1] = (Last created dialog Button)
      • Set PageTwo[2] = (Last created dialog Button)
      • Set PageTwo[3] = (Last created dialog Button)
      • Set PageTwo[4] = (Last created dialog Button)


This means you don't have to make a billion variables, and you can manage it all easier.



- Common Errors

Here's an FAQ for common errors and glitches with Dialog Boxes, also some tips.​

Q: My Dialog Box has extra buttons that compile!
A: Make sure that the first action in your trigger is:
Trigger:
  • Dialog - Clear (Dialog)

If it is not, add it in and try again. It should fix the error.
Why: When you do "Add a Button", it adds that button onto the Dialog. Unless you clear it, it remains there.
So when you don't clear it, it adds a second, or possibly more depending on how big the Dialog is,




Q: How do I make a Cancel Button?
A:Creating a Cancel Button is easy! Just use the following action.
Trigger:
  • Dialog - Create a dialog button for (Dialog) labelled Cancel

Why: The Button has no value or Variable for it, so no event happens when it is clicked. I recommend you place it last and use the following action.
Trigger:
  • Dialog - Create a dialog button for (Dialog) labelled |CFFFAEBDCancel|R

This makes the cancel button white. Just a personal preference.



Q: How can I completely remove Dialogs to help Lag?
A: Just remove the trigger! Use the following action.
Trigger:
  • Custom script: call DestroyTrigger(gg_trg_GUI_NAME_OF_TRIGGER)

Replace spaces with Underscores.
Why: This stops all future runs of the trigger, and it also removes lag.


- Picture Gallery

Here are a few pictures to show you examples of Dialogs and their Buttons.​

> I think you should add pics of dialogs, too. Most newbies searching for how to create dialogs don't know what they are called, they just know what they look like. - Artificial

Upon the above request, I have included a small picture gallery here.​

2e2m911.jpg

opfk5.jpg
Please, Feedback.

I know this isn't an A+ tutorial, but it is my first one, so please provide good feedback.​
 

Dest

New Member
Reaction score
26
[*]
Trigger:
  • Dialog - Create a dialog button for (Dialog) labelled Text

This actually creates the Dialog button. The button can have any name, and color codes can be used.

Labelled = Labeled

That's all :p Great tutorial.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Maybe you could try to give a more complex example too, like picking a Hero with a Dialog, or something like that :D

Anyways... Good, though small, tutorial ;)
I really like your formatting :thup:

+Rep ;)
 

tooltiperror

Super Moderator
Reaction score
231
Wow, thanks so much for the in-put, Dest and Komaq!

+Rep for the help, that was seriously very nice of you.



Anyway, I think I will add in a mode's part and add in an example map.
 

tooltiperror

Super Moderator
Reaction score
231
Updated the general flow and grammar, then added FAQ and formatted it into spoilers.

EDIT: Can this be moved to tutorials, or does it need some more?
 

tooltiperror

Super Moderator
Reaction score
231
Could I get a Mod to tell me what's needed or to approve / move this?
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
You can use button arrays. Didn't see that anywhere.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Multiple buttons?
Instead of creating a new variable for each button, just use an array.
 

tooltiperror

Super Moderator
Reaction score
231
Multiple buttons?
Instead of creating a new variable for each button, just use an array.
Good Thought.

I rarely use many dialog buttons, or any more than three or two, so thanks for the idea.


I will add it in soon.
 

Dest

New Member
Reaction score
26
Mind proving a bit more in-depth for array part? I don't understand it much. :(
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
It's the same concept as before. You just specify an array variable when creating the variable, and an array index when setting the variable.
This increases the amount of buttons you can have (because you don't need a million variables. One array supports 8192-ish (I might have the exact number wrong) buttons), while decreasing the amount of variables needed.
 

tooltiperror

Super Moderator
Reaction score
231
It's the same concept as before. You just specify an array variable when creating the variable, and an array index when setting the variable.
This increases the amount of buttons you can have (because you don't need a million variables. One array supports 8192-ish (I might have the exact number wrong) buttons), while decreasing the amount of variables needed.​

Noted and Added.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top