Whats the best way to randomize what player gets a unit without using switches?
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
The easiest way is to fixate what every player gets: P1 -> Rine, P2 -> Goon, etc. and then randomize the start locations. Ofc that is, when you don't need it dynamically in the game.
Then make a temporary location (vision to, or not, you decide) where every trigger loop you first remove, then spawn a (or more) unit(s) depending on your switch combination.
The formula for how many outcomes the switches have is x = nē [n = # of switches], so make sure you have enough.
Then move the unit(s) to where you need them.
With hyper triggers, having a constant death count looping to the amount of outcomes, depending on how you need the randomization, will let you get a different outcome for each death, and even if the player is 1/12 of a second different from another player, they will get a different outcome.
None.
With hyper triggers, having a constant death count looping to the amount of outcomes, depending on how you need the randomization, will let you get a different outcome for each death, and even if the player is 1/12 of a second different from another player, they will get a different outcome.
Thats probably the most useful way, because with Random Start Locations, it isn't really effective if it is a PvE map. With the death counter system, 1/12 seconds of a difference isn't much.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
I also thought about this, but unless you have very few outcomes its partially predictable.
Yeah, but if you're only going to check for it about once every few minutes or so it works just fine, it only doesn't work if the player is doing it within seconds of the last one.
Oh, and my two tutorials on Death Counts and on Switches give good methods of randomization:
http://Falkoner.CoW.GooglePages.com/Tutorials.html
None.
He says
without switches.
All Players :
Always
Add 1 death for DC
All players have at least 9 DC
Set DC to 1 for All
Player'x' : (x = 1 - 8)
All players have exactly 'x' DC
give unit to Current Player
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
He says without switches.
D'oh... I read the opposite... O.o
All Players :
Always
Add 1 death for DC
All players have at least 9 DC
Set DC to 1 for All
Player'x' : (x = 1 - 8)
All players have exactly 'x' DC
give unit to Current Player
What are you trying to do here? For whom is the DC incremented? All players or Current Player?
To make the DC counting method Falk suggested more random you could count 2 DCs.
For example DC1 from 0-4 and DC2 from 0-6.
And then create units for every possible combination:
DC1 = 0 & DC2 = 0 -> create Rine
DC1 = 0 & DC2 = 1 -> create Ling
... etc.
Another approach would be to use junkyard dog. I haven't thought this through to the end, but I can imagine the following:
Have all units that could be given junkyard dog in an isolated area.
Put a few small locations in there from where you teleport units that enter the small location to temporary locations (if they are free). This is your "random pool".
When you need a random unit check the first of the temorary location, if no unit is there, teleport from the 2nd location, etc.
I count a DC there and depending on the DC, the appropriate Player will get a unit.
Like DC is 1: Player 1 will get it, if it is 5: player 5 will get.
I use all players because it will make it player-independent, if it were like P3 if P3 leaves triggers wont work anymore. If there is a computer player just use it instead, it will never leave
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
oh shit... lol I think I have never misunderstood a topic that completely like this one...
I thought he wanted to know how to give a
random unit to a
specific player.
next time i should try to sleep more than 2 hours...
Place some critters in a box and have a location for each outcome that the critter can move to. You can also use a unit running the Junkyard Dog AI in place of a critter.
Only problem with that is that it takes time, but if it's a predetermined outcome, time doesn't really matter.
None.