Good'old well thought questionnairy would be nice to make and share to see the status of mapmaking. Sharing across mapster, teamliquid, blizzard's forum, hiveworkshop, and even in-game when playing to get people that are not necessairly interested into mapmaking already. Someone that is on mapsters is there for a reason. The more I think of it, the more I see a well made questionnary with google doc or something so people can leave comments, etc.
How could we reach more people to get into mapmaking? Starcraft 2 really need more people to get involved into this... we should make some sort of questionary about why people does not do mapmaking, and why they should and how they could.
With this example with the trigger Game Initialization you can then pick eatch player and create their unit based on the race they choosed (the variable "Player Has Choosed")
Feel free to PM me if you need so. You can also write back here and hopefully I'll get the notice. Dialogs is one part in the triggers that I'm very familiar with, except for custom dialogs appearance. But I guess at that point it would be easy to learn.
I made one example of how you could do it. There are probably better ways, more efficient, etc. But it still gives you a first glimpse and can improve it as you go.
The variable Player has voted would be the number of players for your map.
So now, you have a new triggers, let's call it "Player choosing". As event you would have, dialog item used, as condition which dialog item was used (the button).
In the actions, you would have a set variable for "Player has voted [triggering player]" == true.
Then something along the lines of a For eatch int from 1 to (your number of players). (You could add a local variable for temporary counting, say "Votes")
If Player has voted [int] == true
Then set variable votes +1
Else (nothing)
Then another if then else:
If number of active players == Votes (which means all active players voted)
Then do the actions to start the game and stop the timer.
So everytime a player votes, it will cycle through the array and see if everyone voted. It probably not "the most efficient way" but its not a big enough trigger to have any noticeable lags or issues. It's not trying to cycle through thousands of stuff you know...
1: If something is created, it means you might still have on map initialization the actions that creates the starting structures for all players (you know the default triggers you can see when making a new map) Then, if nothing appears other than your dialogs to pick a faction / race, you create the unit for it when voting is finish.
2: There are many ways of doing this, the examples I give might not be the "optimal" ones, but ones that can work. There are always better or different ways of doing thing based on your needs. To make what you wish here you need at least:
Some sort of Timer. Can be the default one that can be found in the action list about timers or you can make your own using dialogs and dialog items Label and variables and some basic mathematics such as
Set X = 30
Repeat forever: (Note: Could also be repeat X number of times)
If: X > 30
Then: set the dialog item text to X
wait 1 sec
set variable X -1.
Else: Timer is over.
A condition that checks if all players voted when a player votes. So the last player that votes will make the game starts. Using variable, like an Boolean (True/False) Array "Player has voted". When a player votes it sets that player to true. Then you run a loop to check if eatch value is an active player (to prevent leavers) and if it's set to true. Then this means all players voted and the trigger can continue on making the game start.
About the end of the timer, you check if eatch player is an active player, and if it has voted to true, if not, you can do a simple local variable integer that you can do "Set variable random integer between X and Y" based on the number of races you have. Then you assign that race based on the random int.
Note:
You might enconter some minor bugs. For example: make sure that if all players votes and the game starts, to stop the timer, otherwise it will keep going down and spawn once again the starting structures.
You might want to have an action that disables the triggers about winning/losing conditions for example if a player has no building end game. Since during voting in the beginning no players have structure it would end right there.
You will most likely go through some stupid / annoying bugs just like anyone ;) If you need a more specefic example using the editor just ask. But I think you might be able to understand the idea. Hopefully my explainations are clear enough.
You must make sure that you firstcreate the dialog or dialog item and only thenset the variable to last created dialog or dialog item (or any action at all like showing it; the dialog must be created first). Dialog item like images are not necessarily needed to be set as a variable. Variables are there mostly to be able to track what is happening with what specefic dialog. For example it's very usefull to set a button as a variable, but not an image or a label (text). If you hide the dialog containing dialog items, they all get hide, so no need to hide all of them individually.
So first, create the "Dialog". Set it's variable. Then do any action on it like hiding its background, changing scale, etc. Then create your dialog item like an image, label, etc. and only if needed (if you need to keep track of it, say if you want to change the image, or the text, or the values of the dialog item, you have to save it as a variable, if you don't need to keep track of it for futur changes, you can just create it and leave it there all fine. When the time comes to destroy the "Dialog" all the dialog items it contain will be deleted as well.
Then create your button and set a variable to it (after your created it). Then your other trigger will be able to work because the condition will have a valid reference of what is "Amon Zerg[1]".
The use of array is to prevent having many many variables for the same kind of stuff. For example, say you want a variable that changes based on "is player alive". (for whatever "is alive" mean like still having structure or whatever).
The long way would be variables:
Is player 1 alive
Is player 2 alive
Is player 3 alive...
And using array for this woudl be:
Is player alive [integer]
Where integer is from 0 to the number you set the size of the array. Then you can use stuff like:
For eatch Int from 1 to 8:
If: Is player alive [Int] == true
Then: this player is alive
Else: this player is dead
Instead of having to check eatch variable individually.
Maybe you would not have to use array in your situation although, you said you have 15 different faction, so you could use an array for that, like variable integer with array size 15: "Faction [15]" (depending on what you want to do of course). You could also create what is called a "Preset" which basicly changes an integer into text, kind of.
You could create a Preset and add a value for eatch faction with their name.
Then when you want to get the race picked as an integer, you can choose "preset" and find the preset you created. For you visually it will be the text, for the editor it gives an integer.
First you have the "Dialog" which is a big container. What it contains are "Dialog Item". If you create a new dialog you have to make sure to "Show/Hide Dialog" to show it which is what you are missing. You can also hide the background of the "Dialog" to only show what it contains.
Second you have to create "Dialog Item" and also save a variable like the dialog but as a "Dialog Item" variable. This will allow to track click Events and add a condition to know which dialog item was clicked.
Third, when creating dialog and dialog items the size, offset, etc. numbers are in pixels. So for your example, your dialog's scale is 500 pixels by 400 pixels. You can copy paste dialog items you created, like buttons, but remember to change the offset or it will be created behind the other button you copied.
Here is an example:
A more advanced way that would save you time is by using variable position when creating your dialogs. It's a bit more complicated and you have to use what is called "Array" where you can find by clicking on your variable then checking the Array box and giving it a size.
That gives you this:
Then you can do whatever with it by adding a condition to your Event checking for which button got clicked. Here I did a simple thing that cycle through the variable and check if it's that one that got clicked and then it sends a text message based on it.
Good'old well thought questionnairy would be nice to make and share to see the status of mapmaking. Sharing across mapster, teamliquid, blizzard's forum, hiveworkshop, and even in-game when playing to get people that are not necessairly interested into mapmaking already. Someone that is on mapsters is there for a reason. The more I think of it, the more I see a well made questionnary with google doc or something so people can leave comments, etc.
Working on projects:
How could we reach more people to get into mapmaking? Starcraft 2 really need more people to get involved into this... we should make some sort of questionary about why people does not do mapmaking, and why they should and how they could.
Working on projects:
Working on projects:
With this example with the trigger Game Initialization you can then pick eatch player and create their unit based on the race they choosed (the variable "Player Has Choosed")
Feel free to PM me if you need so. You can also write back here and hopefully I'll get the notice. Dialogs is one part in the triggers that I'm very familiar with, except for custom dialogs appearance. But I guess at that point it would be easy to learn.
Working on projects:
I made one example of how you could do it. There are probably better ways, more efficient, etc. But it still gives you a first glimpse and can improve it as you go.
Map example:
https://ufile.io/cuhi3
Working on projects:
I'll elaborate a bit.
The variable Player has voted would be the number of players for your map.
So now, you have a new triggers, let's call it "Player choosing". As event you would have, dialog item used, as condition which dialog item was used (the button).
In the actions, you would have a set variable for "Player has voted [triggering player]" == true.
Then something along the lines of a For eatch int from 1 to (your number of players). (You could add a local variable for temporary counting, say "Votes")
If Player has voted [int] == true
Then set variable votes +1
Else (nothing)
Then another if then else:
If number of active players == Votes (which means all active players voted)
Then do the actions to start the game and stop the timer.
So everytime a player votes, it will cycle through the array and see if everyone voted. It probably not "the most efficient way" but its not a big enough trigger to have any noticeable lags or issues. It's not trying to cycle through thousands of stuff you know...
Is that better?
Working on projects:
It's kind of tricky to know why the default units spawn without seeing the triggers.
I want to point out though that in the trigger you show here there is:
You could simply keep one of those two and it should still work fine.
Working on projects:
1: If something is created, it means you might still have on map initialization the actions that creates the starting structures for all players (you know the default triggers you can see when making a new map) Then, if nothing appears other than your dialogs to pick a faction / race, you create the unit for it when voting is finish.
2: There are many ways of doing this, the examples I give might not be the "optimal" ones, but ones that can work. There are always better or different ways of doing thing based on your needs. To make what you wish here you need at least:
Note:
You will most likely go through some stupid / annoying bugs just like anyone ;) If you need a more specefic example using the editor just ask. But I think you might be able to understand the idea. Hopefully my explainations are clear enough.
Note: Are you on discord? I'm Fenix there. https://www.sc2mapster.com/forums/general/general-chat/184298-sc2mapster-discord
Working on projects:
Are you sure the Set variable is After the create button action? The variable itself is fine, it just has to be dialog item which is correct here.
Working on projects:
You must make sure that you first create the dialog or dialog item and only then set the variable to last created dialog or dialog item (or any action at all like showing it; the dialog must be created first). Dialog item like images are not necessarily needed to be set as a variable. Variables are there mostly to be able to track what is happening with what specefic dialog. For example it's very usefull to set a button as a variable, but not an image or a label (text). If you hide the dialog containing dialog items, they all get hide, so no need to hide all of them individually.
So first, create the "Dialog". Set it's variable. Then do any action on it like hiding its background, changing scale, etc. Then create your dialog item like an image, label, etc. and only if needed (if you need to keep track of it, say if you want to change the image, or the text, or the values of the dialog item, you have to save it as a variable, if you don't need to keep track of it for futur changes, you can just create it and leave it there all fine. When the time comes to destroy the "Dialog" all the dialog items it contain will be deleted as well.
Then create your button and set a variable to it (after your created it). Then your other trigger will be able to work because the condition will have a valid reference of what is "Amon Zerg[1]".
The use of array is to prevent having many many variables for the same kind of stuff. For example, say you want a variable that changes based on "is player alive". (for whatever "is alive" mean like still having structure or whatever).
The long way would be variables:
And using array for this woudl be:
Where integer is from 0 to the number you set the size of the array. Then you can use stuff like:
For eatch Int from 1 to 8:
If: Is player alive [Int] == true
Then: this player is alive
Else: this player is dead
Instead of having to check eatch variable individually.
Maybe you would not have to use array in your situation although, you said you have 15 different faction, so you could use an array for that, like variable integer with array size 15: "Faction [15]" (depending on what you want to do of course). You could also create what is called a "Preset" which basicly changes an integer into text, kind of.
You could create a Preset and add a value for eatch faction with their name.
Then when you want to get the race picked as an integer, you can choose "preset" and find the preset you created. For you visually it will be the text, for the editor it gives an integer.
Working on projects:
Hey, Dialogs work like this:
First you have the "Dialog" which is a big container. What it contains are "Dialog Item". If you create a new dialog you have to make sure to "Show/Hide Dialog" to show it which is what you are missing. You can also hide the background of the "Dialog" to only show what it contains.
Second you have to create "Dialog Item" and also save a variable like the dialog but as a "Dialog Item" variable. This will allow to track click Events and add a condition to know which dialog item was clicked.
Third, when creating dialog and dialog items the size, offset, etc. numbers are in pixels. So for your example, your dialog's scale is 500 pixels by 400 pixels. You can copy paste dialog items you created, like buttons, but remember to change the offset or it will be created behind the other button you copied.
Here is an example:
A more advanced way that would save you time is by using variable position when creating your dialogs. It's a bit more complicated and you have to use what is called "Array" where you can find by clicking on your variable then checking the Array box and giving it a size.
That gives you this:
Then you can do whatever with it by adding a condition to your Event checking for which button got clicked. Here I did a simple thing that cycle through the variable and check if it's that one that got clicked and then it sends a text message based on it.
Working on projects: