Well, I'm making a map that needs a trigger system that has a menu that has 3 buttons, any ideas how I could do this? I usually know how, but I've been experimenting with Dialog menus and buttons, but I can't seem to figure it out.
Heres how to do it (not got the editor open, so no correct code though).
1) Create 5 variables. Set 1 of them to 'Dialog' and the other 4 to 'Dialog Item'.
2) Create a trigger that runs on startup. The first actions should be 'Create dialog'. Around 300 by 400 should do it.
3) Make sure to set the dialog to your dialog variable.
4) Do the same for the dialog items. Make the first one a label with the text something like "Please select your race" and the others buttons. Set the offsets to about 50,50 for the label and 100/150/200,50 for the buttons.
5) Make sure all of the dialog items are set to a variable.
6) Make sure to do a "Show Dialog" action at the end.
Now the dialog is created. But it does nothing when you click it!
7) Now create a new trigger. Make the event "Dialog item is clicked" 8) Add no conditions (although you could add a condition to check the dialog the item is in). Then put in a switch statement based on the used dialog item.
9) Then under each variable in the switch statement, do a "Set player race to X" and a "Hide dialog <dialog>". You can also add a text message to say "<race> selected!"
10) Test! If the dialog looks wierd, change the offsets a bit. You can also play around with text styles and other items. For instance a picture of a zergling next to the zerg race button, marine next to the terran button etc.
Hope this is easy to understand :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Well, I'm making a map that needs a trigger system that has a menu that has 3 buttons, any ideas how I could do this? I usually know how, but I've been experimenting with Dialog menus and buttons, but I can't seem to figure it out.
Heres how to do it (not got the editor open, so no correct code though).
1) Create 5 variables. Set 1 of them to 'Dialog' and the other 4 to 'Dialog Item'.
2) Create a trigger that runs on startup. The first actions should be 'Create dialog'. Around 300 by 400 should do it.
3) Make sure to set the dialog to your dialog variable.
4) Do the same for the dialog items. Make the first one a label with the text something like "Please select your race" and the others buttons. Set the offsets to about 50,50 for the label and 100/150/200,50 for the buttons.
5) Make sure all of the dialog items are set to a variable.
6) Make sure to do a "Show Dialog" action at the end.
Now the dialog is created. But it does nothing when you click it!
7) Now create a new trigger. Make the event "Dialog item is clicked"
8
) Add no conditions (although you could add a condition to check the dialog the item is in). Then put in a switch statement based on the used dialog item.9) Then under each variable in the switch statement, do a "Set player race to X" and a "Hide dialog <dialog>". You can also add a text message to say "<race> selected!"
10) Test! If the dialog looks wierd, change the offsets a bit. You can also play around with text styles and other items. For instance a picture of a zergling next to the zerg race button, marine next to the terran button etc.
Hope this is easy to understand :)