HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Pick every player" only runs once

08-31-2005, 08:44 PM#1
GaDDeN
Ok to make a long trigger short, it looks something like this:

The event is approximately 10 sec after map initialization.

"Players" is a player group with initial value empty and "Agent" is a unit.

Quote:
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked player) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)
Then - Actions
Player Group - Add (Picked player) to Players
Else - Actions

...


Player Group - Pick every player in Players and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of players in Players) Equal to 2
Then - Actions
Unit - Create 1 Agent for (Picked player) at (Position of Spawn Point 0015 <gen>) facing (Random angle) degrees
Else - Actions

Well its alot more complicated than that, but the other actions arent really connected to this.

What happens when i run the map (Elimination for those interested ;)) is that it spawns a agent for the FIRST player in the player group. If i play with 5 ppl (for example player 4, 6, 8, 9 and 12), it will only spawn player 4 and ignore the others. If i play alone as player 12 (brown), it will spawn me. I am no newbie to triggering and i have, of course, done lots of triggers just like this one before but... this just doesnt work. I have done some debug messages to check that they ARE in the player group, and they are. All players are in the player group, and trigger runs but... it only runs the trigger once for the first picked player and then ignores the rest for some reason.
08-31-2005, 09:20 PM#2
Vexorian
Are you destroying (All Players) or the other force to "prevent leas"?
09-01-2005, 05:27 AM#3
GaDDeN
No, im not.

Thanks for reminding me :), ive only removed location leaks so far!

Could this have anything to do with the problem? I THINK the problem is the "If players in players are equal to 2 then ..." because other than that its a perfectly normal trigger =(

edit: the "Players" group is used everywhere in the map, should i still create a temporary group, use it and remove it?
09-01-2005, 04:50 PM#4
Tim.
If its used multiple times, its fine as a global.

Try testing with 'Less than or equal to' and 'Greater than or equal to' and see if the trigger runs better. Maybe then it will be more obvious where the issue lies.
09-01-2005, 05:34 PM#5
GaDDeN
Thanks for the help :)

Ive been running some tests where i remove one action at the time and run the map, and i found out that the problem is the "If number of players in players is 2 then blabla". I think the trigger cant run when i ask how many there are in the group it is looping, so now i have changed it to the following (and it works):

If number of players in Players is equal to 2 then
pick every player in player and do actions
All my actions
--> else <--
pick every player in player and do actions
All my else actions

Its the first time i encounter this problem, but i guess its like this in all triggers trying to check the group its looping. I cant see why it shudnt work, but appearently it is the problem.