How do i remove a trigger when a task has been completed?
e.g.: destroying a command center, which cancels the opponent's spawn.
Use a condition that you can make become false, i.e. a switch (most proabable), or a death count, or something like that.
You would need to use switches. So, you would want if a player controls a command center then set the switch and use that switch as the condition (set) for you spawn. THEN create another trigger that says if the task is completed to set that same switch. And then you would have a third switch that says if that player suffers the death of a command center then to clear the switch. Just in case this is to confusing i will write out the triggers for you. I will do it for player 1.
| Trigger |
| Description: |
| Spawn |
|
| Players: |
| ¤ Player 1 |
| Conditions: |
| ¤ Switch 1 is set |
| Actions: |
| ¤ Create whatever units wherever you want as well as preserve trigger etc. |
| Trigger |
| Description: |
| Command Center Dies |
|
| Players: |
| ¤ Player 1 |
| Conditions: |
| ¤ Player 1 suffers the death of 1 command center |
| Actions: |
| ¤ Clear switch 1 |
| Trigger |
| Description: |
| Task completed |
|
| Players: |
| ¤ Player 1 |
| Conditions: |
| ¤ Task is completed |
| Actions: |
| ¤ Set switch 1 |
You will also need a trigger to set switch 1 at the very beginning of the game. OR you could just do the opposite in each trigger. So, when it says
set, change it to
clear and vice versa.
You can also create isolated scenarios
Using your example, "destroying a command center, which cancels the opponent's spawn", you may set the Spawn condition to "Player X (player who commands the CC) suffers exactly 0 deaths of Command Center".
By isolated scenarios I mean you will need to make sure no other actions can interfere with this, e.g., giving another Command Center to Player X that could die even though it does not relate to the destruction of the Command Center you designate.
Like I said before, simple use any condition that you can make false or that will be false following such an event.
I think he means that he's making a map where if you lose your cc, you stop spawning units.
So no switches, no death counts...
| Trigger |
null| Conditions: |
| ¤ Player brings at least 1 command center to location. |
| Actions: |
¤ Spawn stuff at location [the one that the command center is in].
|
| ¤ Preserve Trigger. |
That should be your spawn trigger.
So is this how it should be?
| Trigger |
| Description: |
| trigger |
|
| Players: |
| ¤ player 7 |
| Conditions: |
¤ 2400 game seconfs have passed
|
| ¤ set as switch 1 |
| Actions: |
| ¤ create 6 battlecruisers at [location] |
| Trigger |
| Description: |
| clearing trigger |
|
| Players: |
| ¤ player 7 |
| Conditions: |
| ¤ player 7 commands exactly 0 communications array |
| Actions: |
| ¤ clear switch 1 |
You could do it only one trigger if thats what you want.
| Trigger |
| Description: |
| The Trigger |
|
| Players: |
| ¤ Player 7 |
| Conditions: |
| ¤ Current Player commands atleast/exactly (up to you) 1 command array |
| Actions: |
¤ create units
|
¤ wait 2400
|
| ¤ preserve trigger |
thats it. if that was all you wanted you don't need a switch
Tried that. units now appear as soon as the communications array is destroyed.
yea becuase create units came before wait...