HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog Tutorial - Creating Dialogs

05-20-2006, 08:49 AM#1
bounty_hunter2
This tutorial will explain the creation of a Dialog box. If you don't know what is a dialog box take a look at the first attached image.

First you need two variables. The first variable - we will call it dialog_difficulty is type Dialog. The Second, which we will call dialog_difficulty_buttons is a Dialog button type. You will see that it has the array option. As you saw on my image I had 8 buttons so my array is 8. So the array is based on the amount of buttons you have. Here on this example I have two buttons so I have an array of 2.

Dialog Box - Creating it
Now we need to create our Dialog trigger. The trigger will go like this:

Trigger:
Dialog
Collapse Events
Time - Elapsed game time is 1.00 seconds
Conditions
Collapse Actions
Dialog - Clear dialog_difficulty
Dialog - Change the title of dialog_difficulty to Difficulty
Dialog - Create a dialog button for dialog_difficulty labelled Easy
Set dialog_difficulty_buttons[1] = (Last created dialog Button)
Dialog - Create a dialog button for dialog_difficulty labelled Hard
Set dialog_difficulty_buttons[2] = (Last created dialog Button)
Dialog - Show dialog_difficulty for Player 1 (Red)

Now the next trigger will explain how to initiate an action when the button is clicked


Trigger:
Dialog 2
Collapse Events
Dialog - A dialog button is clicked for dialog_difficulty
Collapse Conditions
(Clicked dialog button) Equal to dialog_difficulty_buttons[1]
Collapse Actions
Game - Display to (All players) the text: Difficulty is easy.

Do the same for the next button. Please look at the images if you still don't understand.
Attached Images
File type: jpgDialog.JPG (112.3 KB)
File type: jpgVar.JPG (16.7 KB)
File type: jpgDialog2.JPG (47.0 KB)
File type: jpgDialog3.JPG (39.3 KB)
05-20-2006, 09:31 AM#2
Tim.
Please use [trigger] tags not [quote] tags.
05-20-2006, 10:49 AM#3
bounty_hunter2
didn't know they exsist....editing
so will it be excepted?
05-25-2006, 07:38 AM#4
PitzerMike
I guess this could be approved as a tutorial for beginners, since we don't have a dialog tutorial yet.
However you should mention that for your code example a button array with the size 2 is required, not 8. Also I think more appropriate variable names like dialog_difficulty or something like that should be used for a tutorial.
05-27-2006, 07:52 AM#5
bounty_hunter2
ok I'l update it.
05-28-2006, 02:38 PM#6
Tim.
Quote:
Originally Posted by bounty_hunter2
ok I'l update it.
It has been a few days, are you actually going to update this or what?
06-01-2006, 03:02 PM#7
bounty_hunter2
realy sorry. I was ILL. Update today.

EDIT:
Topic updated.
06-01-2006, 11:19 PM#8
PitzerMike
Ok, looks good now. Moved to tutorials for beginners.
06-02-2006, 06:40 AM#9
bounty_hunter2
great! Thanks
02-13-2009, 05:00 PM#10
Alexis_Septimus
It is much better to set it this way, save much space.

Trigger:
Melee Initialization
Collapse Events
Dialog - A dialog button is clicked for dialog_difficulty
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to dialog_difficulty_button[1]
Collapse Then - Actions
Game - Display to (All players) the text: Difficult is easy.
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to dialog_difficulty_button[2]
Collapse Then - Actions
Game - Display to (All players) the text: Difficult is easy.
Else - Actions
05-04-2010, 01:15 PM#11
canon shooter
really?it seems to be hurting my head.
05-04-2010, 01:18 PM#12
canon shooter
also cool photos but the first one has an action called log entrys.how the hell are you supposed to write entrys?????