Team and Player Setup

Status
Not open for further replies.
Level 2
Joined
Dec 1, 2010
Messages
14
Man, StarCraft 2 is stupid. I know it can't recognize player slot or team on it's own, so we have to trigger it to work. I did, following a post I had found. But my trigger is not working. If players are on opposite teams, they spawn in game as the same team (if not all positions are filled). I have a 3v3 game. Two teams. Three players per team. Can anyone please please help me write a trigger that actually works. I found some crazy gigantic library function junk somewhere, but it was beyond my capabilities at this point. I know all about variants and variables and anything having to do with triggering. Please, someone must have figured this out by now.
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
There is a function "Players on team", which returns a player group of all players, that are on a certain team (as set in lobby), that should work fine.

And if this doesn't work, there is a tutorial here (I wrote it), on how to find out player team using game attributes. However, since then this function was added and it shouldn't be necessary.
 
Level 2
Joined
Dec 1, 2010
Messages
14
Hey, thanks for the answer. I understand the Players on Team function, but I can't get it to work properly. Here is what I have in my initialization trigger.

Variable - Set NumberOfPlayers = (Number of players in (Active Players))
Variable - Set PlayerNumberInt[1] = (Player 1 from (Players on team 1))
Variable - Set PlayerNumberInt[2] = (Player 2 from (Players on team 1))
Variable - Set PlayerNumberInt[3] = (Player 3 from (Players on team 1))
Variable - Set PlayerNumberInt[4] = (Player 1 from (Players on team 2))
Variable - Set PlayerNumberInt[5] = (Player 2 from (Players on team 2))
Variable - Set PlayerNumberInt[6] = (Player 3 from (Players on team 2))
Player Group - Add player PlayerNumberInt[1] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[2] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[3] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[4] to TeamGroup[2]
Player Group - Add player PlayerNumberInt[5] to TeamGroup[2]
Player Group - Add player PlayerNumberInt[6] to TeamGroup[2]
UI - Hide game UI for TeamGroup[1]
UI - Show Menu Bar for TeamGroup[1]
UI - Show Tip Alert Panel for TeamGroup[1]
UI - Hide Resource Panel for TeamGroup[2]
Player - Make all players in TeamGroup[1] treat each other as Ally With Shared Vision
Player - Make all players in TeamGroup[2] treat each other as Ally With Shared Vision
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
Do you need PlayerNumberInt[x] anywhere else? If not, I would suggest
Player Group - Add (Players on team 1) to TeamGroup[1]
Player Group - Add (Players on team 2) to TeamGroup[2]
Instead of the 12 actions

Also, the fact that UI changes are different for each team is correct?

And finally, this should work, what exactly does it do wrong?
(Except maybe you could add Player - Make all players in (Active players) treat each other as Enemy before the two other alliance actions)
 
Level 2
Joined
Dec 1, 2010
Messages
14
Hey, thanks for responding.
I'm not sure why it doesn't work. I also just tried your method, and it didn't work either.
To test out team setup, I host the game, and my brother joins on his account on the other team.
So we have a 1v1 out of 6 possible players. My game variant I had set to 2 Teams, and had set each player to his or her respective team and index.
IE. Player 1 is Team 1 [1], Player 2 is Team 1 [2]. . . . Player 4 is Team 2 [1]. etc.
I also just tried changing it to custom teams, and had the attribute to then same setup. Neither works.
In my game there are already units created, one for each player. But when I start the game, my brother who is player 4, is automatically reset as player 2.
Maybe if I had a full house this would work, but I think it's messing up because he is just jumping to the next empty slot automatically.
Any ideas?
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
Well this isn't a trigger problem then, it's a problem with preset units, and it is easily solveable (although blizzard promised there will be an option for that in future patch, to make it even simpler).

You have to redistribute the units manually. You will need your Player Group - Add player PlayerNumberInt[x] to TeamGroup[x] actions.
Then, when you have these players set, create 6 unit groups, each with all units that given player has now ( this group will represent units that player on this slot SHOULD have ).
Then just redistribute the units ( Player (PlayerNumberInt[a]) will get UnitGroup[a] )
 
Level 2
Joined
Dec 1, 2010
Messages
14
Hey thanks for the help. Got it working.

Variable - Set PlayerNumberInt[1] = (Player 1 from (Players on team 1))
Variable - Set PlayerNumberInt[2] = (Player 2 from (Players on team 1))
Variable - Set PlayerNumberInt[3] = (Player 3 from (Players on team 1))
Variable - Set PlayerNumberInt[4] = (Player 1 from (Players on team 2))
Variable - Set PlayerNumberInt[5] = (Player 2 from (Players on team 2))
Variable - Set PlayerNumberInt[6] = (Player 3 from (Players on team 2))
Player Group - Add player PlayerNumberInt[1] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[2] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[3] to TeamGroup[1]
Player Group - Add player PlayerNumberInt[4] to TeamGroup[2]
Player Group - Add player PlayerNumberInt[5] to TeamGroup[2]
Player Group - Add player PlayerNumberInt[6] to TeamGroup[2]
Player - Make all players in TeamGroup[1] treat each other as Ally With Shared Vision
Player - Make all players in TeamGroup[2] treat each other as Ally With Shared Vision
Player Group - Pick each player in TeamGroup[1] and do (Actions)
Actions
Player - Make player (Picked player) and player PlayerNumberInt[4] treat each other as Enemy
Player - Make player (Picked player) and player PlayerNumberInt[5] treat each other as Enemy
Player - Make player (Picked player) and player PlayerNumberInt[6] treat each other as Enemy
 
Status
Not open for further replies.
Top