I have a question about keeping track of players. I recently began to experiment in making my map adapt to different numbers of players. And most of my player trigger use the [ While "PlayerCount" < Number of Active Players ] do (PlayerCount + 1) and the actions for that player, using PlayerCount to reference the player directly by using his number, so in a 6 player map I would use [ While PlayerCount < 6 ] do (PlayerCount + 1) and actions.
But now I had that paranoid moment where I began to think, if player 3 leaves the game, does player 4 become player 3? If that were true, my triggers might malfunction since they always assume player 3 will be player 3 even if player 1 and 2 left the game.
I also want to try and optimize my triggers by having them skip players whom have left the game to make the map process less information.
So
1) Do other players take the spots of players who leave the game? (Say 3 players are active, player 2 left the game, so now Player 1 is player 1, and player 3 is the new Player 2, there are now a total of 2 active players and player 3 no longer exists).
2) Is there a way I can reference only players that HAVE NOT left the game? And would this save my map space or help me avoid / cushion lag?**
I want to confirm this knowledge before I go basing my ENTIRE MAP off potentially incorrect information.
"1) Do other players take the spots of players who leave the game? (Say 3 players are active, player 2 left the game, so now Player 1 is player 1, and player 3 is the new Player 2, there are now a total of 2 active players and player 3 no longer exists)."
Player 2 will always be player 2, player 3 will always be player 3, etc. The only thing that would change is the number of active players (+ computers). Also, be careful with Player from Player Group if you're using the function Active Players.
"2) Is there a way I can reference only players that HAVE NOT left the game? And would this save my map space or help me avoid / cushion lag?"
You can use Active Players, but it includes computers. I never need computer players so I always use it.
Also, don't worry about lag. As long as you don't have hundreds of functions running in the same instant (-> no waits) you'll be fine. Some people treat waits and periodics like they're toxic waste. Don't worry about it.
You can also include a conditional IF branch in your actions to determine if the player in question is in the game. The functions I'm imagining are "Status Of Player" and "Controller of Player." For example:
I have a question about keeping track of players. I recently began to experiment in making my map adapt to different numbers of players. And most of my player trigger use the [ While "PlayerCount" < Number of Active Players ] do (PlayerCount + 1) and the actions for that player, using PlayerCount to reference the player directly by using his number, so in a 6 player map I would use [ While PlayerCount < 6 ] do (PlayerCount + 1) and actions.
But now I had that paranoid moment where I began to think, if player 3 leaves the game, does player 4 become player 3? If that were true, my triggers might malfunction since they always assume player 3 will be player 3 even if player 1 and 2 left the game.
I also want to try and optimize my triggers by having them skip players whom have left the game to make the map process less information.
So
1) Do other players take the spots of players who leave the game? (Say 3 players are active, player 2 left the game, so now Player 1 is player 1, and player 3 is the new Player 2, there are now a total of 2 active players and player 3 no longer exists).
2) Is there a way I can reference only players that HAVE NOT left the game? And would this save my map space or help me avoid / cushion lag?**
I want to confirm this knowledge before I go basing my ENTIRE MAP off potentially incorrect information.
@wisesquirrel: Go
"1) Do other players take the spots of players who leave the game? (Say 3 players are active, player 2 left the game, so now Player 1 is player 1, and player 3 is the new Player 2, there are now a total of 2 active players and player 3 no longer exists)."
Player 2 will always be player 2, player 3 will always be player 3, etc. The only thing that would change is the number of active players (+ computers). Also, be careful with Player from Player Group if you're using the function Active Players.
"2) Is there a way I can reference only players that HAVE NOT left the game? And would this save my map space or help me avoid / cushion lag?"
You can use Active Players, but it includes computers. I never need computer players so I always use it.
Also, don't worry about lag. As long as you don't have hundreds of functions running in the same instant (-> no waits) you'll be fine. Some people treat waits and periodics like they're toxic waste. Don't worry about it.
You can also include a conditional IF branch in your actions to determine if the player in question is in the game. The functions I'm imagining are "Status Of Player" and "Controller of Player." For example:
@wisesquirrel: Go
there is a default player group "active players" which contains all human players not having left the game yet.