I've created 1 hero unit(protoss) for player1, created 1 hero unit(a terran) for player 2 and created 1 hero unit(a zerg) for player 3.
The problem is that, that the 1. player is always with the protoss, the 2nd with terran and 3rd with zerg. If I move myself from team 1 to team 3 it won't change anything, when game loads I'm still the protoss...
Of course changing race is pointless also, because there are no races, only 3 player.
Player numbers = order you joined the lobby in (In case of someone leaving the lobby, the lowest available number is given to the next person to join). If you want to use lobby slots in triggers, use the "Player on Team" function
I've tried a lot of option, but I always ran into troubles.
1.: This didn't seem to do anything:
2. So I tried this one:
So the 2. try is quite good, because if I change to another 'Lobby' then I'll be playing with other 'team', but there are some issues:
Firstly if only 1 player plays, there are some error messages in-game.
Then if 2 player plays, 2 spawns from each unit (e.g. 2 zerg hero and 2 protoss hero)
If 3 player plays then 3 zerg hero, 3 protoss hero and 3 terran hero spawns, and only 1 of each should spawn.
The other problem is that I don't want to create the heros from triggers, but this was the only way to get it working :/
Now let's forget all the above and get back to the basic scenario:
What happens:
I put 1 protoss hero for player 1 onto the map, 1 terran hero for player 2 and 1 zerg hero for player 3.
example:
Player 1 creates lobby, player 2 and player 3 joins, but it doesn't matter if they change team or not, because nothing will happen, because as You said:"Player numbers = order you joined the lobby"
So What I want:
I put 1 protoss hero for player 1 onto the map, 1 terran hero for player 2 and 1 zerg hero for player 3.
Example:
Player 1 creates lobby, player 2 and 3 joins. Player 1 changes team with player 2, so player 1 will play with the terran hero and player 1 with the protoss hero.
Well, this happens with my "2nd try", with the mentioned problems, but I don't want to create the heroes in trigger, I want them to be already placed on the map (because of further triggers, e.g. wave attacks goes to player 1 hero... game over for heroes...)
So is it possible what I want, is it hard to do?(requires a lot of modification to my "2nd try"?)
Thanks in advance for Your answers!
Edit: This is an FFA map(1v1v1). (But I guess You already knew that.)
He already answered your question with exactly what you needed to know. You have to detect the team that the player was on; there is no effective way to check through slots. Again regardless of what team you put the first joining player, they will always be player 1 no matter what including if they swap teams. Your errors are simply the result of not including the multiple possible results of different number of player (you need to factor this in). As for the teams run a loop that checks what team the player is on and adds them to your organized variable.
This seemed way too complicated to me, but I solved it differently.
When gamestarts, you have 1 unit and you can choose from 3 points.
E.g.: You choose point 2(terran hero), your unit dies and your chosen hero appears on the map at the specified point.
Edit: Now I have to rewrite the attack waves, because they attacked unit(zealot king at x,y coordinates on map), but now I can't set to attack unit, because it is created by triggers. It would so easy if I could set the waves to attack player 1. :-)
Its not complicated at all and is something you will need to know else you will have issues in mapping period; it probably just sounds like gibberish because you unfamaliar with how triggers work but i'll explain and it'll solve all your problems. Create a global array/variable to help organize what players are on what team to help you organize. In your map init trigger or similar create two variables, one each for team and player. Then in run two for each integer loops one inside the other and set each integer to one of your variables. All thats left is an if/then with the conditions "player is on team" = true and the then to set the global variable from before with the array position based on the team local variable. In the conditions set the player integer to the player variable and team integer to the team variable.
From there depending on how you setup your hero you can create them, change the owner of that unit, or see the waves to attack the player based on the team global variable.
I'm working on a custom map.
I've created 1 hero unit(protoss) for player1, created 1 hero unit(a terran) for player 2 and created 1 hero unit(a zerg) for player 3.
The problem is that, that the 1. player is always with the protoss, the 2nd with terran and 3rd with zerg. If I move myself from team 1 to team 3 it won't change anything, when game loads I'm still the protoss... Of course changing race is pointless also, because there are no races, only 3 player.
Is it possible to change it somehow?
Player numbers = order you joined the lobby in (In case of someone leaving the lobby, the lowest available number is given to the next person to join). If you want to use lobby slots in triggers, use the "Player on Team" function
@TheAlmaity: Go
I've tried a lot of option, but I always ran into troubles.
1.: This didn't seem to do anything:
2. So I tried this one:
So the 2. try is quite good, because if I change to another 'Lobby' then I'll be playing with other 'team', but there are some issues:
Firstly if only 1 player plays, there are some error messages in-game. Then if 2 player plays, 2 spawns from each unit (e.g. 2 zerg hero and 2 protoss hero) If 3 player plays then 3 zerg hero, 3 protoss hero and 3 terran hero spawns, and only 1 of each should spawn.
The other problem is that I don't want to create the heros from triggers, but this was the only way to get it working :/
Now let's forget all the above and get back to the basic scenario:
What happens:
I put 1 protoss hero for player 1 onto the map, 1 terran hero for player 2 and 1 zerg hero for player 3.
example: Player 1 creates lobby, player 2 and player 3 joins, but it doesn't matter if they change team or not, because nothing will happen, because as You said:"Player numbers = order you joined the lobby"
So What I want:
I put 1 protoss hero for player 1 onto the map, 1 terran hero for player 2 and 1 zerg hero for player 3.
Example: Player 1 creates lobby, player 2 and 3 joins. Player 1 changes team with player 2, so player 1 will play with the terran hero and player 1 with the protoss hero.
Well, this happens with my "2nd try", with the mentioned problems, but I don't want to create the heroes in trigger, I want them to be already placed on the map (because of further triggers, e.g. wave attacks goes to player 1 hero... game over for heroes...)
So is it possible what I want, is it hard to do?(requires a lot of modification to my "2nd try"?)
Thanks in advance for Your answers!
Edit: This is an FFA map(1v1v1). (But I guess You already knew that.)
@Phoenixyza: Go
He already answered your question with exactly what you needed to know. You have to detect the team that the player was on; there is no effective way to check through slots. Again regardless of what team you put the first joining player, they will always be player 1 no matter what including if they swap teams. Your errors are simply the result of not including the multiple possible results of different number of player (you need to factor this in). As for the teams run a loop that checks what team the player is on and adds them to your organized variable.
@hobbidude: Go
This seemed way too complicated to me, but I solved it differently. When gamestarts, you have 1 unit and you can choose from 3 points. E.g.: You choose point 2(terran hero), your unit dies and your chosen hero appears on the map at the specified point.
Edit: Now I have to rewrite the attack waves, because they attacked unit(zealot king at x,y coordinates on map), but now I can't set to attack unit, because it is created by triggers. It would so easy if I could set the waves to attack player 1. :-)
Its not complicated at all and is something you will need to know else you will have issues in mapping period; it probably just sounds like gibberish because you unfamaliar with how triggers work but i'll explain and it'll solve all your problems. Create a global array/variable to help organize what players are on what team to help you organize. In your map init trigger or similar create two variables, one each for team and player. Then in run two for each integer loops one inside the other and set each integer to one of your variables. All thats left is an if/then with the conditions "player is on team" = true and the then to set the global variable from before with the array position based on the team local variable. In the conditions set the player integer to the player variable and team integer to the team variable.
From there depending on how you setup your hero you can create them, change the owner of that unit, or see the waves to attack the player based on the team global variable.