HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GUI Dialog Help

12-30-2007, 08:34 PM#1
AntJAB
I'm going back to some old maps of mine and trying to update them. Most of them are just for my friends and I, quick little games or inside jokes. Anyway, I found these old dialog triggers that I remember working but do not. As far as I can tell the problem is in the IF statement right before my comment in the 2nd trigger.
Everything happens correctly except for the stuff in the IF statement that generates the next dialog's buttons based on what was selected in the last dialog.

Creation of the first dialog:
Hidden information:
Trigger:
Dialog 1
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Dialog - Clear Dialog
Dialog - Change the title of Dialog to Mode
Dialog - Create a dialog button for Dialog labelled Defence
Set Choice1 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Wars
Set Choice2 = (Last created dialog Button)
Dialog - Show Dialog for HostPlayer
Set Follow = 1
Game - Display to (All players) the text: Host selecting game...



The trigger that detects and answers all dialog button clicks:
Hidden information:
Trigger:
Dialog Answer
Collapse Events
Dialog - A dialog button is clicked for Dialog
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Follow Equal to 1
Collapse Then - Actions
Set Follow = 0
Dialog - Hide Dialog for HostPlayer
Dialog - Clear Dialog
Dialog - Change the title of Dialog to Teams
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to Choice1
Collapse Then - Actions
-------- This is not happening when it should --------
Game - Display to (All players) the text: Game mode is defenc...
Set GameMode = 1
Dialog - Create a dialog button for Dialog labelled Free For All
Set Choice1 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 2 (Horizon...
Set Choice2 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 2 (Vertica...
Set Choice3 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 4
Set Choice4 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Full Team
Set Choice5 = (Last created dialog Button)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to Choice2
Collapse Then - Actions
Game - Display to (All players) the text: Game mode is wars. ...
Set GameMode = 2
Dialog - Create a dialog button for Dialog labelled Free For All
Set Choice1 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 2 (Horizon...
Set Choice2 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 2 (Vertica...
Set Choice3 = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Teams of 4
Set Choice4 = (Last created dialog Button)
Collapse Else - Actions
Do nothing
Dialog - Show Dialog for HostPlayer
Set Follow = 2
Game - Display to (All players) the text: Host selecting team...
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Follow Equal to 2
-------- Other dialog responses --------


So what I end up getting is a dialog on the screen titled "Teams" with no buttons. I thought "(Clicked dialog button) Equal to Choice1" was the way check...

I probably just forgot something obvious, it's been so long since I've done GUI dialogs. And on that note I'm looking for a GUI solution, and couldn't find anything in search, etc etc.

Thanks in advance for any help.


Edit: Just found a solution. The first line before the IF statements I set a new variable to the clicked dialog button, then inside the IF I compared the variable of the clicked button to the variable of the created button.

Duh.
12-30-2007, 08:55 PM#2
redscores
sorry wrong.