Well let me try to decipher that. Owner of trigger unit, returns the owner of that unit.
Let's say that owner is player 1.
However if slot 1 red joined the game 3rd, red or whatever the colour is now player 3.
Going back to owner of unit function, the owner of unit is still player 1. Despite player in slot 1 is in the "1"st slot, s/he is considered to be player 3 at all times. Therefore player in slot 1 does not have any ownership over that unit.
Okay that sounds right but (sorry if i'm moving you back in your discussion) - at what point is the game feeding you bad information - as in when is 3 returned instead of 1 (or when is setting something to player 1 slot actually referring to the player who joined first instead of player 3)?
Quote from Vophsix:
Okay that sounds right but (sorry if i'm moving you back in your discussion) - at what point is the game feeding you bad information - as in when is 3 returned instead of 1 (or when is setting something to player 1 slot actually referring to the player who joined first instead of player 3)?
----
Well the person in OP is concerned that there is no way of checking in which team is player 1 from game variants (lobby). Currently, you can only check which team a player is in with another player. There is no constant for say "team 1". I tried to use debug to display what the team 1 constant is but game attribute has no viewing information, also debug window sees the data link as "string" though it clearly isn't. That's the bad information I was talking about.
Team 1
Player 1 - entered 3rd
Player 2 - entered 1st
Team2
Player 3 - entered 4th
Player 4 - entered 2nd
In game:
A unit placed in the editor as player 1 (the owner of this unit is player 1) etc
So then you can happily say player 1 is in team 1 no?
Here's how it works:
Team 1
Player 3 - entered 3rd
Player 1 - entered 1st
Team2
Player 4 - entered 4th
Player 2 - entered 2nd
This is different from in warcraft 3. Player number is determined by the order of joining! Player 1 will always be the first person who joins, regardless of which team they are on. My brother and I assume if player 2 leaves the next person who joins will be player 2, though we haven't tested that (doesn't relate to this topic). This is why player numbers can't be used to check teams.
You can use double backslash \\ to do line breaks.
If you have a unit placed for player 1 and check its owner, it will return "1". However, player 1 can move to either team 1 or 2, so I'm not sure how that could be used to check teams.
Is there a good reason for this or are blizzard just playing games (no pun intended) with us? Because there are effectively just randomizing player setup as soon as a game is started...
Problem with that is I want the teams to have specific roles/functions, and people can decide which team they want to be on at the lobby screen. Could do it all ingame though, if the lobby was entirely FFA... though it's easier, more intuitive, and takes less time if team selection can be done at the lobby screen.
The game attribute has 2 values - player 1 and player 2 (their defaults set to player 1 and player 2 respectively) and I also locked them. Not sure if this helps or not but thought I would post it anyway ^^
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.
Is there a way to prevent hosts from moving or removing these computer players? I noticed a host did that in one of the matches I joined, which would most likely break this system.
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.
Is there a way to prevent hosts from moving or removing these computer players? I noticed a host did that in one of the matches I joined, which would most likely break this system.
----
I thought about this, there's a boolean for "Player is in Player Group" and a player group for "Allies of Player x" which can be either allies or enemies
Through this and an iterative statement, you could construct player groups kinda like this (for 3 teams):
This is just pseudocode but the triggers should be pretty much just like this I think
Let's say we do the above algorithm for player 1, 5, 8
What if you want the first person joined want to be in the same team as fifth one joined? Or 8th for that matter.
Why not just group allies in the same team instead? That's not the issue here.
He knows how to divide teams from the lobby alliance. He doesn't know which player is in which "team". Example, in Dota, player 2- 6 were in sentinel and spawned in sentinel starting area while player 8-12 were in scourge and spawned in scourge starting area. How can he check if the player is in sentinal (team 1) or scourge (team 2)? Using your example if you used fixed value like check condition by player 1 then if player 1 is in scourge (in lobby) then the whole team becomes the scourge not sentinel. Obviously in DotA this would not matter since team position is not important, however what if you are playing a cat and mouse game? Where a cat team is drastically different to a mouse team and their position is different?
Right now the best solution is locking computer players into teams and checking if the player is ally with them to check for teams. Well until someone find the value of "team 1" "team 2" in custom scripts.
However, I understand why this is not an exact solution. My solution essentially remakes the lobby teams as player groups with the correct players, but the groups are in a random-ish order (or rather, an order that is impossible to nail down without those direct Team references, since players themselves may arrange themselves in any way in the lobby)
However, I understand why this is not an exact solution. My solution essentially remakes the lobby teams as player groups with the correct players, but the groups are in a random-ish order (or rather, an order that is impossible to nail down without those direct Team references, since players themselves may arrange themselves in any way in the lobby)
Right?
----
Yep. The OP was asking which team the player is in, not who is allied with. I'm pretty sure Thalassicus knows how to check alliance +_+
Okay, but for example, I posted a real trigger (see attached screenshot ^ on this page) that I plan to use for my 4-team CTF map, where it doesn't matter which team is in which corner, just that the players stay in their teams from the lobby. This trigger assigns them to user groups which you CAN reference as teams. This is more than checking alliance...
But again, only suited if you were to start all teams on equal footing. I'm sure there's a way to do exactly what you're requesting, but you might consider having all the teams start in the exact same manner in a staging area, where they then choose attacker or defender.
@Vophsix:
Well let me try to decipher that. Owner of trigger unit, returns the owner of that unit.
Let's say that owner is player 1.
However if slot 1 red joined the game 3rd, red or whatever the colour is now player 3.
Going back to owner of unit function, the owner of unit is still player 1. Despite player in slot 1 is in the "1"st slot, s/he is considered to be player 3 at all times. Therefore player in slot 1 does not have any ownership over that unit.
Okay that sounds right but (sorry if i'm moving you back in your discussion) - at what point is the game feeding you bad information - as in when is 3 returned instead of 1 (or when is setting something to player 1 slot actually referring to the player who joined first instead of player 3)?
Quote from Vophsix:
Okay that sounds right but (sorry if i'm moving you back in your discussion) - at what point is the game feeding you bad information - as in when is 3 returned instead of 1 (or when is setting something to player 1 slot actually referring to the player who joined first instead of player 3)?
----
Well the person in OP is concerned that there is no way of checking in which team is player 1 from game variants (lobby). Currently, you can only check which team a player is in with another player. There is no constant for say "team 1". I tried to use debug to display what the team 1 constant is but game attribute has no viewing information, also debug window sees the data link as "string" though it clearly isn't. That's the bad information I was talking about.
Wow now i'm confused :D
An exmaple of the lobby:
Team 1
Player 1 - entered 3rd
Player 2 - entered 1st
Team2
Player 3 - entered 4th
Player 4 - entered 2nd
In game:
A unit placed in the editor as player 1 (the owner of this unit is player 1) etc
So then you can happily say player 1 is in team 1 no?
Here's how it works:
Team 1
Player 3 - entered 3rd
Player 1 - entered 1st
Team2
Player 4 - entered 4th
Player 2 - entered 2nd
This is different from in warcraft 3. Player number is determined by the order of joining! Player 1 will always be the first person who joins, regardless of which team they are on. My brother and I assume if player 2 leaves the next person who joins will be player 2, though we haven't tested that (doesn't relate to this topic). This is why player numbers can't be used to check teams.
Okay - I'll have another go ^^
Team 1
Slot 1:Player 3 - entered 3rd
Slot 2:Player 1 - entered 1st
Team2
Slot 3:Player 4 - entered 4th
Slot 4:Player 2 - entered 2nd
And in the editor there is a unit placed as player 1 - and you are saying that the function Owner of Unit returns 1 (player slot 2)?
@Vophsix: Go
You can use double backslash
\\
to do line breaks.If you have a unit placed for player 1 and check its owner, it will return "1". However, player 1 can move to either team 1 or 2, so I'm not sure how that could be used to check teams.
Is there a good reason for this or are blizzard just playing games (no pun intended) with us? Because there are effectively just randomizing player setup as soon as a game is started...
You could however not have any teams in the lobby and just create your own team selection in-game..
@Vophsix: Go
Problem with that is I want the teams to have specific roles/functions, and people can decide which team they want to be on at the lobby screen. Could do it all ingame though, if the lobby was entirely FFA... though it's easier, more intuitive, and takes less time if team selection can be done at the lobby screen.
Oh well I definitely up for seeing the lobby teams working, I can't test anything unfortunately due to not being in the beta.
Here is what the raw code does for attribute variables:
string gv_player1;
string gv_player2;
void InitGlobals () {
gv_player1 = "0001";
gv_player2 = "0002";
}
The game attribute has 2 values - player 1 and player 2 (their defaults set to player 1 and player 2 respectively) and I also locked them. Not sure if this helps or not but thought I would post it anyway ^^
Another attempt:
gv_player = GameAttributePlayerValue("1", 1);
Where gv_player is of type Arttribute Value and the first parameter is the ID of the game attribute, second is the player in question
This function returns a string value - possibly the value against the lobby player slot as defined in the game attribute
Is there a way to prevent hosts from moving or removing these computer players? I noticed a host did that in one of the matches I joined, which would most likely break this system.
Quote from Thalassicus:
Quote from zifoon: Go
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
Is there a way to prevent hosts from moving or removing these computer players? I noticed a host did that in one of the matches I joined, which would most likely break this system.
----
You mean the "Locked" option in Game Variants?
I thought about this, there's a boolean for "Player is in Player Group" and a player group for "Allies of Player x" which can be either allies or enemies
Through this and an iterative statement, you could construct player groups kinda like this (for 3 teams):
This is just pseudocode but the triggers should be pretty much just like this I think
Edit: cleaned up a bit
@kozm0naut:
Let's say we do the above algorithm for player 1, 5, 8
What if you want the first person joined want to be in the same team as fifth one joined? Or 8th for that matter.
Why not just group allies in the same team instead? That's not the issue here.
He knows how to divide teams from the lobby alliance. He doesn't know which player is in which "team". Example, in Dota, player 2- 6 were in sentinel and spawned in sentinel starting area while player 8-12 were in scourge and spawned in scourge starting area. How can he check if the player is in sentinal (team 1) or scourge (team 2)? Using your example if you used fixed value like check condition by player 1 then if player 1 is in scourge (in lobby) then the whole team becomes the scourge not sentinel. Obviously in DotA this would not matter since team position is not important, however what if you are playing a cat and mouse game? Where a cat team is drastically different to a mouse team and their position is different?
Right now the best solution is locking computer players into teams and checking if the player is ally with them to check for teams. Well until someone find the value of "team 1" "team 2" in custom scripts.
Ah, I'd heard locking controller could cause corrupt header file errors. Thanks, that appeared to work ok.
@zifoon: Go
You can check what player group a player is in.
However, I understand why this is not an exact solution. My solution essentially remakes the lobby teams as player groups with the correct players, but the groups are in a random-ish order (or rather, an order that is impossible to nail down without those direct Team references, since players themselves may arrange themselves in any way in the lobby)
Right?
Quote from kozm0naut:
@zifoon: Go
You can check what player group a player is in.
However, I understand why this is not an exact solution. My solution essentially remakes the lobby teams as player groups with the correct players, but the groups are in a random-ish order (or rather, an order that is impossible to nail down without those direct Team references, since players themselves may arrange themselves in any way in the lobby)
Right?
----
Yep. The OP was asking which team the player is in, not who is allied with. I'm pretty sure Thalassicus knows how to check alliance +_+
@zifoon: Go
Okay, but for example, I posted a real trigger (see attached screenshot ^ on this page) that I plan to use for my 4-team CTF map, where it doesn't matter which team is in which corner, just that the players stay in their teams from the lobby. This trigger assigns them to user groups which you CAN reference as teams. This is more than checking alliance...
But again, only suited if you were to start all teams on equal footing. I'm sure there's a way to do exactly what you're requesting, but you might consider having all the teams start in the exact same manner in a staging area, where they then choose attacker or defender.
Not the best solution there, but just a thought.