Page 1 of 1
Looping...
Posted: Fri Jul 30, 2010 6:46 am
by ronangamero
Hi.. i looked for ir on the forum and on the site, but didn't find...
I trying to make a map, and I wanna create a loop... but it's not working..
I did something like this...
Player 1
CONDITION
Player 1 Kills exactly 1 A-UNITY
ACTION
Set Switch 1
CONDITION
Switch 1 is Set
ACTION
Create 20 B-UNITIES at Location 1
Player 2 (computer)
CONDITION
Switch 1 is Set
ACTION
Create 1 A-UNITY at Location 0
Clear Switch 1
I works only in the first loop.. why I need to do ??
Re: Looping...
Posted: Fri Jul 30, 2010 6:49 am
by omega20
You must add the 'preserve trigger' action. Otherwise, the trigger will only fire once. So, you have it like this:
Player 1
CONDITION
Player 1 Kills exactly 1 A-UNITY
ACTION
Set Switch 1
CONDITION
Switch 1 is Set
ACTION
Create 20 B-UNITIES at Location 1
Preserve trigger
Player 2 (computer)
CONDITION
Switch 1 is Set
ACTION
Create 1 A-UNITY at Location 0
Clear Switch 1
Preserve trigger
Re: Looping...
Posted: Fri Jul 30, 2010 1:16 pm
by ronangamero
OK.. I did it.. but it is still not working... i kill the A unit.. it creates B units.. and A unit apears again.. i kill it again.. and nothing happens...
If i put PRESERVE TRIGGER on the first conditional it starts an infinite loop... maybe i'm using the wrong triggers... need to think a little more..
Re: Looping...
Posted: Fri Jul 30, 2010 2:34 pm
by High_Zealot
Try it like this
Player 1
CONDITION
Player 2 has suffers exactly 1 death of A-UNITY
ACTION
Set Switch 1
CONDITION
Switch 1 is Set
ACTION
Create 20 B-UNITIES at Location 1
Preserve trigger
Player 2 (computer)
CONDITION
Switch 1 is Set
ACTION
Create 1 A-UNITY at Location 0
Clear Switch 1
Set deaths of A-UNITY of player 2 to 0
Preserve trigger
A-UNITY does belong to player 2 right?
Re: Looping...
Posted: Mon Aug 02, 2010 8:43 am
by ronangamero
Yeah, A unitis belongs to player 2...
But this will make any other player that kill A - Unity to give 20 B-units to player one won't it? ... i want to give B units to the player that kills it..
and... i tryed... but it didn't work again. only works on the first loop...
Re: Looping...
Posted: Mon Aug 02, 2010 11:29 am
by High_Zealot
I think i managed to make it work. The triggers are in the map. I'm not sure it works for each and every player but it does work when I tested it in single player.
Re: Looping...
Posted: Mon Aug 02, 2010 3:36 pm
by ronangamero
High_Zealot wrote:
I think i managed to make it work. The triggers are in the map. I'm not sure it works for each and every player but it does work when I tested it in single player.
It worked now... it needed Preserve Trigger on all actions
Here is the code:
PLAYER 1
CONDITIONS
Player 2 has suffered exactly 1 death of SCV
ACTIONS
Set "SCV Creator"
Modify death counts for player 2: Set to 0 for SCV
Preserve Trigger
CONDITIONS
"SCV Creator" is Set
ACTIONS
Create 20 "Hunter Killer (Hydralisk)" for Player 1 at Location 1
Preserve Trigger
PLAYER 2
"SCV Creator" is Set
ACTIONS
Create 1 SCV at Location 2 for Player 2
Clear "SCV Creator"
Modify death counts for player 2: Set to 0 for SCV
Preserve Trigger
Ok.. but I'd like to make a map with 6 players, ahn when a player kills a SCV, this players get the Hydras... how to do?? any idea?
Re: Looping...
Posted: Tue Aug 03, 2010 1:01 pm
by High_Zealot