|
Peaceful Warrior
|
Switches are fairly simple to understand, they work like a light switch. There is an ON, and an OFF. Those are the only 2 positions. Now if you walk a room after you've been gone the lights are usually off right? Well the same principle works with maps. The switch will be in the off position when you start it. StarEdit refers to OFF as CLEAR, and ON as SET.
Now realizing that little tidbit, how about I show you some practical uses: 1. Halting Preserve Trigger. This generally works by having that when the switch is SET, the trigger will run, however, if the switch is put into the CLEAR position, the trigger will not run: Trigger Players: ¤ Player 1 Conditions: ¤ Always ¤ Switch1 is SET Actions: ¤ Create 1 Terran Marine at location "Marine Spawn" ¤ Preserve Trigger Now if we were to turn it off all you would have to do is: Trigger Players: Player 1 Conditions: ¤ Player 1 commands 0 Marine Spawner ¤ Switch1 is SET Actions: ¤ CLEAR Switch1 ¤ Preserve Trigger 2. Separating Wait Blocks. When you have 2 waits that you want to run at the same time there is a dilemma, you must wait for one to complete before you allow the other one to even begin. However, the wait block only applies for that one type of player. So what we need to do is make the 2 wait times execute for 2 different players so they do not affect each other. Kenoli showed a good example how to split up a trigger using switches (a method I've named Web Triggering). Now all of those triggers execute for 1 player, but what if you made one of them execute for a different player instead? Let's say we want to create a zergling every two second and a hydralisk every five. Now other than using messy and complicated DCs (Death Counters), let's use our Web Trigger method. Trigger Players: ¤ Player 2 Conditions: ¤ Always Actions: ¤ Create 1 Zerg Zergling at location "Spawn" for Player 1 ¤ Wait 2000 milliseconds ¤ Preserve Trigger Trigger Players: ¤ Player 1 Conditions: ¤ Always ¤ Switch 1 is CLEAR Actions: ¤ Create 1 Zerg Hydralisk at location "Spawn" for Player 1 ¤ SET Switch 1 ¤ Preserve Trigger Now look carefully at the player of this next one. Trigger Players: ¤ Player 2 Conditions: ¤ Switch 1 is SET Actions: ¤ Wait 5000 milliseconds ¤ CLEAR Switch 1 ¤ Preserve Trigger As you can see, both wait times won't affect each other, and you get the affect you desire. If you need more help or perhaps an Example Map simply ask. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
Thanks, but how come when I try this... It doesn't work... This is what I did... TRIGGER 1: -Players: Player 1 -Conditions: Switch 1 is Cleared -Actions: Create 1 unit for player 1 Wait 500 milliseconds Preserve Trigger TRIGGER 2: -Players Player 1 -Conditions: Player 1 bring one unit to... -Actions: Switch 1 is Set Preserve Trigger TRIGGER 3: -Players: Player 1 -Conditions: Player 1 brings exactly 0 units to location -Actions: Switch 1 is Cleared Preserve Tigger ![]() ![]() ![]() ![]() ![]() ![]() |
|
someone09
|
It's simply a lot of randomized switches:
if you wanted some combinations, then it would be something like this: C: P1 brings 1 civ to randomize Switch 1 is clear A: Move civ to reset Set Switch 1 C: Switch 1 is set Switch 2 is clear A: Clear Switch 2 Randomize Switch 10 Randomize Switch 11 Randomize Switch 12 C: Switch 1 is set Switch 10 is set Switch 11 is set Switch 12 is set A: Clear Switch 1 Create marine at spawn C: Switch 1 is set Switch 10 is set Switch 11 is set Switch 12 is clear A: Clear Switch 1 Create medic at spawn C: Switch 1 is set Switch 10 is set Switch 11 is clear Switch 12 is clear A: Clear Switch 1 Create bc at spawn C: Switch 1 is set Switch 10 is clear Switch 11 is clear Switch 12 is clear A: Clear Switch 1 Create firebat at spawn ... and so on. lets say we had 1 as set, and 0 as cleared. Since 3 switches are randomized, all of the combos would be like this: 111 110 101 100 011 010 001 000 ![]() ![]() ![]() ![]() ![]() ![]() |