It is possible to have lobby choices reflect in-game.
I'm going to copy paste a solution from someone else here:
1. Go into your Game Attributes, and create a new attribute if you don't have one.
2. Set the Type to Player and give it a name.
3. Go to Usage and select Availability: First Come, First Serve.
4. Go to Values and enter each of the options you want the players to choose from. The number of values is equal to the total number of players. These values need to be unique. If Force 1 can have two players on it, then you need to differentiate the players that share Force 1 in this section, and then use triggers to make them allies in the game, and enemies of Force 2 and Force 3.
5. You can probably skip Defaults, but I haven't tried it. All of the options in the Values section can be used as a Default value.
Global variable Selected Factions <Attribute Value[8]> (array of size 8)
(array size is number of factions / players)
Functions:
attributeToFaction
Parameters
attribute <Attribute Value>
Actions
General - Switch (Actions) depending on attribute
Cases
General - If (Harawaith)
Actions
General - Return Haradwaith
(create one case for each faction, 8 total in my case)
(change the return type to however you want to track the player's chosen faction)
Triggers:
Call trigger Get Selected Factions from Map Initialization
Local variable Player <integer>
Player Group - For each player Player in (Active Players) do Actions
Variable - Set Selected Factions[Player] = (Faction Select value for player Player)
Set player color based on chosen faction
Set player bases based on chosen faction
I've got some more, but I wasn't finished with exploring alternative return types for my function, which affects what you pass back into the Get Selection Factions trigger.
Whatever you pass back and then set in Selected Factions[] is how you will have to reference the players for the remainder of the game at anytime that you would explicitly call a player number, rather than use an Owner of Unit or et cetera.
Edit: PS I've implemented this system (with a couple tweaks) in my map, so it does work. It just means that the actual position you are in in the lobby doesn't matter, just what attribute you select.
I've just spent an hour playing with the variants dialogue.
Looks awesomely powerful.
I thought, "aha! This is why the lobby system is so pitifully shite: the map makers are supposed to handle team allocations! Otay!"
Then I realised that as well as the lobby being shite, so is the variants module, or at least, the communication between Bnet and one's maps.
TOTAL BLIZZTARDS
Bump.
Any news on this?
indeed it has and took me less than 30 minutes to implement
go into wherever you are currently assigning your team selection. In my case for the map Conquest I was using a game attribute, I have simply changed it to
*Assigns Team1*
Player Group - Pick each player in (Players on team 1) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
Else
*Assigns Team2*
Player Group - Pick each player in (Players on team 2) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team2Players
Variable - Set NumberOfPlayers[2] = (Number of players in Team2Players)
Else
*For my map this section is essential for testing, By default if you 'test' your map your player will NOT be assigned to any team, so manually assign them if no players are found on any team*
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
NumberOfPlayers[1] == 0
NumberOfPlayers[2] == 0
Then
Player Group - Add player 1 to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
First post here and just started with the editor of Sc2.
I'm trying to make a TowerDefense Map with cooperative mode only (1 Team). The Map has 1-9 Players and pre-coloured starting positions.
So what I want to have is:
Player 1 (Host) enters lobby he should get color blue for example. Player 2 gets color teal...and so on (fixed order due to my settings). When the map starts each player should be placed where his color indicates.
Perfect adding would be when I switch the players' order in the lobby, the color should switch too, or when I switch the color (to one existing in the map) it should switch players order in the lobby, or at least do the right placement on the map. Additionally colors not given on the map should not be allowed to be chosen in the lobby.
Hope it was clear what I meant ;) Is this possible? I'm just a beginner and new on the editor, so any help on this issue would be appreciated.
First post here and just started with the editor of Sc2.
I'm trying to make a TowerDefense Map with cooperative mode only (1 Team). The Map has 1-9 Players and pre-coloured starting positions. So what I want to have is:
Player 1 (Host) enters lobby he should get color blue for example. Player 2 gets color teal...and so on (fixed order due to my settings). When the map starts each player should be placed where his color indicates.
Perfect adding would be when I switch the players' order in the lobby, the color should switch too, or when I switch the color (to one existing in the map) it should switch players order in the lobby, or at least do the right placement on the map. Additionally colors not given on the map should not be allowed to be chosen in the lobby.
Hope it was clear what I meant ;) Is this possible? I'm just a beginner and new on the editor, so any help on this issue would be appreciated.
Not possible to do it this way currently like you could in World Editor or Staredit. Must be done via triggers or by going into your game variants and locking the teams (but if you do it this way people won't be able to change places in the lobby).
I ran into this problem when I first started Hugs Vs. Kisses. It is very frustrating that it just clearly does not work as you would expect.
My solution was to completely disregard any starting position or team position settings that come with the editor and just make my own. It's really actually pretty simple once you think to do it this way.
using this method, you can allow people to switch teams or colors as much as they like in the lobby without disrupting placement.
1. Create a loop that goes through every active player and assign them to a player group based on their lobby team. This is essential to allow offline testing, since you'll be able to hard code player 1 into one of those player groups to test.
2. Create Normal Points on the map where you want the starting points to be.
3. Loop through each team player group and assign the player from any given team player group to the target point. This step is going to differ based on what you're using the starting point for, but in Hugs Vs. Kisses we basically just need to set it as their respawn point. In that case, it basically looks like this:
Initialize Starting Positions
Events
Local Variables
Team1Count = 0 <Integer>
Team2Count = 0 <Integer>
LoopVariable = 0 <Integer>
Conditions
Actions
Player Group - For each player LoopVariable in Team1Group do (Actions)
Actions
General - Switch (Actions) depending on Team1Count
Cases
General - If (0)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 001
Unit - Change ownership of Refinery [59.50, 32.50] to player LoopVariable and Change Color
Unit - Change ownership of Command Center [20.50, 75.50] to player LoopVariable and Change Color
General - If (1)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 002
General - If (2)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 003
General - If (3)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 004
Default
Variable - Modify Team1Count: + 1
Camera - Pan the camera for player LoopVariable to PlayerPoint[LoopVariable] over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Player Group - For each player LoopVariable in Team2Group do (Actions)
Actions
General - Switch (Actions) depending on Team2Count
Cases
General - If (0)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 005
Unit - Change ownership of Refinery [38.50, 63.50] to player LoopVariable and Change Color
Unit - Change ownership of Command Center [77.50, 20.50] to player LoopVariable and Change Color
General - If (1)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 006
General - If (2)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 007
General - If (3)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 008
Default
Variable - Modify Team2Count: + 1
Camera - Pan the camera for player LoopVariable to PlayerPoint[LoopVariable] over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Note that's for two teams of up to four players each; it works if fewer than four players join a team, and you can easily modify it to include more. You could also make it more dynamic, but that's not necessary considering the limit of fourteen players.
indeed it has and took me less than 30 minutes to implement
go into wherever you are currently assigning your team selection. In my case for the map Conquest I was using a game attribute, I have simply changed it to *Assigns Team1*
Player Group - Pick each player in (Players on team 1) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
Else *Assigns Team2*
Player Group - Pick each player in (Players on team 2) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team2Players
Variable - Set NumberOfPlayers[2] = (Number of players in Team2Players)
Else *For my map this section is essential for testing, By default if you 'test' your map your player will NOT be assigned to any team, so manually assign them if no players are found on any team*
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
NumberOfPlayers[1] == 0
NumberOfPlayers[2] == 0
Then
Player Group - Add player 1 to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
Else
EDIT: Formatting????
This trigger works. You have to re-format your triggers to be based around the new player numbers using a trigger array, but it all works out nicely.
I had some problems with this as well.
Since I only have two teams and they each share a starting area (meaning their start locations are relatively close to one another) I simply checked within which start location each player is and setup the player/team start locations via Player Properties etc.
It works just fine and wasn't too complicated. I did not even have to do any variation for testing the map - in the editor i simply get a random start location which works just as well ^^
Sigh.... Just explained it and it didn't post my reply.
Anyway, There is a way to very easily do this. When I get home tonight(aprox 3-4 hours) I will write a tutorial for it. So watch for it in the tutorials section!
Like so.
No custom map has this implemented. If the lobby looks like:
Team 1:
paranoiks
(none)
Team 2:
idiocracy
(none)
People want idiocracy to be Player 3, but he is Player 2
This has to be fixed by Blzzard
@Paranoiks: Go
It is possible to have lobby choices reflect in-game.
I'm going to copy paste a solution from someone else here:
1. Go into your Game Attributes, and create a new attribute if you don't have one. 2. Set the Type to Player and give it a name. 3. Go to Usage and select Availability: First Come, First Serve. 4. Go to Values and enter each of the options you want the players to choose from. The number of values is equal to the total number of players. These values need to be unique. If Force 1 can have two players on it, then you need to differentiate the players that share Force 1 in this section, and then use triggers to make them allies in the game, and enemies of Force 2 and Force 3. 5. You can probably skip Defaults, but I haven't tried it. All of the options in the Values section can be used as a Default value.
Global variable Selected Factions <Attribute Value[8]> (array of size 8) (array size is number of factions / players)
Functions: attributeToFaction Parameters attribute <Attribute Value> Actions General - Switch (Actions) depending on attribute Cases General - If (Harawaith) Actions General - Return Haradwaith (create one case for each faction, 8 total in my case) (change the return type to however you want to track the player's chosen faction)
Triggers: Call trigger Get Selected Factions from Map Initialization Local variable Player <integer> Player Group - For each player Player in (Active Players) do Actions Variable - Set Selected Factions[Player] = (Faction Select value for player Player) Set player color based on chosen faction Set player bases based on chosen faction
I've got some more, but I wasn't finished with exploring alternative return types for my function, which affects what you pass back into the Get Selection Factions trigger.
Whatever you pass back and then set in Selected Factions[] is how you will have to reference the players for the remainder of the game at anytime that you would explicitly call a player number, rather than use an Owner of Unit or et cetera.
Edit: PS I've implemented this system (with a couple tweaks) in my map, so it does work. It just means that the actual position you are in in the lobby doesn't matter, just what attribute you select.
Here's what I've done to fix the issue.
http://forums.sc2mapster.com/resources/tutorials/8902-trigger-placing-identical-teams-made-from-lobbies/#p3
Didn't the new patch add something to easily get the lobby teams via triggers? It should all be relatively straight forward now.
indeed it has and took me less than 30 minutes to implement
go into wherever you are currently assigning your team selection. In my case for the map Conquest I was using a game attribute, I have simply changed it to
*Assigns Team1*
Player Group - Pick each player in (Players on team 1) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
Else
*Assigns Team2*
Player Group - Pick each player in (Players on team 2) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to Team2Players
Variable - Set NumberOfPlayers[2] = (Number of players in Team2Players)
Else
*For my map this section is essential for testing, By default if you 'test' your map your player will NOT be assigned to any team, so manually assign them if no players are found on any team*
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
NumberOfPlayers[1] == 0
NumberOfPlayers[2] == 0
Then
Player Group - Add player 1 to Team1Players
Variable - Set NumberOfPlayers[1] = (Number of players in Team1Players)
Else
EDIT: Formatting????
Actually this new method is a bit annoying for testing afaik.
Because it's picking lobby teams, when you test your map there is no lobby involved, so Team 1 and Team 2 appear empty :(
@KratsAU: Go
Millenium7 already accounted for that at the end of his post...
@pqpoiuyqwert: Go
Ahh, so he did :)
Hey guys!
First post here and just started with the editor of Sc2.
I'm trying to make a TowerDefense Map with cooperative mode only (1 Team). The Map has 1-9 Players and pre-coloured starting positions. So what I want to have is:
Player 1 (Host) enters lobby he should get color blue for example. Player 2 gets color teal...and so on (fixed order due to my settings). When the map starts each player should be placed where his color indicates.
Perfect adding would be when I switch the players' order in the lobby, the color should switch too, or when I switch the color (to one existing in the map) it should switch players order in the lobby, or at least do the right placement on the map. Additionally colors not given on the map should not be allowed to be chosen in the lobby.
Hope it was clear what I meant ;) Is this possible? I'm just a beginner and new on the editor, so any help on this issue would be appreciated.
@Lorthas: Go
Not possible to do it this way currently like you could in World Editor or Staredit. Must be done via triggers or by going into your game variants and locking the teams (but if you do it this way people won't be able to change places in the lobby).
I ran into this problem when I first started Hugs Vs. Kisses. It is very frustrating that it just clearly does not work as you would expect.
My solution was to completely disregard any starting position or team position settings that come with the editor and just make my own. It's really actually pretty simple once you think to do it this way.
using this method, you can allow people to switch teams or colors as much as they like in the lobby without disrupting placement.
1. Create a loop that goes through every active player and assign them to a player group based on their lobby team. This is essential to allow offline testing, since you'll be able to hard code player 1 into one of those player groups to test.
2. Create Normal Points on the map where you want the starting points to be.
3. Loop through each team player group and assign the player from any given team player group to the target point. This step is going to differ based on what you're using the starting point for, but in Hugs Vs. Kisses we basically just need to set it as their respawn point. In that case, it basically looks like this:
Initialize Starting Positions
Events
Local Variables
Team1Count = 0 <Integer>
Team2Count = 0 <Integer>
LoopVariable = 0 <Integer>
Conditions
Actions
Player Group - For each player LoopVariable in Team1Group do (Actions)
Actions
General - Switch (Actions) depending on Team1Count
Cases
General - If (0)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 001
Unit - Change ownership of Refinery [59.50, 32.50] to player LoopVariable and Change Color
Unit - Change ownership of Command Center [20.50, 75.50] to player LoopVariable and Change Color
General - If (1)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 002
General - If (2)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 003
General - If (3)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 004
Default
Variable - Modify Team1Count: + 1
Camera - Pan the camera for player LoopVariable to PlayerPoint[LoopVariable] over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Player Group - For each player LoopVariable in Team2Group do (Actions)
Actions
General - Switch (Actions) depending on Team2Count
Cases
General - If (0)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 005
Unit - Change ownership of Refinery [38.50, 63.50] to player LoopVariable and Change Color
Unit - Change ownership of Command Center [77.50, 20.50] to player LoopVariable and Change Color
General - If (1)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 006
General - If (2)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 007
General - If (3)
Actions
Variable - Set PlayerPoint[LoopVariable] = Start Location 008
Default
Variable - Modify Team2Count: + 1
Camera - Pan the camera for player LoopVariable to PlayerPoint[LoopVariable] over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Note that's for two teams of up to four players each; it works if fewer than four players join a team, and you can easily modify it to include more. You could also make it more dynamic, but that's not necessary considering the limit of fourteen players.
This trigger works. You have to re-format your triggers to be based around the new player numbers using a trigger array, but it all works out nicely.
Is there a no trigger solution for this yet?
I had some problems with this as well.
Since I only have two teams and they each share a starting area (meaning their start locations are relatively close to one another) I simply checked within which start location each player is and setup the player/team start locations via Player Properties etc.
It works just fine and wasn't too complicated. I did not even have to do any variation for testing the map - in the editor i simply get a random start location which works just as well ^^
Sigh.... Just explained it and it didn't post my reply.
Anyway, There is a way to very easily do this. When I get home tonight(aprox 3-4 hours) I will write a tutorial for it. So watch for it in the tutorials section!
To see how to do this please visit http://forums.sc2mapster.com/resources/tutorials/17419-trigger-misc-lobby-to-in-game-team-setup/
:)
@Grimshad: Go
This link doesn't work!