Uszi
New Member
- Reaction score
- 5
Hello!
I'm working on a Risk style map with 42 territories that will randomly (and as equally as possible) be split between 2-6 players.
I'm not really sure how to go about doing it though.
First, I figured I would make an integer variable, and for each player with slot status playing, I would increase the value by one. So 6 players playing means that PlayersPlayingVar = 6, etc.
Then I made a region for each territory, and assigned them to a region array variable (i.e. Territory[1-42]).
Then I figured once the game started I would divide 42 by players playing, and then I would randomly give that quotient of territories to the players out of 42...
I was just beginning to go into that. Maybe another variable that had the value of 42/Players Playing... I'm really not sure.
Also, I was trying to figure out what to do with remainders. When Players Playing = 2,3 or 6 I'm fine. But 4 or 5, then I'm going to have to decide some fair way to divide the remaining territories. I figured I would put the remaining territories into a separate array, and then randomly give those to two lucky players who would start with one more territory than everyone else.
Eh. I don't want to cycle through players and randomly give each a territory until they're all gone. That would mean that players 1 and 2 would always get those extra two territories. :thdown:
Any suggestions? I would post triggers, but I don't have much more than setting variables at this point.
I'm working on a Risk style map with 42 territories that will randomly (and as equally as possible) be split between 2-6 players.
I'm not really sure how to go about doing it though.
First, I figured I would make an integer variable, and for each player with slot status playing, I would increase the value by one. So 6 players playing means that PlayersPlayingVar = 6, etc.
Then I made a region for each territory, and assigned them to a region array variable (i.e. Territory[1-42]).
Then I figured once the game started I would divide 42 by players playing, and then I would randomly give that quotient of territories to the players out of 42...
I was just beginning to go into that. Maybe another variable that had the value of 42/Players Playing... I'm really not sure.
Also, I was trying to figure out what to do with remainders. When Players Playing = 2,3 or 6 I'm fine. But 4 or 5, then I'm going to have to decide some fair way to divide the remaining territories. I figured I would put the remaining territories into a separate array, and then randomly give those to two lucky players who would start with one more territory than everyone else.
Eh. I don't want to cycle through players and randomly give each a territory until they're all gone. That would mean that players 1 and 2 would always get those extra two territories. :thdown:
Any suggestions? I would post triggers, but I don't have much more than setting variables at this point.