Every mapmaker who has been working on custom team games knows the struggle with local/battle.net testing. Teams are created and recognized in very different ways. This strategy which I'm presenting here is one way of overcoming this obstacle.
What you need to know
Everything is done with the trigger editor. You need to know how to make custom triggers and functions, and player group related functions.
Creating team groups
When the game starts the teams are initiated. These teams are then used thoghout the game. This is done in a initialization function. In multiplayer games, you detect the team belonging with the PlayerGroupHasPlayer(GameAttributeLobbyTeam(1)),1) in a switch function.
When playing locally this option will return nothing. So also make an initialization function that sets the teams manually. For testing purposes, remember that you can set the alliance to a state where you have control of all players units.
This was just the "detection". You will also need handles for these teams. Therefore, create Player group variables for each team. At the same time as you do the detection: add the player to these groups according to how you want to shape the teams.
The rest
In the rest of you game-program: always use these groups when working with team detection, such as team score and team member death detection. This means, when detecting team membership, dont use the game lobby detection function, but your custom group.
As said before: remember that you can set the alliance so that you can control all players units!
Every mapmaker who has been working on custom team games knows the struggle with local/battle.net testing. Teams are created and recognized in very different ways. This strategy which I'm presenting here is one way of overcoming this obstacle.
What you need to know
Everything is done with the trigger editor. You need to know how to make custom triggers and functions, and player group related functions.
Creating team groups
When the game starts the teams are initiated. These teams are then used thoghout the game. This is done in a initialization function. In multiplayer games, you detect the team belonging with the PlayerGroupHasPlayer(GameAttributeLobbyTeam(1)),1) in a switch function.
When playing locally this option will return nothing. So also make an initialization function that sets the teams manually. For testing purposes, remember that you can set the alliance to a state where you have control of all players units.
This was just the "detection". You will also need handles for these teams. Therefore, create Player group variables for each team. At the same time as you do the detection: add the player to these groups according to how you want to shape the teams.
The rest
In the rest of you game-program: always use these groups when working with team detection, such as team score and team member death detection. This means, when detecting team membership, dont use the game lobby detection function, but your custom group.
As said before: remember that you can set the alliance so that you can control all players units!
There is a function called IsTestMap that returns a boolean. It can be used to run things in test mode.