Let's say you want to have a random spawn of 4 different units.
First of all, you implement the trigger that will randomize :
Condition : Switch 3 is Clear
Action :
Randomize 'Switch 1'
Randomize 'Switch 2'
Toggle 'Switch 3'
Wait 'x' miliseconds
Preserve Trigger
Then, you have to detect wich unit you'll spawn... there is four possibilities that I'll represent by the trigger you need to add :
Condition :
Switch 1 is Set
Switch 2 is Set
Switch 3 is Set
Action :
Create Terran Marine at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Set
Switch 2 is Clear
Switch 3 is Set
Action :
Create Terran Ghost at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Clear
Switch 2 is Set
Switch 3 is Set
Action :
Create Protoss Zealot at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Clear
Switch 2 is Clear
Switch 3 is Set
Action :
Create Protoss Dragoon at Spawn
Toggle 'Switch 3'
Preserve Trigger
Simple heh?
As you can see, it's if it was a binary condition `:
If 00 then...
If 01 then...
If 10 then...
If 11 then...
0 = cleared, 1=setted
That's it...
Oh... and let's say you use 3 switches, you'll have a possibility of 8 units.
4 Switches: 16 Outcomes
5 Switches: 32 Outcomes
6 Switches: 64 Outcomes
7 Switches: 128 Outcomes
8 Switches: 256 Outcomes
9 Switches: 512 Outcomes
10 Switches: 1024 Outcomes
11 Switches: 2048 Outcomes
12 Switches: 4096 Outcomes
13 Switches: 8192 Outcomes
14 Switches: 16384 Outcomes
15 Switches: 32768 Outcomes
16 Switches: 65536 Outcomes
(This table is from a Maplantis Wiki)Oh... and just a last thing : let's say you want to use 4 switches cause you want to ahve a spawn of 10 different units, you HAVE to implement triggers of the 2 possibilities that there is no spawn...
Example with 2 switches (spawn of 3 units and 1 is nothing) :
Condition : Switch 3 is Clear
Action :
Randomize 'Switch 1'
Randomize 'Switch 2'
Toggle 'Switch 3'
Wait 'x' miliseconds
Preserve Trigger
Condition :
Switch 1 is Set
Switch 2 is Set
Switch 3 is Set
Action :
Create Terran Marine at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Set
Switch 2 is Clear
Switch 3 is Set
Action :
Create Terran Ghost at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Clear
Switch 2 is Set
Switch 3 is Set
Action :
Create Protoss Zealot at Spawn
Toggle 'Switch 3'
Preserve Trigger
Condition :
Switch 1 is Clear
Switch 2 is Clear
Switch 3 is Set
Action :
Set 'Switch 3'
Preserve TriggerThere we go...
Hope I've helped you!
Post has been edited 2 time(s), last time on Oct 8 2007, 6:37 pm by payne.
None.