Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Switch doesn't work
Switch doesn't work
Nov 3 2007, 3:36 pm
By: TristanOfVP  

Nov 3 2007, 3:36 pm TristanOfVP Post #1



I've never really used switches before and I can't get this one to work. Basically every 260 on the timer I want it to spawn units when a command center is at the location.

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Infested Command Center", "nest1", At least, 1);
Switch("Switch1", set);

Actions:
Preserve Trigger();



Conditions:
Switch("Switch1", set);
Countdown Timer(Exactly, 260);

Actions:
Create Unit("Player 6", "Zerg Hydralisk", 15, "teleport area A");
Set Switch("Switch1", clear);
Preserve Trigger();
Comment("Time spawn");


Any help would be greatly appreciated. Thanks.



None.

Nov 3 2007, 4:18 pm Killer2121 Post #2



hmm try at most



None.

Nov 3 2007, 7:16 pm Oyen Post #3



First of all, the only action on your 1st trigger is preserve trigger. 2nd of all, your 2nd trigger clears your switch, yet you don't have another trigger to re-set it, so the trigger will only activate once.

I don't quite understand your timer. Do you have some triggers that reset the timer to whatever it was before it reaches 260? If not, that 2nd trigger will only activate once.



None.

Nov 3 2007, 7:28 pm who Post #4



C:
player brings cc to nest
switch 1 is clear
A:
set countdown timer to 260
set switch 1

C:
switch 1 is set
player brings 0 cc to nest
A:
clear switch 1
set timer to 0

C:
switch 1 is set
timer is 0
A:
set timer to 260
create 15 hydras at spawn

Preserve Trigger should be applied to all of them.
The first trigger sets the spawn switch if he has a CC there, but if the spawn switch is cleared. It also sets the first timer.
The second one clears the spawn switch if he has no CC there, but if the spawn switch is set. It also sets the timer to 0.
The third switch activates if the spawn switch is set, and if the timer is 0. It sets the timer back up to 260 and creates hydras.



None.

Nov 3 2007, 8:18 pm NudeRaider Post #5

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

Quote from TristanOfVP
I've never really used switches before and I can't get this one to work. Basically every 260 on the timer I want it to spawn units when a command center is at the location.

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Infested Command Center", "nest1", At least, 1);
Switch("Switch1", set);

Actions:
Preserve Trigger();



Conditions:
Switch("Switch1", set);
Countdown Timer(Exactly, 260);

Actions:
Create Unit("Player 6", "Zerg Hydralisk", 15, "teleport area A");
Set Switch("Switch1", clear);
Preserve Trigger();
Comment("Time spawn");


Any help would be greatly appreciated. Thanks.

First of all you don't need a switch here.
Just put the timer and the bring trigger into the conditions, like this:

P6
Conditions
Brings at least 1 cc to nest1
Countdown timer is at most 260s
Actions
Spawn units
[...]

But to explain how switches work:

Condition A -> set switch
Condition B -> clear switch
If switch is set -> actions

OR

Condition A -> set switch
If switch is set -> actions, clear switch

If you check your triggers there's no action that sets the switch. --> Checked switch always false --> trigger never fires
Also the exactly 260s could be a problem because triggers are only checked every 2s. Use at most 260s instead.

Btw. did you realize its a COUNTDOWN timer? Usually you check those to be 'at most 0' and set them to 260s.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Oh_Man