I've searched solutions to this around again and again, and it's a pain in the ass. I hope I can get a direct answer to this and I stop bashing my head on the keyboard xD.
This is what I have:
8 player map, 2 teams of 4 each. First team is protoss, second zerg. All players have buildings and units already placed in-game.
My problem:
The lobby, as you know, is a terrible mess. If a player enters and changes team, his player number doesn't change. I fixed this by locking slots, but that's awful, and still, if they leave they break the balance.
What I'm trying to do:
Make the goddamn players match in-map players; or at least, match teams. I can't release the map with this serious handicap. I've seen any kind of solutions around the net, from having color move your slot to generating everything in-game, but I'm still not sure about that.
Then when referencing players just use "player on team" to get the right one, or use an integer array.
Wait, does that actually work? something like, say, add all placed units to unused players, and then move them? Would be fine for my map (8 players) but wouldn't it be a mess in case I place more players?
Well, it's something, will try it later. I believed that wouldn't work in any way xD.
I had a week of exams so I didn't test it. I'm doing some other stuff and I'll try this later (I need to try this on Battle.net so I'll add some more upgrades to make people interested on giving it the try :P).
The only problem I may see on TheAlmaity's code is that it could pick an already picked player, giving someone 2 players and leaving someone else without any unit.
Will check your tutorial too, Oneiros. Seems more complicated, but it's only a matter of understanding it.
I managed to solve this. I'll post the code later from the computer I have the file in, but it's something like this:
Detect team of each player and save it (inside an array is better, since you can loop)
Make an array for each team and loop across active players comparing the detected team and saving their player number inside the new team array
You should initialize the entire new team array to an allied computer
Loop across the new team array and put all players inside a player group, to then call for a "make player group treat themselves as ally with vision" (this is mostly to ally the computer player with the players)
Save each player's units inside a group
Change the units' ownership using the new team array
Was pretty easy when I realized you could detect lobby team and do a for for a group of players :).
I've searched solutions to this around again and again, and it's a pain in the ass. I hope I can get a direct answer to this and I stop bashing my head on the keyboard xD.
This is what I have:
My problem:
What I'm trying to do:
Please, help.
@Lonami: Go
There is a trigger function that can handle that problem. I´m not at my desktop pc, but I will answer asap. It´s very simple.
I saw some around, but they didn't seem to work. I could make people choose their player ingame, but that sucks and I prefer lobby-direct answer :S.
Why don't you just use a trigger than on map start changes the ownership of the preplaced units to "Player X on team Y"?
like
Then when referencing players just use "player on team" to get the right one, or use an integer array.
Wait, does that actually work? something like, say, add all placed units to unused players, and then move them? Would be fine for my map (8 players) but wouldn't it be a mess in case I place more players?
Well, it's something, will try it later. I believed that wouldn't work in any way xD.
@Lonami: Go
Hey, I have quite the same problems... Did it work?
@St1ps: Go
I wrote a tutorial on how to setup teams like they are ordered in the lobby, maybe it can help a bit:
http://forums.sc2mapster.com/resources/tutorials/22435-setting-up-lobby-player-ingame-player-trigger/
I had a week of exams so I didn't test it. I'm doing some other stuff and I'll try this later (I need to try this on Battle.net so I'll add some more upgrades to make people interested on giving it the try :P).
The only problem I may see on TheAlmaity's code is that it could pick an already picked player, giving someone 2 players and leaving someone else without any unit.
Will check your tutorial too, Oneiros. Seems more complicated, but it's only a matter of understanding it.
I managed to solve this. I'll post the code later from the computer I have the file in, but it's something like this:
Was pretty easy when I realized you could detect lobby team and do a for for a group of players :).
How could you detect the lobby teams? Can`t wait to see the code =)
I decided to write a tutorial for it (since it's so different from the existing tutorials)
http://forums.sc2mapster.com/resources/tutorials/22803-beginners-guide-solving-the-lobby-problems/
I hope it's of help, I spent a load of time writing it xDDD.