I have a team error in my map. Is there a way to detect which team a player is in, from the default pre-setup teams?
I setup the Game Variants to have players 1-3 Team A and players 7-9 Team B, leaving players slots open should I ever want to go to 6v6.
TRIGGER - I this at start ally players 1-6 with Comp 13 and players 7-12 with Comp 14. This is all seems fine.
However when I started testing online, 1v1, the opponent doesn't seem to be detected as player 7, so he's in Team A with me as well, so we're spawning together lol :/
How can I get around this, i.e. detect which side each player is on and then ally accordingly with Comp 13/14.
Well ive already got my own code that sorts the players in to player groups based on teams, I do this my sorting out what players are allied to what players.
If they have a built in player group for say Team1 from lobby thats great to I might give it a looky.
No the first slot wont be player 1. I think the one who created/joined first is player 1. Depending on your need this could be a problem or not... :/ (this method wont tell if you are on the upper or lower team)
@SoulCarver, I didn't quite get what you're trying to do there? Could you explain please, thanks.
Lol i started that yesterday at work, was gonna finish it but forgot I had a date. So I never did get to finishing it. Have you checked to see if you can use the built in "team" player groups yet, the one that the other guy on here told you to try? If that doesnt work for you Ill help you further.
I have a team error in my map. Is there a way to detect which team a player is in, from the default pre-setup teams?
I setup the Game Variants to have players 1-3 Team A and players 7-9 Team B, leaving players slots open should I ever want to go to 6v6.
TRIGGER - I this at start ally players 1-6 with Comp 13 and players 7-12 with Comp 14. This is all seems fine.
However when I started testing online, 1v1, the opponent doesn't seem to be detected as player 7, so he's in Team A with me as well, so we're spawning together lol :/
How can I get around this, i.e. detect which side each player is on and then ally accordingly with Comp 13/14.
Thanks for any help, hope this makes sense.
@Fullachain: Go
You have to loop through the players in game and determine what team they are reeally on based on thier alliances.
Their player # has nothing to do with where they are in the lobby.
@SouLCarveRR: Go
there is now a function in the trigger editor that returns the lobby based player groups. (don't know the exact function name)
@Helral: Go
Well ive already got my own code that sorts the players in to player groups based on teams, I do this my sorting out what players are allied to what players.
If they have a built in player group for say Team1 from lobby thats great to I might give it a looky.
Just check alliances of players. If they are on same team on lobby, it means they will have alliance friendly ingame.
So do something like this:
Pick all players:
- If picked player has alliance friend to player 1 add player to team 1 (also remember to add player 1 to team 1)
- else add player to team2
Attachment!
@Qancakes: Go
If you try and use the built in fucntion you may wanna test it first by looping through all the players it shows belonging to a given team.
I believe that function has existed since beta, but didnt work.
Woa thanks for the replies.
Ok so just to be clear, even if I host and move to a different slot, the first slot is ALWAYS Player 1?
Add player 1 to the first Team, then check who's allied and who's enemy, allocating into teams accordingly and setting alliances?
No the first slot wont be player 1. I think the one who created/joined first is player 1. Depending on your need this could be a problem or not... :/ (this method wont tell if you are on the upper or lower team)
but atleast the lobby teams woul be the same...
@zenx1: Go
Hmmm, how can I determine who is in Slot 1 then?
I need that person in Variable - Team A, with all allies and all enemies in Variable - Team B.
Then the map is fine and good to go :)
@Fullachain: Go
You do not base any of this on player slots ....
Slot in lobby has nothing to do with the player number
Im about to be done at work ill finish writing this out later
That function was added in patch 1.0 if I'm correct.
@Helral: Go
I'll test the function above!
@SoulCarver, I didn't quite get what you're trying to do there? Could you explain please, thanks.
Lol i started that yesterday at work, was gonna finish it but forgot I had a date. So I never did get to finishing it. Have you checked to see if you can use the built in "team" player groups yet, the one that the other guy on here told you to try? If that doesnt work for you Ill help you further.