Staredit Network

Staredit Network -> UMS Assistance -> Randomizing Locations
Report, edit, etc...Posted by FlareonFurry on 2006-11-23 at 15:28:56
I'm making a Russian Roulette map, and I'd like to know how to make 6 locations appear in different spots each time the map is played.
Any suggestions?

Report, edit, etc...Posted by JaFF on 2006-11-23 at 15:30:25
Instead of actually moving the locations, why not change the effect that each location gives?
Report, edit, etc...Posted by FlareonFurry on 2006-11-23 at 15:33:51
I'm unsure if I can do that without redoing my current setup with triggers.
If I create 6 different units capable of burrow, and use move anyunit to location, will they be moved randomly each time?
Report, edit, etc...Posted by Pure_Jeenyus on 2006-11-23 at 23:42:07
id say use 6 different burrowable units, and use switches but that would be some hard work to make them each random and not over lap... hmmm

how about this:

put 1 defiler, 1 hydra, 1 drone, 1 infest, 1 ling, and hero defiler,(or whatever units) burrowed each in a spot u want a loctaion, then have 6 hero lings burrowed somewhere else, not near the locations.

now for location one set 3 switches to random then make each one move the location to a unit, for the extra 2 switch combinations make them reset the randomization. now when a location is moved, move a burrowed hero ling to it. now for the next ones do the same thing but add the condition of: player brings 0 devouring one. also make an alternate trigger for if there is one there so if the player brings one devouring one to the location have the randomization restart.

if u dont get all this dont worry, ill make an example map and upload it in a few mins when im done.

ADDITION:
ok, im done. look through all the triggers and make sure to read all the notes in the trigger list. its not a quick or super ez solution but it works. maybe theres a better way but this one appears to be flawless.
Report, edit, etc...Posted by fritfrat(U) on 2006-11-23 at 23:42:24
Sorry for the person below me, I edited my way because it really didn't apply to what you wanted... it was to just cycle a DC through 1-6.

Just randomize 3 switches, and use 6 of the combinations as location spots. Make the other 2 combinations re-randomize the 3 switches.
Report, edit, etc...Posted by Pure_Jeenyus on 2006-11-23 at 23:48:24
ya, that is a much ezier way... but if he wants the locations randomized as opposed to the effects of the locations(which i would have done in the first place), i made an example of how that can be done.
Report, edit, etc...Posted by Wormer on 2006-11-24 at 10:58:34
There is a simple method that does what you want to, but it has it's drawbacks.

The idea is as follows: you're placeing these 6 locations (L1-L6) on the places where they should be and then just exchange them or not (with probability 1/2).

That is how it could be done. Randomize 6 switches (R1-R6). Then if R1 is Set then exchange L1 and L2 (L1<>L2) else do nothing. After this, if R2 is Set then L2<>L3 and so on. In the end we're changing L6 and L1. We could write it as L1<>L2, L2<>L3, L3<>L4, L4<>L5, L5<>L6, L6<>L1.

Actually not all combinations could be realized. Lets count it up. There are 6 Locations that coud be placed on 6 Spots, it is 6! = 720 different combinations. In the method the number of combinations doubles on each step, so there are 2^6=64 combinations, not so much.

We could improve the method by several ways. We'll take 9 Switches and do it the next way: we'll leave those 6 exchanges as they are and add additional 3 exchanges for example ... , L3<>L4, L3<>L5, L3<>L6. So that there are much more combinations avalible 2^9=512 (although not all of them might be different). We could make 10 exchanges, but then there are 1024 combinations and there certanly will be equal. You could experiment with different exchange sequence and count.

By the way it is easy to see that the sequence L1<>L2<> ... <>L6<>L1 is guaranteeing that each location could be placed at each position at last.

Oh, and you'll need an additional temporary location Tmp in order to exchange locations and a unit NotExist which, as you could guess, must not exist on these locations in order to center them on each other.

Triggers:
QUOTE
Trigger: // Randomize Switches
Conditions:
Switch 'Randomize' is set.
Actions:
Randomize switch 'R1'.
...
Randomize switch 'R6'.
Preserve trigger.

Trigger: // L1<>L2
Conditions:
Switch 'Randomize' is set.
Switch 'R1' is set.
Actions:
Move location 'Tmp' on 'NotExist' at 'L1'.
Move location 'L1' on 'NotExist' at 'L2'.
Move location 'L2' on 'NotExist' at 'tmp'.
Preserve trigger.

...

Trigger: // Finish Randomization Process
Conditions:
Switch 'Randomize' is set.
Actions:
Clear 'Randomize'.
Preserve trigger.


Then just set up Randomize switch in order to start randomization. Please, draw attention that order is significant.


Advatages:
1. Simplicity. Only 8-12 triggers to randomize 6 locations is not many.
2. Very fast speed. Actually all could be done only in one triggers pass.

Disadvatages:
1. We can see that there either not all combinations avalible or there are equal ones. And if there are equal combinations than some of them are more likely to happen.

If these suits you just use it. cool1.gif
Report, edit, etc...Posted by Pure_Jeenyus on 2006-11-27 at 13:00:05
is this not solved?
Next Page (1)