Quote from NudeRaider
The presented solutions seem pretty complicated, so here's how I'd do it. It's essentially only 4 unique triggers, some repeated.
The gist:
When it's time to pick locations take 1 trigger loop for the players to generate a random number and transfer it to Custom Score. Whoever has the highest score gets spot 1 and his score reset. The next player with highest score gets spot 2 and so on.
Issues:
Note: I use DC "location number" both to store where the player's stuff will be placed and to divide between phase 1 where the random number is generated and stored and phase 2 where the stuff is placed. That's why you see it as a condition everywhere.
Triggers:
Player Force
DC "location number" = 0 for Player Force
Time to pick locations
Randomize Switch 1
Randomize Switch 2
Randomize Switch 3
Set Custom Score to 0 for Current Player
Player Force
DC "location number" = 0 for Player Force
Time to pick locations
Switch 1 is set
Add 1 to Custom Score for Current Player
Player Force
DC "location number" = 0 for Player Force
Time to pick locations
Switch 2 is set
Add 2 to Custom Score for Current Player
Player Force
DC "location number" = 0 for Player Force
Time to pick locations
Switch 3 is set
Add 4 to Custom Score for Current Player
Comp Player
Custom Score at least 1 for Player Force //only run this trigger if players already randomized their stuff. Can be skipped if the comp player has a higher player number than the players.
DC "location number" = 0 for Player Force
Time to pick locations
Set DC "location number" to 1 for Player Force
Add 1 to Custom Score for Player Force
Player Force
DC "location number" exactly 1 for Current Player
Time to pick locations
Current Player has the most Custom Score
Set Custom Score to 0 for Current Player
Create units at location "Spot 1" for Current Player
Add 1 to DC "location number" for Player Force
Player Force
DC "location number" exactly 2 for Current Player
Time to pick locations
Current Player has the most Custom Score
Set Custom Score to 0 for Current Player
Create units at location "Spot 2" for Current Player
Add 1 to DC "location number" for Player Force
... Repeat the triggers for locations 3-6. (change blue parts)
The gist:
When it's time to pick locations take 1 trigger loop for the players to generate a random number and transfer it to Custom Score. Whoever has the highest score gets spot 1 and his score reset. The next player with highest score gets spot 2 and so on.
Issues:
- In case of 2 players rolling the same number it favors the lower player number. To counter that you can add more switches. I'll use only 3 in my example (8 possible values)
- It relies on Custom Score which may be in use. Other options are Most Resources, or Commands most units at.
- Worst case, it takes 7 trigger loops. (6 players, 1 initial randomization)
Note: I use DC "location number" both to store where the player's stuff will be placed and to divide between phase 1 where the random number is generated and stored and phase 2 where the stuff is placed. That's why you see it as a condition everywhere.
Triggers:
Generate random number ...
Players
Conditions
Actions
... and store in Custom Score 1/3
Players
Conditions
Actions
... and store in Custom Score 2/3
Players
Conditions
Actions
... and store in Custom Score 3/3
Players
Conditions
Actions
Initialize actual unit placement
Players
Conditions
Actions
Placing stuff at location 1/6
Players
Conditions
Actions
Placing stuff at location 2/6
Players
Conditions
Actions
... Repeat the triggers for locations 3-6. (change blue parts)
My map is just about complete after I squash a few bugs. With my newly acquired knowledge, thanks to you especially and a few others, I've decided to comb through the triggers line by line and make sure the execution order and conditions won't cause any problems. Plus I want to ensure I understand exactly what's going on with each one, organize, and comment them appropriately.
Anyways, when reviewing your triggers, I'm confused about one thing. Most the time, when you read or edit 'DC "location number"', you're doing it for the Current Player or the entire Force 1. Why is that exactly?
The reason I ask is because the way I've been organizing my DCs. Any DC that is global and the same for all players, eg, a DC that keeps track of the current round number, is owned solely by Player 8.
From what I understand of your triggers, it seems to me the location number is global, so to speak, but each player will still be holding a duplicate value. For consistency, was thinking of changing it to 'DC "location number" for Player 8', across the board in all conditions and actions.
Wanted to check with you first as a little self-quiz to make sure I'm not completely lost. Thanks again sir.
-
None.