Hi all, I've been messing with lobby slots for awhile now, and judging by a lot of posts on SC2Mapster still, the tutorials that are already available seem to be too complex for some of the newer players to grasp still - so I thought I would give it a go.
A note: This is set up as a 4 player FFA. If you go into the MAP menu and click on GAME VARIANTS you can set up the teams however you want. I will be addressing teams in later edits of this tutorial, but for now we're starting with a simple FFA.
To start off, I have 3 triggers and 2 global variables in this test map. I'll explain them as we go.
I have a global variable called globalPlayerInLobbySlot and it's an array of integers set to hold 4 values, because there are 4 total players. As you can see, this trigger is assigning the players in each slot (1 through 4) to their respective variable in that array. So later, when I want to call upon the player in slot 3 for example, all I need to do is use globalPlayerInLobbySlot[3].
Next, I have another array of Points. There are 4 points that I placed on the map, each one is placed where I want players to start the game. So The idea here is that whoever is in the first lobby slot when the game starts, should start at point 1 on the map. Then the players in the lobby slots 2, 3 and 4 will be starting at points 2, 3 and 4 as well. So in order to be able to call upon a specific point through variables, I created the array globalNormalPoints.
Alright, so now we have all of the players assigned to variables (according to the lobby slot they were in before the game started) and we also have our 4 points saved to variables in order to now match to the players. This trigger creates a Command Center for each player that's playing (to avoid making one for a player that isn't in the game) by going through each globalPlayerInLobbySlot[] (1, 2, 3 and 4) and creating it at globalNormalPoint[] that matches whichever lobby slot they were in.
So now that we have all of our triggers set up, lets see how it works in action!
When I publish this map, and create it in sc2, I am in the lobby by myself. Because that's pretty boring, I add 3 more A.I.'s to help me test this. I just hit the Add A.I. button three times, and it adds them all in the order that you see below. Notice the order of colors. The computer in slot 2 is Purple, 3 is Teal and 4 is Blue.
When I start the game, look at the order of the Command Centers. The colors are in the exact same order.
When I hold my mouse of the Blue Command Center, it tells me that they are player 2. Which doesn't make sense at first because they were the last A.I. to be added in the lobby. We'll talk about this later.
When I end the game and look at the scores at the end, sure enough we see that computer 1 is in fact Blue. despite being placed in the lobby last. Another point of interest is that his team is listed as 4 - which was the lobby slot he was in. This is the reason why lobby setups can be confusing. When loading players into the lobby, SC2 spaces out the players across the teams as evenly as possible. It's not too important right now, and we'll cover it in another edit of this tutorial later.
Okay so we're in the thick of things now. Lets see what happens when I start the game again, but this time, after I add the 3 A.I.'s to the lobby, I switch my slot position with one of the A.I.'s.
Sure enough, it put me on the second point because I was occupying the second lobby slot. I am hovering over Teal to show that he's labeled as Player 3. As said before, we'll cover that at a later date.
So there you have it. It's fairly straight forward, and this is pretty much as basic as the triggers can get for an EASY way to handle Players in respect to their Lobby Slot Locations.
I'll be editing this later for different types of team setups as well as the problems that occur when you try to use Start Locations instead of Points.
Hi all, I've been messing with lobby slots for awhile now, and judging by a lot of posts on SC2Mapster still, the tutorials that are already available seem to be too complex for some of the newer players to grasp still - so I thought I would give it a go.
A note: This is set up as a 4 player FFA. If you go into the MAP menu and click on GAME VARIANTS you can set up the teams however you want. I will be addressing teams in later edits of this tutorial, but for now we're starting with a simple FFA.
To start off, I have 3 triggers and 2 global variables in this test map. I'll explain them as we go.
I have a global variable called globalPlayerInLobbySlot and it's an array of integers set to hold 4 values, because there are 4 total players. As you can see, this trigger is assigning the players in each slot (1 through 4) to their respective variable in that array. So later, when I want to call upon the player in slot 3 for example, all I need to do is use globalPlayerInLobbySlot[3].
Next, I have another array of Points. There are 4 points that I placed on the map, each one is placed where I want players to start the game. So The idea here is that whoever is in the first lobby slot when the game starts, should start at point 1 on the map. Then the players in the lobby slots 2, 3 and 4 will be starting at points 2, 3 and 4 as well. So in order to be able to call upon a specific point through variables, I created the array globalNormalPoints.
Alright, so now we have all of the players assigned to variables (according to the lobby slot they were in before the game started) and we also have our 4 points saved to variables in order to now match to the players. This trigger creates a Command Center for each player that's playing (to avoid making one for a player that isn't in the game) by going through each globalPlayerInLobbySlot[] (1, 2, 3 and 4) and creating it at globalNormalPoint[] that matches whichever lobby slot they were in.
So now that we have all of our triggers set up, lets see how it works in action!
When I publish this map, and create it in sc2, I am in the lobby by myself. Because that's pretty boring, I add 3 more A.I.'s to help me test this. I just hit the Add A.I. button three times, and it adds them all in the order that you see below. Notice the order of colors. The computer in slot 2 is Purple, 3 is Teal and 4 is Blue.
When I start the game, look at the order of the Command Centers. The colors are in the exact same order.
When I hold my mouse of the Blue Command Center, it tells me that they are player 2. Which doesn't make sense at first because they were the last A.I. to be added in the lobby. We'll talk about this later.
When I end the game and look at the scores at the end, sure enough we see that computer 1 is in fact Blue. despite being placed in the lobby last. Another point of interest is that his team is listed as 4 - which was the lobby slot he was in. This is the reason why lobby setups can be confusing. When loading players into the lobby, SC2 spaces out the players across the teams as evenly as possible. It's not too important right now, and we'll cover it in another edit of this tutorial later.
Okay so we're in the thick of things now. Lets see what happens when I start the game again, but this time, after I add the 3 A.I.'s to the lobby, I switch my slot position with one of the A.I.'s.
Sure enough, it put me on the second point because I was occupying the second lobby slot. I am hovering over Teal to show that he's labeled as Player 3. As said before, we'll cover that at a later date.
So there you have it. It's fairly straight forward, and this is pretty much as basic as the triggers can get for an EASY way to handle Players in respect to their Lobby Slot Locations.
I'll be editing this later for different types of team setups as well as the problems that occur when you try to use Start Locations instead of Points.