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)
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.
٭ 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.
You see from above that the dialog box has three required functions for it to work properly.
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:
Now, when you want to give a button meaning, use a set variable action.
Just position that below the dialog button you want it to be. For example:
Now, the dialog button needs meaning. So this kind of trigger would work.
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)
- Events
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:
- This gives your Dialog a title.Trigger:
- Dialog - Change the title of (Clicked dialog) to Your 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
- Events
- 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 Button 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.
This means you don't have to make a billion variables, and you can manage it all easier.
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)
- Dialog - Create a dialog button for (SelectUnits) labelled Peasant
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:
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.
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.
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.
Replace spaces with Underscores.
Why: This stops all future runs of the trigger, and it also removes lag.
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.
Upon the above request, I have included a small picture gallery here.
I know this isn't an A+ tutorial, but it is my first one, so please provide good feedback.