Create the dialog first then create the buttons/title. Actions execute top -> bottom so for what you have right now you are initially trying to create buttons and set titles of nothing, then you create it and it has nothing to show.
So just move the Create a Modal dialog action to the top of that list and it should work (I think)
Tricky part is figuring out how to get the next trigger to run based on which button they pushed (which I have not figured out, and have since resorted to using screen buttons and no dialog, which is ugly)
Wait, where are you getting the MyDialog option? Is it a custom variable that you are trying to use? If yes, why not just use the Last Created Dialog option instead?
Actions:
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Button1" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Button2" and the hover image set to ""
Dialog - Set title of (Last created dialog) to "Title"
Dialog - Show (Last created dialog) for (All players)
^ that trigger set works fine for me (though obviously the 2 buttons overlap each other since I didnt change the offsets for anything)
EDIT: And thank you s3rious for inspiring me on how to finally get the buttons to work
He is setting the title of the dialog yes, but what I was saying is that he was setting the title of a non-existent dialog since it hasnt been created yet. Which is more or less true. That wasnt the problem however, and s3rius does have it right.
PS: Finally got dialog buttons to work, I was constantly looking for triggers and didnt think to use variables to designate something.
Trigger1 (dialog initialization)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Melee" and the hover image set to ""
Variable - Set Melee = (Last created dialog item)
Trigger2
Event: Dialog - Any Dialog Item is Clicked by Player Any Player
Condition: Melee == (Used dialog item)
Action Unit - Create 1 Archon for player 1 at Point 001 using default facing (No Options)
Screen button 1 is not a dialog item button, its a separate type of button that doesnt go with dialogs.
You can just use the Destroy All Dialog's action to remove it if it is your only one. I dont really know what you are working with though, so it might not be the trigger you are looking for
Also, my post above yours shows you how to run a trigger based on which button they press.
Melee is a Dialog Item variable
Caster is a Dialog Item variable
Dialog Initialize Trigger:
Events:
Game - Map initialization
Actions:
Dialog - Create a Non-modal dialog of size (700, 275) at (0, 0) relative to Center of screen
Dialog - Set title of (Last created dialog) to "Select your Hero's class"
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Center with an offset of (0, 50) setting the tooltip to "Melee" with button text "Melee" and the hover image set to ""
Variable - Set Melee = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Center with an offset of (-200, 50) setting the tooltip to "Caster" with button text "Caster" and the hover image set to ""
Variable - Set Caster = (Last created dialog item)
Dialog - Show (Last created dialog) for (All players)
Trigger for Melee button:
Event:
Dialog - Any Dialog Item is Clicked by Player Any Player
Condition:
Melee == (Used dialog item)
Action:
Dialog - Destroy (Last created dialog)
Unit - Create 1 Melee for player (Triggering player) at Point 001 using default facing (No Options)
UI - Display "You have selected the Melee class" for (Active Players) to Subtitle area
For Caster:
Event:
Dialog - Any Dialog Item is Clicked by Player Any Player
Condition:
Caster == (Used dialog item)
Action:
Dialog - Destroy all dialogs
Unit - Create 1 Caster Hero for player (Triggering player) at Point 001 using default facing (No Options)
UI - Display "You have selected the Caster class" for (All players) to Subtitle area
You should be able to use integer variables for pretty much anything, you just have to be creative :)
to destroy you can find the Destroy (variable) dialog or you can just Hide it if you wanted to use it again later.
I can't seem to get this one to work =(
Create the dialog first then create the buttons/title. Actions execute top -> bottom so for what you have right now you are initially trying to create buttons and set titles of nothing, then you create it and it has nothing to show.
So just move the Create a Modal dialog action to the top of that list and it should work (I think)
Tricky part is figuring out how to get the next trigger to run based on which button they pushed (which I have not figured out, and have since resorted to using screen buttons and no dialog, which is ugly)
@TheRabidDeer: Go
Nope that doesn't fix it.
Well, from what I see: You are adding buttons to "MyDialog" And then you're creating some dialog. MyDialog has nothing to do with your created dialog.
This should work.
Wait, where are you getting the MyDialog option? Is it a custom variable that you are trying to use? If yes, why not just use the Last Created Dialog option instead?
Actions:
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Button1" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Button2" and the hover image set to ""
Dialog - Set title of (Last created dialog) to "Title"
Dialog - Show (Last created dialog) for (All players)
^ that trigger set works fine for me (though obviously the 2 buttons overlap each other since I didnt change the offsets for anything)
EDIT: And thank you s3rious for inspiring me on how to finally get the buttons to work
@TheRabidDeer: Go
Rabid your first post is wrong, he is setting the title of the dialog, not the buttons title. s3rius has it right.
He is setting the title of the dialog yes, but what I was saying is that he was setting the title of a non-existent dialog since it hasnt been created yet. Which is more or less true. That wasnt the problem however, and s3rius does have it right.
PS: Finally got dialog buttons to work, I was constantly looking for triggers and didnt think to use variables to designate something.
Trigger1 (dialog initialization)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "Melee" and the hover image set to ""
Variable - Set Melee = (Last created dialog item)
Trigger2
Event: Dialog - Any Dialog Item is Clicked by Player Any Player
Condition: Melee == (Used dialog item)
Action Unit - Create 1 Archon for player 1 at Point 001 using default facing (No Options)
@s3rius: Go
Thanks for your help. I want to set the selected dialogue item chosen to a new trigger.
Why am I unable to use: Variable - Set teams = (Screen button 1) as substitute for: Variable - Set teams = (Last created dialog item)
Any ideas?
Also how do I destroy the dialogue once a user has selected an item?
Screen button 1 is not a dialog item button, its a separate type of button that doesnt go with dialogs.
You can just use the Destroy All Dialog's action to remove it if it is your only one. I dont really know what you are working with though, so it might not be the trigger you are looking for
Also, my post above yours shows you how to run a trigger based on which button they press.
Melee is a Dialog Item variable
Caster is a Dialog Item variable
Dialog Initialize Trigger:
Events:
Game - Map initialization
Actions:
Dialog - Create a Non-modal dialog of size (700, 275) at (0, 0) relative to Center of screen
Dialog - Set title of (Last created dialog) to "Select your Hero's class"
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Center with an offset of (0, 50) setting the tooltip to "Melee" with button text "Melee" and the hover image set to ""
Variable - Set Melee = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Center with an offset of (-200, 50) setting the tooltip to "Caster" with button text "Caster" and the hover image set to ""
Variable - Set Caster = (Last created dialog item)
Dialog - Show (Last created dialog) for (All players)
Trigger for Melee button:
Event:
Dialog - Any Dialog Item is Clicked by Player Any Player
Condition:
Melee == (Used dialog item)
Action:
Dialog - Destroy (Last created dialog)
Unit - Create 1 Melee for player (Triggering player) at Point 001 using default facing (No Options)
UI - Display "You have selected the Melee class" for (Active Players) to Subtitle area
For Caster:
Event:
Dialog - Any Dialog Item is Clicked by Player Any Player
Condition:
Caster == (Used dialog item)
Action:
Dialog - Destroy all dialogs
Unit - Create 1 Caster Hero for player (Triggering player) at Point 001 using default facing (No Options)
UI - Display "You have selected the Caster class" for (All players) to Subtitle area
would the option to destroy all dialogs only work for the triggering player or everyone?
You should be able to use integer variables for pretty much anything, you just have to be creative :) to destroy you can find the Destroy (variable) dialog or you can just Hide it if you wanted to use it again later.