Looping...

Post Reply
ronangamero
Terran Settler (Unemployed)
Terran Settler (Unemployed)
Posts: 4
Joined: Fri Jul 30, 2010 5:49 am

Looping...

Post 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 ??
User avatar
omega20
Zerg Ultralisk Waste Manager
Zerg Ultralisk Waste Manager
Posts: 692
Joined: Sun Apr 06, 2008 7:38 am

Re: Looping...

Post 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
Last edited by omega20 on Fri Jul 30, 2010 6:50 am, edited 1 time in total.
[imgwh 400x120]http://www.sigrealm.com/freesigs/178_Starcraft2MultSig.jpg[/imgwh]
ronangamero
Terran Settler (Unemployed)
Terran Settler (Unemployed)
Posts: 4
Joined: Fri Jul 30, 2010 5:49 am

Re: Looping...

Post 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..
User avatar
High_Zealot
Terran Starport Baggage Handler
Terran Starport Baggage Handler
Posts: 139
Joined: Wed Apr 28, 2010 1:38 pm
Location: Canada

Re: Looping...

Post 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?
ronangamero
Terran Settler (Unemployed)
Terran Settler (Unemployed)
Posts: 4
Joined: Fri Jul 30, 2010 5:49 am

Re: Looping...

Post 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...
Last edited by ronangamero on Mon Aug 02, 2010 8:56 am, edited 1 time in total.
User avatar
High_Zealot
Terran Starport Baggage Handler
Terran Starport Baggage Handler
Posts: 139
Joined: Wed Apr 28, 2010 1:38 pm
Location: Canada

Re: Looping...

Post 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.
You do not have the required permissions to view the files attached to this post.
ronangamero
Terran Settler (Unemployed)
Terran Settler (Unemployed)
Posts: 4
Joined: Fri Jul 30, 2010 5:49 am

Re: Looping...

Post 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?
Last edited by ronangamero on Tue Aug 03, 2010 11:17 am, edited 1 time in total.
User avatar
High_Zealot
Terran Starport Baggage Handler
Terran Starport Baggage Handler
Posts: 139
Joined: Wed Apr 28, 2010 1:38 pm
Location: Canada

Re: Looping...

Post by High_Zealot »

Post Reply