Hi
I'm trying to create a 4v4 Tower Defense map. However I can't get the placement of the players in the teams right.
My current setup:
* All Players have starting location random
* Starting locations 1-4 and 5-8 are grouped in Team Options (Map -> Team Setting Basic and Advanced)
* Game variant 4v4 is added.
* Trigger code loops trough all active players and adds them to Player Group Team 1 or Team 2 according to starting position.
My thought was that the lobby should spawn each player on a random location but group them up by teams and set alliances. My Trigger logic would then read which players are on which side and create 2 Player Group variables which are used in the remaining script in the map.
My problem however is, that Players don't get placed together with their teammates. Sometimes an enemy of player1 will spawn in location 2...
How can I make the lobby place players according to their teams ? Shouldn't Team Settings make exactly this happen ?
Fixing starting locations is NOT an option as far as I can tell. As far as I have seen Player Numbers are not influenced by the Lobbyslot they are in. So for example if i fix the starting location of player 2 the second player joining the lobby will always be in this spot, even if you pull him too the other team in the lobby.
OK, I managed to get it working. The problem was, that I had both Basic and Advanced Team settings set.
As far as I can see several people are haveing problems with the lobby, so here is my solution (for 4v4):
* Set all Player Starting Locations to RANDOM (Fixed Starting Locations WILL NOT WORK)
* Go to Map -> Team Settings (Basic) and link all allied starting locations.
* Go to Map -> Game Variants and create a new Variand 4v4 with following options:
- Locked Alliances: yes
- Premade Game: yes
- Teams [Premade]: 4v4
- Team [Premade: 4v4]: Player 1 Team1[1], ..., Player 3 Team1[4], Player 5 Team 2[1] ... Player 8 Team 2[8] all UNLOCKED
* In your Trigger Init code read the teams like this
Team 1 = (Empty player group) <Player Group>
Team 2 = (Empty player group) <Player Group>
General - For each integer current player from 1 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player current player) == Playing
Then
General - Switch (Actions) depending on (Start location of player current player)
Cases
General - If (Start Location 001)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 002)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 003)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 004)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 005)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 006)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 007)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 008)
Actions
Player Group - Add player current player to Team 2
Default
Else
Now, what will happen is:
* The Lobby will spawn each player on a random spawn location, but will group allied players together according to the teams in the lobby and the settings under Map -> Team Settings (Basic)
* The Lobby will set all alliances according to the teams in the lobby.
So you will end up with players allied together and spawning together.
Now the tricky part is to read which players are in which team and add them to player groups which you can use in the rest of your scripting logic. I do this by looping through all players, checking if they are active and adding them to the player group depending on their starting location. In my case locations 1-4 are team 1 and 5-8 team 2. This should work for any combinations of teams though.
if team 1 should be east and team 2 should be west in the lobby: what happens if player 1 moves himself in the second team? or is in team 1 in the lobby but gets start location 006 as random?
@b0ne123: Go
Wheter Player 1 will spawn on the left or right side will be random, however all player in the same team as player 1 will spawn with him at the right team starting locations and will be allied to player1
So with this method you cannot choose in which team you are in, but you can choose which players are together in teams
Look at my lobby template. Lobby teams and start locations work with the triggers examples in the link below as long as the teams are balanced. If you try to setup a game where the teams are unbalanced then blizzards auto team balance function kicks in and you can't control teams or start locations for AI or players.
I will check out the template as soon as I have time, but my version also works for imbalanced teams. You can make 1v4 2v3, nomather what you select in the lobby will always be representated in the game.
@tmahring:
Computers dont seem to follow your rules at all. I am worried if I continue using your trigger that it will not work with Users aswell. Too add further, you cant move users in the lobby if you Lock their possitions like that using variants.
In my map it works perfectly with Computers in the Lobby (I only tested with computers so far)
You have to set the Team [Premade :4v4] Settings to UNLOCKED (as told in my post) to be able to move players in the lobby.
Are you certain all info is displayed. My teams are not matching up. sometimes I start with 3 on one side and 5 on another. Are slots allowed to be empty or does the system fail if slots are empty?
@tmahring:
i got what you are talking about to work, but after a test game many players joined and left and once the game was full i started, The teams had actually broken..
Now I'm not saying your system is bad it is in fact how I found a way to perfect it. Instead of picking each player with the integer simply build the trigger from scratch, for example if player 1 is playing then do all initiation for player 1. Then in a new trigger repeat for player 2. You will eventually have each player labeled a different start location so it will be lengthy but exact.
I built this trigger for a 3v3v3v3 map and no problems at all.
yeah, i had to rework my trigger since i posted this, i also added a check to see if the player is actually playing before i add him to a group.
Also i implemented a few helper functions like "Team of Player" which returns the player group of a players team and several other to make coding the rest easier.
The only problem I have now is that my map is listed with the custom/custom setting under join game - so all the work i put into this is for nothing until people realize to play the map with the right mode.
Gah I forgot to mention to most important thing....
You must set all non active players in player properties to Neutral. This prevents players from entering the game as player 9-15 because they are neutral slots even if the slots are set to None the lobby will still account player variable so you must account them as neutral. This prevents players ruining your system when they leave the lobby.
There is a way to make it so players can change mode whilst in lobby but I cant put my finger on it.
It might have something to do with attributes.
Just throwing this out. It's mostly handled via triggers and you'll want to create all your human player units via triggers/action definitions. Any neutral players would be handled just like a computer player would.
Hi
I'm trying to create a 4v4 Tower Defense map. However I can't get the placement of the players in the teams right.
My current setup:
* All Players have starting location random
* Starting locations 1-4 and 5-8 are grouped in Team Options (Map -> Team Setting Basic and Advanced)
* Game variant 4v4 is added.
* Trigger code loops trough all active players and adds them to Player Group Team 1 or Team 2 according to starting position.
My thought was that the lobby should spawn each player on a random location but group them up by teams and set alliances. My Trigger logic would then read which players are on which side and create 2 Player Group variables which are used in the remaining script in the map.
My problem however is, that Players don't get placed together with their teammates. Sometimes an enemy of player1 will spawn in location 2...
How can I make the lobby place players according to their teams ? Shouldn't Team Settings make exactly this happen ?
Fixing starting locations is NOT an option as far as I can tell. As far as I have seen Player Numbers are not influenced by the Lobbyslot they are in. So for example if i fix the starting location of player 2 the second player joining the lobby will always be in this spot, even if you pull him too the other team in the lobby.
http://www.sc2mapster.com/search/?search=lobby+teams :(
http://forums.sc2mapster.com/development/map-development/2276-detecting-teams-with-triggers-impossible/ http://forums.sc2mapster.com/general/general-chat/2192-lobby-teams-dont-match-map-team-definitions/
I didn't see a solution so far
OK, I managed to get it working. The problem was, that I had both Basic and Advanced Team settings set.
As far as I can see several people are haveing problems with the lobby, so here is my solution (for 4v4):
* Set all Player Starting Locations to RANDOM (Fixed Starting Locations WILL NOT WORK)
* Go to Map -> Team Settings (Basic) and link all allied starting locations.
* Go to Map -> Game Variants and create a new Variand 4v4 with following options:
- Locked Alliances: yes
- Premade Game: yes
- Teams [Premade]: 4v4
- Team [Premade: 4v4]: Player 1 Team1[1], ..., Player 3 Team1[4], Player 5 Team 2[1] ... Player 8 Team 2[8] all UNLOCKED
* In your Trigger Init code read the teams like this
Team 1 = (Empty player group) <Player Group>
Team 2 = (Empty player group) <Player Group>
General - For each integer current player from 1 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player current player) == Playing
Then
General - Switch (Actions) depending on (Start location of player current player)
Cases
General - If (Start Location 001)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 002)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 003)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 004)
Actions
Player Group - Add player current player to Team 1
General - If (Start Location 005)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 006)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 007)
Actions
Player Group - Add player current player to Team 2
General - If (Start Location 008)
Actions
Player Group - Add player current player to Team 2
Default
Else
Now, what will happen is:
* The Lobby will spawn each player on a random spawn location, but will group allied players together according to the teams in the lobby and the settings under Map -> Team Settings (Basic)
* The Lobby will set all alliances according to the teams in the lobby.
So you will end up with players allied together and spawning together.
Now the tricky part is to read which players are in which team and add them to player groups which you can use in the rest of your scripting logic. I do this by looping through all players, checking if they are active and adding them to the player group depending on their starting location. In my case locations 1-4 are team 1 and 5-8 team 2. This should work for any combinations of teams though.
if team 1 should be east and team 2 should be west in the lobby: what happens if player 1 moves himself in the second team? or is in team 1 in the lobby but gets start location 006 as random?
@b0ne123: Go Wheter Player 1 will spawn on the left or right side will be random, however all player in the same team as player 1 will spawn with him at the right team starting locations and will be allied to player1 So with this method you cannot choose in which team you are in, but you can choose which players are together in teams
@tmahring: Go
Look at my lobby template. Lobby teams and start locations work with the triggers examples in the link below as long as the teams are balanced. If you try to setup a game where the teams are unbalanced then blizzards auto team balance function kicks in and you can't control teams or start locations for AI or players.
http://www.sc2mapster.com/maps/bridgetest/files/6-lobby-template-sc2map/
@soulwhip: Go
I will check out the template as soon as I have time, but my version also works for imbalanced teams. You can make 1v4 2v3, nomather what you select in the lobby will always be representated in the game.
@MapCrafter:
In my map it works perfectly with Computers in the Lobby (I only tested with computers so far)
You have to set the Team [Premade :4v4] Settings to UNLOCKED (as told in my post) to be able to move players in the lobby.
@MapCrafter:
It works fine with empty slots. Check my map out, there you can see it implemented.
yeah, i had to rework my trigger since i posted this, i also added a check to see if the player is actually playing before i add him to a group. Also i implemented a few helper functions like "Team of Player" which returns the player group of a players team and several other to make coding the rest easier.
The only problem I have now is that my map is listed with the custom/custom setting under join game - so all the work i put into this is for nothing until people realize to play the map with the right mode.
Just throwing this out. It's mostly handled via triggers and you'll want to create all your human player units via triggers/action definitions. Any neutral players would be handled just like a computer player would.
http://forums.sc2mapster.com/resources/tutorials/8902-trigger-placing-identical-teams-made-from-lobbies/#p1