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

Dialog Boxes

Level 3
Joined
Feb 8, 2005
Messages
35
This tutorial is to help map makers create dialog boxes. First, let's look at what a dialog box does...

Dialog Box - A box or menu you can create with dialog buttons to give your map players a choses.

For Example:

example001.jpg


I click "Elementalist" Which brings up...

example002.jpg


I click "Air and Lightning" which creates...
example003.jpg


An Air and Lightning Tower Summoner! This will be the base for what I will attempt to teach you, but first, let's create some variables

Variables - Locations in memory that can hold values. In other words, think of it as X. But, WarCraft III does not like just the value X so you have to give it your own value, such as, X=1 or X=(integer) or something to that effect.

Anyway, we'll need to create TWO variables for this example. 1 variable needs to be Dialogs and the other 1 needs to be Dialog Buttons To do this, go to the "Trigger Editor" then click Edit and scroll down to "Variables" or click "Ctrl+B" This will open a screen...

Selecting "Variables" From the "Edit" menu in "Trigger Editor"
example004.jpg


The Variables Screen
example005.jpg


As you can see, my Variables (or Vars. for short) are simple. To make a new one, click the icon with the green "x", this should open a new window...

example006.jpg


This is where you will give your Var a name and tell WarCraft what Var equals. For this example I called the menu where you choose your profession "chooseprofession" and I've set the variable type to "Dialog". Don't make it an array...or else (I don't have any idea...) and make sure the initial value is none. Click okay and ta-Da! you have you box/menu.

Now, lets create the Dialog Button that will appear on the Dialog Box. Again, do everything above except, the name, which, in this example, is, "chooseelementalist" and set the Var Type to "Dialog Button" This tells WarCraft that this is a button instead of a blank space... So, now, you have the two crucial Vars that is needed for the first Menu. But, you'll need to make triggers to be able to see them.

The Triggering

The triggering is the other half of making dialog boxes so here we go.

MAKE SURE YOU DO NOT PUT THE EVENT AS MAP INITALIZATION! Dialogs will not run under map initalization.


The basic trigger to show all the players the Dialog.
example007.jpg


Let's talk about each Event and Action:

EVENTS
Time - Elapsed game time is 0.00 seconds

This really doesn't matter, as soon as the map is loaded the menu is shown right away, now, if you have cinimatics, you might want to change this...

ACTIONS
Dialog - Clear chooseprofession

This makes sure there is nothing on the Dialog menu giving you a clean slate.

Dialog - Change the title of chooseprofession to Choose Profession

This is where you change the title of your Menu/Box. Foir mine, I've called it "Choose Profession"

Dialog - Create a dialog button for chooseprofession labelled Elementalist

This creates the actual Dialog Button lablled "Elementalist" that will appear on the box/menu.

Set chooseelementalist = (Last created dialog Button)

This is really important. This is needed for other trigger such as

Events
Dialog - A dialog button is clicked for chooseprofession
Conditions
(Clicked dialog button) Equal to chooseelementalist
Actions
Dialog - Clear choosetypeelm
Dialog - Change the title of choosetypeelm to Choose Elemental Sp...
Dialog - Create a dialog button for choosetypeelm labelled Air & Lightning
Set choseair = (Last created dialog Button)
Dialog - Create a dialog button for choosetypeelm labelled Earth
Set chooseearth = (Last created dialog Button)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 1 (Red)
Then - Actions
Dialog - Show choosetypeelm for Player 1 (Red)
Else - Actions
Do nothing


Pay close attention to the condition, this is why you have to be careful here or else other stuff will happen.

Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Dialog - Show chooseprofession for (Picked player)

Finally, this will show your completed product.

Well, I hoped this goes over well with you all and hope to see alot more dialog boxes in the future, since they do cut down on triggers...sometimes...

-Fallen
 
Level 2
Joined
Aug 10, 2005
Messages
9
awwwwww i do exesakly like you teach put where i can set chooseelementalist last greated dialog button :?
 
Level 2
Joined
Mar 10, 2005
Messages
9
thx! this answered the question i had in some other post! now i can create a hero chooser if u grab a certain item ^_^
 
Level 1
Joined
Oct 4, 2005
Messages
5
:twisted: :twisted: :twisted: :twisted: :twisted: :twisted: :twisted: :twisted:
okej!!!!!!!!!!!!!!
|c0000ff00mike|r
i need help!!
the stupid dialog button, doesn't appear the only thing i see is the stupid dialog with no button
here is my trigger


EVENT
elapsed time 0:00

ACTION
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
Dialog - Show chooseprofession for (Picked player
Clear dialog
change the dialog for mike title
create a button for mike labbeled hero
set dialogbuttonmike=(last created dialog button)
something like that!!!!!!!!!!!!
 
Top