Hey, guys. I have a problem. I made a map, which has 2 teams, controlled by players, 1 team controlled by computer. 2 player teams have different units. 1st team has Jim Raynor and some marines. 2nd team has Loki spaceship)
What I want is to make it so that I could choose which team to play. For example, I join the game and there are 2 clans: if I join 1st I control Jim Raynor, if I join 2nd I control Loki.
What i have now is 2 clans but if I join either of these clans I always control Jim Raynor. If I want to play for Loki I need another player which hosts the map.
Well, i guess this code would make 2 groups: 1st with 1,3,5 players; 2nd with 2,4,6 players. But Jim Raynor would still belong to player 1 and Loki would belong to player 2. What I want is ability to change the player I play before my game starts just by changing teams in the lobby.
I know u can change race boxes somehow( dont know how, but i saw it in Lotr map) but I wonder if i can change players by changing teams.
Sure. Just attach the actor to a certain player. You won't have to change the previous code I showed you. You will just have to add another one, like so:
If
Player(PickedPlayer)=Player(PickedInteger) 1
Then
Unit-Create 1 Jim Raynor for (PickedPLayer) at Spawn Point 1 facing 270.0 degrees (No Options)
Better yet, you don't even have to use an "If Then" action. Just make the action:
Unit-Create 1 Jim Raynor for (PickedPLayer) at Spawn Point 1 facing 270.0 degrees (No Options)
Create this in a Map Initialization event. This basically means that for whatever player was picked, it will spawn a certain unit that you choose for that player, at a spawn point that you choose. Picked Player is obviously their player position in the lobby. You will just have to know which position in the game lobby spawns which player.
I suppose you could also make a trigger that lets them choose the hero they want to play. Kind of like a vote screen.
@Caxius: Go
I guess you still dont understand my problem) When I host my map I automatically become player 1, so with this code u suggested i would always get Jim Raynor. Changing teams in the lobby doesnt affect my player status) The only way i can become player 2 is when someone else hosts this game and i join him.
I know there are a lot of ways to choose units in game using triggers and maybe thats the right way to do it but i am just curious if I can somehow change my player status in the lobby so that i get control of all units i created in editor for player 1,2,3 etc
How about this. Forget the lobby. And make one in-game with dialogs :D. Let the player choose his hero. And when a player has chosen a hero then just disable the select button for that particular hero.
I said already that I know there are a lot of methods to do this in-game. In this thread I want to know if it is possible in the lobby. If it is impossible and u are 100% sure about it then say it and thread is closed)
btw i think in-game menu where u choose ur character is best way to do this, but i am just curious about the lobby
Hey, guys. I have a problem. I made a map, which has 2 teams, controlled by players, 1 team controlled by computer. 2 player teams have different units. 1st team has Jim Raynor and some marines. 2nd team has Loki spaceship) What I want is to make it so that I could choose which team to play. For example, I join the game and there are 2 clans: if I join 1st I control Jim Raynor, if I join 2nd I control Loki. What i have now is 2 clans but if I join either of these clans I always control Jim Raynor. If I want to play for Loki I need another player which hosts the map.
@tibnew:
I'm not sure, but I believe you have to create an "if then" action...probably something like this
If
Player(Picked Player)=Player(Picked Integer) 1, 3, 5
Then
Add player(picked player) to PLayer Group 1
Player group 1 would control Jim Raynor.
If
Player(Picked Player)=PLayer(Picked Integer) 2, 4, 6
Then
Add Player(Picked Player) to Player Group 2
And of course, player group 2 controls Loki.
There's probably an easier way to do this, but that's how I think it would go.
@Caxius: Go
Well, i guess this code would make 2 groups: 1st with 1,3,5 players; 2nd with 2,4,6 players. But Jim Raynor would still belong to player 1 and Loki would belong to player 2. What I want is ability to change the player I play before my game starts just by changing teams in the lobby.
I know u can change race boxes somehow( dont know how, but i saw it in Lotr map) but I wonder if i can change players by changing teams.
@tibnew:
Sure. Just attach the actor to a certain player. You won't have to change the previous code I showed you. You will just have to add another one, like so:
If
Player(PickedPlayer)=Player(PickedInteger) 1
Then
Unit-Create 1 Jim Raynor for (PickedPLayer) at Spawn Point 1 facing 270.0 degrees (No Options)
Better yet, you don't even have to use an "If Then" action. Just make the action:
Unit-Create 1 Jim Raynor for (PickedPLayer) at Spawn Point 1 facing 270.0 degrees (No Options)
Create this in a Map Initialization event. This basically means that for whatever player was picked, it will spawn a certain unit that you choose for that player, at a spawn point that you choose. Picked Player is obviously their player position in the lobby. You will just have to know which position in the game lobby spawns which player.
I suppose you could also make a trigger that lets them choose the hero they want to play. Kind of like a vote screen.
@Caxius: Go I guess you still dont understand my problem) When I host my map I automatically become player 1, so with this code u suggested i would always get Jim Raynor. Changing teams in the lobby doesnt affect my player status) The only way i can become player 2 is when someone else hosts this game and i join him.
I know there are a lot of ways to choose units in game using triggers and maybe thats the right way to do it but i am just curious if I can somehow change my player status in the lobby so that i get control of all units i created in editor for player 1,2,3 etc
Sounds complicated. How about creating button and when button is pressed it checks the player who pressed it and set alliance with other players?
How about this. Forget the lobby. And make one in-game with dialogs :D. Let the player choose his hero. And when a player has chosen a hero then just disable the select button for that particular hero.
@DarlD: Go
I said already that I know there are a lot of methods to do this in-game. In this thread I want to know if it is possible in the lobby. If it is impossible and u are 100% sure about it then say it and thread is closed)
btw i think in-game menu where u choose ur character is best way to do this, but i am just curious about the lobby