This is an exerpt from a Trigger I've been messing with. The only problem with it is that... What if you only have seven players, and, it selects 8?
There is no actual "Select random player from <Group> " that I have seen.
Any help for the two of us?
Actions
Player Group - Pick each player in (All players) and do (Actions)
Actions
Player Group - Add all players in (Active Players) to Untainted
General - Wait 5.0 Game Time seconds
Player Group - Add player (Random integer between 1 and 15) to Tainted
Well, if this is like a zombie map, then what you can do is add all of the player's units to a unit group, then select a random unit from that unit group, and use the 'owner of selected unit' thing to get whose unit it is. I'm pretty sure that is how it works, but if I need to try to show the exact triggers, let me know.
I'm not sure if I'm going about it wrong or not, but, I can't find a "select all Units". Neither by player or by region ( Made a region, stuck all of the players' starting units in said circle, and tried aforementioned tactic ).
Need help, how can I pick a random player out of a playergroup?
Necro'ing this thread, 'cause I need it too.
This is an exerpt from a Trigger I've been messing with. The only problem with it is that... What if you only have seven players, and, it selects 8?
There is no actual "Select random player from <Group> " that I have seen.
Any help for the two of us?
Actions
Player Group - Pick each player in (All players) and do (Actions)
Actions
Player Group - Add all players in (Active Players) to Untainted
General - Wait 5.0 Game Time seconds
Player Group - Add player (Random integer between 1 and 15) to Tainted
@Afflicting: Go
Well, if this is like a zombie map, then what you can do is add all of the player's units to a unit group, then select a random unit from that unit group, and use the 'owner of selected unit' thing to get whose unit it is. I'm pretty sure that is how it works, but if I need to try to show the exact triggers, let me know.
@Afflicting: Go
Untitled Variable 001 = (Random integer between 0 and 15) <Integer>
"Player" is just an integer.
@Grogian:
Yes, that's what I was hoping. But from what I've found...
If there are eight players, and the integer can go from one to fifteen... if it picks higher than eight, game is screwed.
And to do Integer from One to Eight, allowing up to fifteen people into the game... means near half the people never had a shot of being evil anyway.
But, I like the "Select unit" option. I'll go with that. :)
@Shawn91210:
I'm not sure if I'm going about it wrong or not, but, I can't find a "select all Units". Neither by player or by region ( Made a region, stuck all of the players' starting units in said circle, and tried aforementioned tactic ).
Could you show it to me?
@Afflicting: Go
I'll send you a PM. ;)