Hey all,
looking for a trigger to detect how many players are playing in a custom game at the start of a match (i.e how many were in the lobby) so I can set up buildings for each player playing and not just for every available player slot.
Cheers
the built in function "all players" returns a player group with all players. Run it on map initialization and store the result if you need to refer to it later.
I suggest you use things like comparisons of the "player state" to see if it matches "human" and "active". There are other states too that you could use. This means that you would push a if-then-else action into the for-loop. The player number is given to the players according to the order in which they enter the game lobby. Its not according to how they appear in the player lobby list. To see which team a player belongs to you should use a switch statement and go through each player/team combination using the function... hm forgot its name.. but its something like comparison(gameLobbyTeamHasPlayer(1,2) = true) where 1 is the player number and 2 is the team.
Hey all, looking for a trigger to detect how many players are playing in a custom game at the start of a match (i.e how many were in the lobby) so I can set up buildings for each player playing and not just for every available player slot. Cheers
@Skobe: Go
the built in function "all players" returns a player group with all players. Run it on map initialization and store the result if you need to refer to it later.
as an example usage:
@finiteturtles: Go
In addition to this:
I suggest you use things like comparisons of the "player state" to see if it matches "human" and "active". There are other states too that you could use. This means that you would push a if-then-else action into the for-loop. The player number is given to the players according to the order in which they enter the game lobby. Its not according to how they appear in the player lobby list. To see which team a player belongs to you should use a switch statement and go through each player/team combination using the function... hm forgot its name.. but its something like comparison(gameLobbyTeamHasPlayer(1,2) = true) where 1 is the player number and 2 is the team.
good luck!
Thanks heaps guys, much appreciated