That works to tell if players are on opposite teams, but not what team they were on from the lobby screen when the game started. Team 1 is always the attacker in my map, and Team 2 is the defender. I just need to check which a player was on, but have been stumped on this for days.
Add each player to a global variable player group from team 1 (eg 3v3 add player 1, 2 and 3 to team 1).
Make a second variable and repeat (eg again 3v3, add player 4, 5 and 6 to team 2).
Have your trigger check if a given player belongs to the player group team 1 or team 2.
Add each player to a global variable player group from team 1 (eg 3v3 add player 1, 2 and 3 to team 1).
Make a second variable and repeat (eg again 3v3, add player 4, 5 and 6 to team 2).
Have your trigger check if a given player belongs to the player group team 1 or team 2.
What you describe is like in warcraft 3, slot at the lobby determined player #, so it was a simple matter of checking player numbers.
In SC2 however, player # is determined by what order players join the game in, and is fixed regardless of what team a player is on. To test this I started a match with two people and changed myself to team 2 at the lobby screen (the host, who joined first). When the game began, my player number was still 1, not 5, and the other person's player number was still 2, not 1. Therefore player numbers can't be used to determine what team a person picked.
Has anyone found a way to detect teams, or is it impossible? I spent a morning researching this last week, and it seems no one here has figured out a way to solve this in the past week either. Really frustrating!
Add each player to a global variable player group from team 1 (eg 3v3 add player 1, 2 and 3 to team 1). Make a second variable and repeat (eg again 3v3, add player 4, 5 and 6 to team 2). Have your trigger check if a given player belongs to the player group team 1 or team 2.
In warcraft 3, your slot at the lobby determined your player #, so it was a simple matter of checking what player # someone is like you describe.
In SC2 however, your player # appears to be determined by what order you join the game in, and is fixed regardless of what team you're on. To test this I started a match and changed to team 2 at the lobby screen. When the game began, my player number was still 1, not 5.
Has anyone found a way that absolutely works to detect teams? I spent a whole day looking into this, and it's been a week... if no one knows have to come to the conclusion it's impossible for now.
----
Sorry I kinda skipped this post. Didn't even see it.
How can anything be impossible when zifoon is looking into editor?
Variable - Attribute Value - Attribute (Choose what team setting you chose in attribute/variant) - Player (Whatever)
simple
Player Group - Add player 1 to PlayerTeams[0]
Player Group - Add all players in (Allies of player 1) to PlayerTeams[0]
Player Group - Add all players in (Enemies of player 1) to PlayerTeams[1]
(for 2 teams only)
simple
Player Group - Add player 1 to PlayerTeams[0]
Player Group - Add all players in (Allies of player 1) to PlayerTeams[0]
Player Group - Add all players in (Enemies of player 1) to PlayerTeams[1]
(for 2 teams only)
This puts players on teams, but then how can it be determined which team was the first team on the custom game lobby? I mentioned in a post above the teams have roles, and there are AI players on each team. The teams can't be arbitrarily chosen. I just need a way to check: was player X on the first or second team at the lobby screen.
Variable - Attribute Value - Attribute (Choose what team setting you chose in attribute/variant) - Player (Whatever)
Unfortunately, I tried this extensively last week. Checking every possible value returns no hits: Game Variants
----
Err.... Either you do not understand data types or maybe you are very tired or I'm missing something... Why are you checking if Player's value "Team X" == "Team X [1]"; They are never going to equal each other... ever... They are two different types... O______O One is a game option value and one is a team value. It's like comparing a player value with an unit value.
Maybe you are trying something different, something I don't know.
Okay I'll explain how comparison should work
<Condition> (Setting Team) value for player x == (Setting Team) value for player y
That way you are comparing what team they are in and if they are in the same team.
I'm not sure I'm understanding... with that function in the link, I selected the Value option for the right hand side. The only possible values that can be selected are what I used.
If I'm misunderstanding the use of this function, what exactly is the comparison operation to check if a player is on the first team at the lobby screen in a 6v6 map?
Not sure I'm following you. What exactly would be the comparison, to check if a player is on team 1 in a 6v6 map?
----
http://forums.sc2mapster.com/development/map-development/1430-game-attributes-game-variants/#p4
In there you checked through debug
(Team [2 Teams] value for player (Picked player)) == Team 1 [1]
The first part is the value of the team picked player is in
Seconds part after "==" is a game option "Team 1 [1]"
Team 1 != Team 1[1] If that makes any sense
They are different types. Though they share the same value operator called "Game Attributes"
I looked at a test map I made few days earlier... I realised I only made this (<Condition> (Setting Team) value for player x == (Setting Team) value for player y) work by having a computer player on each team. If the player was allied to that computer the teams were separated to 1 or 2 or 3.
I should find a proper way of dealing with this.
EDIT: Trying to find the team 1 value in custom scripts.
Ah! The function description is poorly worded, I assumed it meant the following:
AttributeA ValueA for Player X == (AttributeB ValueB)
(x,y) for player == (u,v)
In other words, a system with three known values (attributeA, attributeB, valueB) and one unknown (valueA). I was attempting to use the function to figure out what the valueA was for a player's attribute. I assumed they did the function in this manner because otherwise you'd need a dozen functions to check the value of attributes, one for each attribute.
Ah! The function description is poorly worded, I assumed it meant the following:
AttributeA ValueA for Player X == (AttributeB ValueB)
(x,y) for player == (u,v)
In other words, a system with three known values (attributeA, attributeB, valueB) and one unknown (valueA). I was attempting to use the function to figure out what the valueA was for a player's attribute. I assumed they did the function in this manner because otherwise you'd need a dozen functions to check the value of attributes, one for each attribute.
----
Yeah doesn't help that the type "game attributes" don't have a sub category like other types.
Strange... can't find any constants for team values. It must exist though... For now just put dummy computers on each teams.
I'll try that, though it does limit the total number of players somewhat.
Thank you. Previously I'd had my computer players as hostile, and didn't realize that by changing them to computer it would allow me to assign them teams - apparently hostile controllers can't be on teams.
I looked at a test map I made few days earlier... I realised I only made this (<Condition> (Setting Team) value for player x == (Setting Team) value for player y) work by having a computer player on each team. If the player was allied to that computer the teams were separated to 1 or 2 or 3.
If you still have this test map, it would help. I've been messing around with the Attribute Value function and assigning computer players to teams on the Variants window for another hour now without success.
I looked at a test map I made few days earlier... I realised I only made this (<Condition> (Setting Team) value for player x == (Setting Team) value for player y) work by having a computer player on each team. If the player was allied to that computer the teams were separated to 1 or 2 or 3.
If you still have this test map, it would help. I've been messing around with the Attribute Value function and assigning computer players to teams on the Variants window for another hour now without success.
----
Yeah adding computer is a bish... I'm sure I don't have the map anymore. It was for a test. I remember you have to set controller in variants as computer. Also the controllers as computer.
Also I think I put computers as last two players. Don't remember why.
Has anyone figured out a way to detect (with triggers) what team a player was on at a custom game lobby?
@Thalassicus:
Yes, search 'Player is Enemy' at one of the values of a condition.
@Eldrazor: Go
That works to tell if players are on opposite teams, but not what team they were on from the lobby screen when the game started. Team 1 is always the attacker in my map, and Team 2 is the defender. I just need to check which a player was on, but have been stumped on this for days.
Feel like I'm missing something here but;
Add each player to a global variable player group from team 1 (eg 3v3 add player 1, 2 and 3 to team 1).
Make a second variable and repeat (eg again 3v3, add player 4, 5 and 6 to team 2).
Have your trigger check if a given player belongs to the player group team 1 or team 2.
What you describe is like in warcraft 3, slot at the lobby determined player #, so it was a simple matter of checking player numbers.
In SC2 however, player # is determined by what order players join the game in, and is fixed regardless of what team a player is on. To test this I started a match with two people and changed myself to team 2 at the lobby screen (the host, who joined first). When the game began, my player number was still 1, not 5, and the other person's player number was still 2, not 1. Therefore player numbers can't be used to determine what team a person picked.
Has anyone found a way to detect teams, or is it impossible? I spent a morning researching this last week, and it seems no one here has figured out a way to solve this in the past week either. Really frustrating!
Quote from Thalassicus:
Quote from Eiviyn: Go
Feel like I'm missing something here but;
Add each player to a global variable player group from team 1 (eg 3v3 add player 1, 2 and 3 to team 1). Make a second variable and repeat (eg again 3v3, add player 4, 5 and 6 to team 2). Have your trigger check if a given player belongs to the player group team 1 or team 2.
In warcraft 3, your slot at the lobby determined your player #, so it was a simple matter of checking what player # someone is like you describe.
In SC2 however, your player # appears to be determined by what order you join the game in, and is fixed regardless of what team you're on. To test this I started a match and changed to team 2 at the lobby screen. When the game began, my player number was still 1, not 5.
Has anyone found a way that absolutely works to detect teams? I spent a whole day looking into this, and it's been a week... if no one knows have to come to the conclusion it's impossible for now.
----
Sorry I kinda skipped this post. Didn't even see it.
How can anything be impossible when zifoon is looking into editor?
Variable - Attribute Value - Attribute (Choose what team setting you chose in attribute/variant) - Player (Whatever)
I tested this last week; checking every possible value returns no hits: Game Variants
This puts players on teams, but then how can it be determined which team was the first team on the custom game lobby? I mentioned in a post above the teams have roles, and there are AI players on each team. The teams can't be arbitrarily chosen. I just need a way to check: was player X on the first or second team at the lobby screen.
Quote from Thalassicus:
Quote from zifoon: Go
Variable - Attribute Value - Attribute (Choose what team setting you chose in attribute/variant) - Player (Whatever)
Unfortunately, I tried this extensively last week. Checking every possible value returns no hits: Game Variants
----
Err.... Either you do not understand data types or maybe you are very tired or I'm missing something... Why are you checking if Player's value "Team X" == "Team X [1]"; They are never going to equal each other... ever... They are two different types... O______O One is a game option value and one is a team value. It's like comparing a player value with an unit value.
Maybe you are trying something different, something I don't know.
Okay I'll explain how comparison should work
<Condition> (Setting Team) value for player x == (Setting Team) value for player y
That way you are comparing what team they are in and if they are in the same team.
@zifoon: Go
I'm not sure I'm understanding... with that function in the link, I selected the Value option for the right hand side. The only possible values that can be selected are what I used.
If I'm misunderstanding the use of this function, what exactly is the comparison operation to check if a player is on the first team at the lobby screen in a 6v6 map?
@Thalassicus:
Quote from Thalassicus:
@zifoon: Go
Not sure I'm following you. What exactly would be the comparison, to check if a player is on team 1 in a 6v6 map?
----
http://forums.sc2mapster.com/development/map-development/1430-game-attributes-game-variants/#p4
In there you checked through debug
(Team [2 Teams] value for player (Picked player)) == Team 1 [1]
The first part is the value of the team picked player is in
Seconds part after "==" is a game option "Team 1 [1]"
Team 1 != Team 1[1] If that makes any sense
They are different types. Though they share the same value operator called "Game Attributes"
I looked at a test map I made few days earlier... I realised I only made this (<Condition> (Setting Team) value for player x == (Setting Team) value for player y) work by having a computer player on each team. If the player was allied to that computer the teams were separated to 1 or 2 or 3.
I should find a proper way of dealing with this.
EDIT: Trying to find the team 1 value in custom scripts.
@zifoon: Go
Ah! The function description is poorly worded, I assumed it meant the following:
AttributeA ValueA for Player X == (AttributeB ValueB)
(x,y) for player == (u,v)
In other words, a system with three known values (attributeA, attributeB, valueB) and one unknown (valueA). I was attempting to use the function to figure out what the valueA was for a player's attribute. I assumed they did the function in this manner because otherwise you'd need a dozen functions to check the value of attributes, one for each attribute.
Quote from Thalassicus:
@zifoon: Go
Ah! The function description is poorly worded, I assumed it meant the following:
AttributeA ValueA for Player X == (AttributeB ValueB)
(x,y) for player == (u,v)
In other words, a system with three known values (attributeA, attributeB, valueB) and one unknown (valueA). I was attempting to use the function to figure out what the valueA was for a player's attribute. I assumed they did the function in this manner because otherwise you'd need a dozen functions to check the value of attributes, one for each attribute.
----
Yeah doesn't help that the type "game attributes" don't have a sub category like other types.
Strange... can't find any constants for team values. It must exist though... For now just put dummy computers on each teams.
@zifoon: Go
I'll try that, though it does limit the total number of players somewhat.
Thank you. Previously I'd had my computer players as hostile, and didn't realize that by changing them to computer it would allow me to assign them teams - apparently hostile controllers can't be on teams.
@Thalassicus:
I tried getting the constant through debug but the debug categorises the team data as string. So it displays null. No luck on the constant. T___T
If you still have this test map, it would help. I've been messing around with the Attribute Value function and assigning computer players to teams on the Variants window for another hour now without success.
Quote from Thalassicus:
Quote from zifoon: Go
I looked at a test map I made few days earlier... I realised I only made this (<Condition> (Setting Team) value for player x == (Setting Team) value for player y) work by having a computer player on each team. If the player was allied to that computer the teams were separated to 1 or 2 or 3.
If you still have this test map, it would help. I've been messing around with the Attribute Value function and assigning computer players to teams on the Variants window for another hour now without success.
----
Yeah adding computer is a bish... I'm sure I don't have the map anymore. It was for a test. I remember you have to set controller in variants as computer. Also the controllers as computer.
Also I think I put computers as last two players. Don't remember why.
Anyway, here's one I just prepared in few minutes.
http://static.sc2mapster.com/content/files/431/695/critvarianttest.SC2Map
Just a thought - would this work?
(Assuming you have at least 1 unit added to the map for each player)
playerArray[1] = Owner of unit (The unit on the map that is owned by the person to be player one)
Then you can do what you want for teams:
Add playerArray[1] to player group (Team 1)...etc...
@Vophsix:
Nope. The player number is assigned by order in your players join. Also that doesn't answer the question "which team" the player is in.
So what does the function Owner of Unit return?
If player slot 1 red joined the game 3rd does it return 1 or 3?