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.
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.
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.
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
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
ActionsSpawn 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.