Hello this is my first tutorial and I'm going to cover how to make a dialog box with clickable buttons for race selection that works only for the player using them.
1st. Your going to need to make global variables for each dialog and dialog button you want to have.
2nd. Make a trigger that has the event "Game - Map Initialization". Once that's done your going to need to create some actions the first of which is a dialog. Right click on actions and select new element then search for create dialog. Leave it as a modal dialog and edit the size and position as you see fit. After you've done that your going to need to set the global variable for the dialog you just made, again just right click on actions and make a new element and search for set variable and set it to w/e you named the variable and == (last created dialog).
Still within the same trigger your going to need to make a dialog button just like how you made your dialog but now search for dialog item (button). Click on the (last created dialog) part then click the radial for variable and select your dialog. Change the size, position and name to w/e you want and leave the "" blank. Now just like when making the dialog set the variable for the button to w/e you named it and == (last created dialog item). Repeat this step if you want to add more buttons to the dialog.
If you want to add a title to the dialog box just create a dialog item (label), again in the (last created dialog) change it to the dialog we made earlier. Change the size, position, text, and color to w/e you want and since we are using this as a title keep the text write out set to false.
To make all this work show up right click on actions and search for show/hide dialog then pick your dialog change hide to show for all players.
3rd. Make a new trigger with the event "any dialog item is clicked by player (triggering player)". Once you've done that your going to make a if then else action to do this just search for If then else in the actions window. Once you've done that right click on if and select new element and pick comparison. Click on the green "(" and change the function to used dialog item == (w/e button you want used). For the then part, again right click and select new element and search for create units facing point and change the number of and type of unit to w/e you want and the player to (triggering player) the point to the function (start location of player (triggering player) and the rest as the default settings. Leave the else blank. Repeat this for each button you want.
To make the dialog close after its used right click on actions and search for show/hide dialog then pick your dialog and keep it as hide and change it to function (player group (triggering player). This will also hide the buttons ^^
Congratulations you should now have a working dialog with clickable buttons that hides its self after use. Feel free to share this with anyone just please give me credit thank you. Vox
I don't see the difference between using "Any Player" and "Triggering Player" in Events. Won't Actions pick up the appropriate Triggering Player anyway?
Could you also explain more about showing/hiding/changing buttons inside a dialog that is seen by multiple players? The Galaxy Editor tooltips mention something about different players having the same Dialogs set up differently...
and on single dialogs working for multiple people yeah....
create dialog (that says yes/ no with buttons for a shit example)
set last created dialog = 'YESNODIALOG' (your custom global variable you made and now assigned the dialog to)
then you have to decide who to SHOW the dialog for, just one player? all players???
show YESNODIALOG for (player 1) or show YESNODIALOG for ALLPLAYERS
so you show that SPECIFIC dialog for as many players as you want
then when some1 clicks the dialog you hide the dialog for that specific player (triggering player buddy!!! :) ) haha and the other players if you so chose to show it for all players to start with can still click yes/no to make their own personal choice.
It seems that the default return value for EventPlayer() ("Triggering Player" in GUI) is 1, which is what allows this to work in single player. I bet this would break if used in multiplayer (it would only register the event for Player 1).
Triggering Player in the Event should be changed to Any Player.
How would I do multiple dialog boxes? I made one but When I try to make another it won't work.. I did the same thing do I need to do something different?
This seems good. However, many race-specific things like UI, dialog button style, menu color, alert voice, etc ... still cant be changed through trigger.
This is a fairly tedious way to create dialogs and their functionality, surely there is a data drive way, think Hibernate, that is similar to the command cards for unit abilities?
The next best thing may be to load files with dialog data and generate them automatically.
I'm running into problems. It seems this tutorial is old and not all the triggers are exactly the same. I'm not sure what to use in the comparison part.
If you want real race selection you should look into the "game attributes stuff" so players select race in lobby. I do believe you can do custom race stuff from there?
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
If you want real race selection you should look into the "game attributes stuff" so players select race in lobby. I do believe you can do custom race stuff from there?
I might be wrong but if you create a new 'Race' object in the Data Editor you are unable to publish your map.
Not sure if that is what you were getting at. But yes, it is possible to - for example - choose a Starting Hero in the Game Lobby. But, thanks to Blizzard, the GUI is messy and I don't think it would be nice to have a player choose from a long list of Hero's. I think between 3 and 5 is ideal.
Back to the topic.
It is a nice tutorial and clears up a lot of stuff which beginners might get confused about. I wish there was something around like this when I spent about a day learning all I could about Dialogs :)
I was talking with some people and learned that arrays make this much cleaner. Still a helpful tutorial. I think I'm actually starting to understand the editor more.
Maybe I'm just being dumb but when I select the variable there is no option to for "last created dialogue" there is just...
Count of list items
Dialogue channel
Dialogue height
Dialogue item hight
Dialogue item offset X/Y
Dialogue Item width
Dialogue Offset X/Y
Dialogue Width
Selected list item
where am I going wrong here ?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello this is my first tutorial and I'm going to cover how to make a dialog box with clickable buttons for race selection that works only for the player using them.
1st. Your going to need to make global variables for each dialog and dialog button you want to have.
2nd. Make a trigger that has the event "Game - Map Initialization". Once that's done your going to need to create some actions the first of which is a dialog. Right click on actions and select new element then search for create dialog. Leave it as a modal dialog and edit the size and position as you see fit. After you've done that your going to need to set the global variable for the dialog you just made, again just right click on actions and make a new element and search for set variable and set it to w/e you named the variable and == (last created dialog).
Still within the same trigger your going to need to make a dialog button just like how you made your dialog but now search for dialog item (button). Click on the (last created dialog) part then click the radial for variable and select your dialog. Change the size, position and name to w/e you want and leave the "" blank. Now just like when making the dialog set the variable for the button to w/e you named it and == (last created dialog item). Repeat this step if you want to add more buttons to the dialog.
If you want to add a title to the dialog box just create a dialog item (label), again in the (last created dialog) change it to the dialog we made earlier. Change the size, position, text, and color to w/e you want and since we are using this as a title keep the text write out set to false.
To make all this work show up right click on actions and search for show/hide dialog then pick your dialog change hide to show for all players.
3rd. Make a new trigger with the event "any dialog item is clicked by player (triggering player)". Once you've done that your going to make a if then else action to do this just search for If then else in the actions window. Once you've done that right click on if and select new element and pick comparison. Click on the green "(" and change the function to used dialog item == (w/e button you want used). For the then part, again right click and select new element and search for create units facing point and change the number of and type of unit to w/e you want and the player to (triggering player) the point to the function (start location of player (triggering player) and the rest as the default settings. Leave the else blank. Repeat this for each button you want.
To make the dialog close after its used right click on actions and search for show/hide dialog then pick your dialog and keep it as hide and change it to function (player group (triggering player). This will also hide the buttons ^^
Congratulations you should now have a working dialog with clickable buttons that hides its self after use. Feel free to share this with anyone just please give me credit thank you. Vox
good tut! thx for distributing = D
np glad to help :)
Wow this is helpful.
I can't get my mind around the reasoning behind using (Triggering Player) in the Event. Could you explain that?
@EphemeralNight: Go
Otherwise you would need to implement it for all player slots, which will expand the code by X
I don't see the difference between using "Any Player" and "Triggering Player" in Events. Won't Actions pick up the appropriate Triggering Player anyway?
Could you also explain more about showing/hiding/changing buttons inside a dialog that is seen by multiple players? The Galaxy Editor tooltips mention something about different players having the same Dialogs set up differently...
in short; 'any player' is used for the event
if ANY PLAYER clicks a dialog
'triggering player is refrencing that specific player'
then hide dialog for TRIGGERING PLAYER (the one that clicked the dialog)
if you used 'any player in the action part then...
then hide dialog for ANY PLAYER (so is it just a random player? or do you want the specific player that triggered the event???)
get it?
and on single dialogs working for multiple people yeah....
create dialog (that says yes/ no with buttons for a shit example) set last created dialog = 'YESNODIALOG' (your custom global variable you made and now assigned the dialog to)
then you have to decide who to SHOW the dialog for, just one player? all players??? show YESNODIALOG for (player 1) or show YESNODIALOG for ALLPLAYERS
so you show that SPECIFIC dialog for as many players as you want
then when some1 clicks the dialog you hide the dialog for that specific player (triggering player buddy!!! :) ) haha and the other players if you so chose to show it for all players to start with can still click yes/no to make their own personal choice.
I tried this and when i click test map it loads then gives me the error: Unable to Open map.
What am I doing wrong?
@xhatix: Go
It seems that the default return value for EventPlayer() ("Triggering Player" in GUI) is 1, which is what allows this to work in single player. I bet this would break if used in multiplayer (it would only register the event for Player 1). Triggering Player in the Event should be changed to Any Player.
How would I do multiple dialog boxes? I made one but When I try to make another it won't work.. I did the same thing do I need to do something different?
Never Mind, I forgot the Show Action X/
Awesome that helped me so much!
This seems good. However, many race-specific things like UI, dialog button style, menu color, alert voice, etc ... still cant be changed through trigger.
This is a fairly tedious way to create dialogs and their functionality, surely there is a data drive way, think Hibernate, that is similar to the command cards for unit abilities?
The next best thing may be to load files with dialog data and generate them automatically.
I'm running into problems. It seems this tutorial is old and not all the triggers are exactly the same. I'm not sure what to use in the comparison part.
EDIT: Nevermind I feel stupid now.
@Keyeszx: Go
If you want real race selection you should look into the "game attributes stuff" so players select race in lobby. I do believe you can do custom race stuff from there?
I'm using this to make a character select screen. For some reason the one Beider did seemed more complicated.
I might be wrong but if you create a new 'Race' object in the Data Editor you are unable to publish your map.
Not sure if that is what you were getting at. But yes, it is possible to - for example - choose a Starting Hero in the Game Lobby. But, thanks to Blizzard, the GUI is messy and I don't think it would be nice to have a player choose from a long list of Hero's. I think between 3 and 5 is ideal.
Back to the topic.
It is a nice tutorial and clears up a lot of stuff which beginners might get confused about. I wish there was something around like this when I spent about a day learning all I could about Dialogs :)
I was talking with some people and learned that arrays make this much cleaner. Still a helpful tutorial. I think I'm actually starting to understand the editor more.
Maybe I'm just being dumb but when I select the variable there is no option to for "last created dialogue" there is just... Count of list items Dialogue channel Dialogue height Dialogue item hight Dialogue item offset X/Y Dialogue Item width Dialogue Offset X/Y Dialogue Width Selected list item where am I going wrong here ?