I'm having trouble with my starting map vote, which picks a player who wants to play as the enemy. My trouble is I don't know how to do the rest of the advanced part.
So it works like this. >Map Starts
-30 second timer display on the right
-Vote pop up: Do you want to play as Hunter?
Answers: Yes or No
What I can't figure out is, I have 10 players on the map so how do I get it to randomly pick a player from the list of players who voted yes to play as the team Hunter at the end of the 30 seconds.
I have it all in my head but don't know how to script it properly. Player 8 is Hunter = True, create unit "Hunter" at point "Spawn Hunter".
Player 1 (1-10 who didn't get picked as "Hunter" or voted "No") is Hunter = False , create unit "SCV" at point "Player 1 Spawn"
I think I have a good map idea if I can get this part to work, everything else is done with my buildings, minerals etc. If anyone could help me I'm more than willing to post credits for the help when the map is released.
Create a player variable array with size = max # of players. Create a repeat forever loop. Within the loop, set a local integer variable to a random number between 1 and the max # of players (I'll call it "random".) Then run an if/then/else function, checking whether player [random] selected Yes and whether player [random] is in the game. If both return true, set them to the "Hunter" and use a Break function. Else, wait 0.0 seconds.
If those conditions return false, the game will loop back and randomize the local variable again, choosing another player at random and checking them against the two conditions.
You may credit me if you wish, but I don't think it's really necessary.
This assumes at least one player selected Yes. If no players select Yes, the trigger will loop forever and nothing will be accomplished, so you'll have to find a way to deal with that.
I'm having trouble with my starting map vote, which picks a player who wants to play as the enemy. My trouble is I don't know how to do the rest of the advanced part. So it works like this. >Map Starts -30 second timer display on the right -Vote pop up: Do you want to play as Hunter? Answers: Yes or No
What I can't figure out is, I have 10 players on the map so how do I get it to randomly pick a player from the list of players who voted yes to play as the team Hunter at the end of the 30 seconds.
I have it all in my head but don't know how to script it properly. Player 8 is Hunter = True, create unit "Hunter" at point "Spawn Hunter". Player 1 (1-10 who didn't get picked as "Hunter" or voted "No") is Hunter = False , create unit "SCV" at point "Player 1 Spawn"
I think I have a good map idea if I can get this part to work, everything else is done with my buildings, minerals etc. If anyone could help me I'm more than willing to post credits for the help when the map is released.
Create a player variable array with size = max # of players. Create a repeat forever loop. Within the loop, set a local integer variable to a random number between 1 and the max # of players (I'll call it "random".) Then run an if/then/else function, checking whether player [random] selected Yes and whether player [random] is in the game. If both return true, set them to the "Hunter" and use a Break function. Else, wait 0.0 seconds.
If those conditions return false, the game will loop back and randomize the local variable again, choosing another player at random and checking them against the two conditions.
You may credit me if you wish, but I don't think it's really necessary.
This assumes at least one player selected Yes. If no players select Yes, the trigger will loop forever and nothing will be accomplished, so you'll have to find a way to deal with that.