Hey everyone, I need a trigger that would spawn selected random units at a location.
The units will spawn randomly and continously. The units that will be spawned randomly I will choose. I think I will only use like 5 units to be spawned randomly. I hope you get wat I need help on.
I think i got to use switches to do this and I started it a bit:
Condition: If 'marine' is set ( meaning terran marine to be spawned )
Action: 'hydra' is cleared, 'tank is cleared' ect
create 1 marine at 'location'
preserve trigger.
something like that right.. but how would i make it select randomly ;O
Okay, you couldnt randomize switches easily since there are 4 outcomes from switches, then 8, so no 5, but what you could do is have a deathcounter constantly coutnign to 5 then going back down to 0, then just check what number is up for each outcome, but that wouldnt work with constant spawn, so you could use 1 switch to decide how many death counts get added, by randomizing it so it is set or cleared, and adding 1 for set and 2 for cleared. Then that would work.
Yes, but Roy, none of those would work because death counters go in order, 1, 2, 3, 4, 5, so there would be a pattern in what units are spawned, and switch randomization wouldnt work since there is no amount of switches you can use to get 5 outcomes.
I tried the switch randomization and it works but really only in the beginning. After a while it doesn't really randomize anymore. The same unit keeps spawning and once in a while a diff one but those 2 are always the same. ANyone kno why? Preserved trigger is in there..
Try having a pool of units that might spawn, all on junkyard dog, then oull one from the middle of the pool, that would also work.
QUOTE(Falkoner @ Dec 9 2006, 07:29 PM)
... and switch randomization wouldnt work since there is no amount of switches you can use to get 5 outcomes.
[right][snapback]601786[/snapback][/right]
3 switches = 8 outcomes, correct? Just have switches 6, 7 and 8 re-shuffle the switches
I am using 3 switches.. why use more if they dont even realyl worK? ... In the beginning, there would be 8 diff units being spawned but after a while, only 1-2 units get spawnned ( not really randomized ) ...
Have you checked the tutorial? Well, I think I can explain it here.
Scince you have 3 switches there are 2^3 = 8 variants (C C C), (C C S), (C S C), (C S S). (S C C), (S C S), (S S C), (S S S) where the position represents number of switch and the letter represents whether the switch is Cleared or Set.
QUOTE
I am using 3 switches.. why use more if they dont even realyl worK? ... In the beginning, there would be 8 diff units being spawned but after a while, only 1-2 units get spawnned ( not really randomized ) ...
That way there are 8 different variants using 3 switches but not 3 as you might think. That may be the problem, when one of those mixed variants (for example (C S S)) is turned out and you dont handle it. But it is strange that you still get units spawn.
That way you could take any five combinations and make other outcomes rerandomize the switches. In this case some passes of triggers checking may not spawn a unit. To decrease the probability of such blank passes it is better to place rerandomization triggers on top of others. On the other hand you can make other outcomes spawn the same units, but then some units will be more likely to spawn. You can use mixed variant and take 4 switches where there are 2^4 = 16 combinations and make those 15 variants spawn units (3 outcomes for each unit) and the last combination rerandomize.
Do you understand what I am talking about?
Wormer's idea is good; randomize 4 switches, give each unit 3 possibilities, make the 16th re-randomize.
I'd personally just do a death counter, though. I doubt that the units are spawning as fast as hyper triggers can run, so just continuously count from 1-5. You could even throw in an always-randomizing switch with another "if set, add 1 death)," to make it even more random.
I have no idea wat Wormer is trying to say but I think he is trying to say add more switches that would randomize the 3 switches..
EX: Condition: Always
Action: Randomize '1'
Randomize '2'
Randomize '3
Set 'Random'
??? Like that? I don't wan to add more switches cuz its a *BEEP* to do and for 4 different locations to be spawned.
First of all, have 1 trigger like
CONDITIONS:
'Random' is cleared
ACTIONS:
Set 'Switch' to Randomize
and again
and again
Set 'Random'
Preserve Trigger.
As for the spawn triggers, it's like:
CONDITIONS:
'Switch1' is cleared
'switch2' is cleared
'switch 3' is cleared
ACTIONS:
Set 'Marine'
Preserve Trigger.
And you can just have a separate trigger to spawn a marine when the switch 'Marine' is set. That'd looks something like:
CONDITIONS:
'marine' is set
ACTIONS:
create 1 marine at location
clear switch 'random'
preserve trigger
ADDITION:
Do that about 7 more times with different units, but with different switch combinations (as the other guy above said 111, 000, 001, etc etc etc). It's boring and tedious, but that's what triggering is.
ok here, i think i know what you want, ive done it before. you need a 2x2 area of land where the random units will be at. and a locations. heres some units for my example.
Example units:
Marine
Tank
Hydra
Archon
Ghost
Triggers:
this one makes them go randomly, preferbly get HT's and u need 1 that says, always, set switch ghost
Trigger |
Description: |
Random Unit, Selective |
|
Players: |
¤ Player X |
Conditions: |
¤ Player X brings exactly 0 any unit to "2x2 land"
|
¤ Switch Ghost is set |
Actions: |
¤ clear switch Ghost
|
¤ create 1 marine at "2x2 land" for player x
|
¤ set switch Marine
|
¤ wait 100 mil sec's
|
¤ clear Marine
|
¤ remove all Marine for player x at "2x2 land"
|
¤ create 1 Tank at "2x2 land" for player x
|
¤ set switch Tank
|
¤ wait 100 mil secs
|
¤ clear switch Tank
|
¤ remove all Tanks from "2x2 land"
|
¤ create 1 Hydra at "2x2 land"
|
¤ set hydra
|
¤ wait 100 mil secs
|
¤ clear hydra
|
¤ remove all htdras at "2x2 land"
|
¤ create 1 Archon at "2x2 land" for player x
|
¤ set archon
|
¤ wait 100 mil secs
|
¤ clear archon
|
¤ remove all archons at "2x2 land"
|
¤ create 1 ghost at "2x2 land" for Player x
|
¤ set switch ghost
|
¤ wait 100 mil secs
|
¤ remove all ghosts at "2x2 land"
|
¤ preserve trigger |
then make it when a player brings a unit, such as a hero seige tank(seige mode) to a area and switch marine, tank, ect is set, it makes that unit.
I found why it doesn't work. When I removed hyper triggers, it randomizes fine. With Hyper triggers, it doesn't. It stops after a while. The reason I have hyper triggers is that because I hvae 4 spawn locations. With hyper triggers the units spawn randomly equally.. without it 1 side spawns faster than all others... How can I fix this?
Are there any waits for the same players as the triggers for the slower sides? You could be experiencing wait block.
yEA i GOT WAIT 900 ms for player 8 <== player that has all the randomization triggers
There is a wait 900 for every outcome.. dont want to have it spawned that fast..
then theres your problem... use DC timers instead.
...go down to section called 'using DC as timers'?
QUOTE(Zeratul_101 @ Dec 10 2006, 08:38 PM)
...go down to section called 'using DC as timers'?
[right][snapback]602218[/snapback][/right]
... I DID THAT..
care to elaborate why you think it doesn't work then...?
He's probably using DC along with Wait triggers.. so it's the same problem, but now with a middleman (and 5% less baking soda!).