Page 1 of 1

Noob question

Posted: Thu Jul 03, 2008 6:22 am
by Winter
I've just started getting into making maps and such and I've come across a problem when I want to preserve a trigger.  I want to create a trigger that whenever the condition is met the action is executed but I want the condition to be able to do it multiple times.  Eg.

Condition:
Zergling dies

Action:
Create Zergling
Preserve trigger


What I am aiming for is that whenever a zergling dies, another is created but what is happening is the action is repeated infinitely leaving me with an uncontrollable zergling population.

I'm feeling pretty stupid so any help would be appreciated.

Re: Noob question

Posted: Thu Jul 03, 2008 6:36 am
by Winter
Ok i've figured it out :) I need to add the 'Always' condition.

Re: Noob question

Posted: Thu Jul 03, 2008 6:37 am
by omega20
Winter wrote: Ok i've figured it out :) I need to add the 'Always' condition.
No, the 'always' condition is just to place the trigger in a space of time. You must use switches. For example:

1st TRIGGER

Condition:
Player _ commands at most 0 Zergling

Action:
Set Switch 1
Preserve trigger


2nd TRIGGER

Condition:
Switch 1 is set

Action:
Create 1 Zergling in (location)
Clear Switch 1
Preserve trigger


This should work. ;)

Re: Noob question

Posted: Thu Jul 03, 2008 6:59 am
by Winter
Awesome tnx

Re: Noob question

Posted: Thu Jul 03, 2008 7:57 am
by Revan
One trigger is enough for that, without using that switch:

C: Player x commands at most/exatly 0 zergling
A:Create 1 zergling for player x
A:Preserve Trigger

Or, if you want to get back that zergling instantly, no matter how much you command then use this:

C: Player X has suffered at least 1 deaths of Zergling
A: Set deaths for player x: Subtract 1 for Zergling
A: Create 1 Zergling for player x
A: Preserve Trigger

Re: Noob question

Posted: Thu Jul 03, 2008 8:04 am
by omega20
Oh! It's true.

At least, my comment has served as something, because it may serve as an example for other triggers that require switches.