I am trying to get around the lobby =/= player number issue.
So what I was going to do, is as follows.
Team1
Events
Game - Map initialization
Local Variables
Conditions
Actions
Player Group - Pick each player in (Players on team 1) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to TeamPlayers1
Else
Player - Make all players in TeamPlayers1 treat each other as Ally With Shared Vision
Player Group - Pick each player in TeamPlayers1 and do (Actions)
Actions
Variable - Set Players[(Picked player)] = (Picked player)
Variable - Set SpawnLocations[(Picked player)] = Spawn#
NOTE:: So this gets the allies correct. Along with assigning an integer to each player that can be referenced by functions that need numbers.
NOTE:: The variable SpawnLocations is an array of start locations. Where Spawn# is a specific Start Location.
Now then, what I cannot figure out how to involves the last line. What I need is that each time the loop runs, for it so pick a different Spawn#, that way each player in the group gets a unique starting location, (which is what they are). Also, they need to be consecutive numbers beginning from 1. (example, 1,2,3,4)
If anyone could help me out that would be awesome.
@PBobbert: Go
before the first loop you have run a pick each integer loop from 1 to (number of start locations)
then set your spawn location to spawn(picked integer),
I hope thats what you wanted, and I think it should work, good luck.
Ok, so I have made some modifications, following what I think you were saying to do.
Instead of typing it all out, i have attached screen shots of the triggers, so they keep their proper formatting.
The team assigning works fine, the issue is with the points.
NOTES::
SpawnZones- A global variable point array. It has a point assigned to each number 1-8 in its array. (Spawn1,Spawn2...Spawn8)
SelectorZones- A global variable point array. It has a point assigned to each number 1-8 in its array. (Selector1,Selector2...Selector8)
Team1- A global variable playergroup array.
SpawnLocations- A global variable point array.
SelectorLocations- A global variable point array.
CreateQuantity- A global variable integer array.
The other half of these are in the Team1, which is exactly like Team1, so I didnt add it.
/NOTES::
Look at the Team1 attachment first.
So, from my understanding of how this trigger works, is that it first assigns all the SpawnZones and SelectorZones. Then it takes all the active user controlled players on team one (based on teams in lobby) and adds them into a playergroup Team1. I think this is working, as I have tested it with friends, and the team chats worked properly.
Now then, the part that doesnt work. I have an integer loop set up to run 4 times. Each time it runs, it picks a player from Team1 and sets a SpawnLocation and a SelectorLocation. This way all the players on team 1 have points that will group them together in the game.
However, this doesnt work. What I am using to test this is shown in the SpawnSelectorInitial attachment.
I have this trigger set to run 1 second into the game, so the Team1 trigger runs before this one, as some things need to be set up first. When this trigger executes, it sets all the CreateQuanitity array integers to 1. Then, for every active user controlled player in the game, it spawns 1 zealot at the SelectorLocation of each player. However, no zealot is spawned, and I have no Idea why.
If anyone can help, that would be awesome.I have the feeling that I am using/interpreting the loop statements incorrectly.
Ummmm... May i ask why you are setting everyone as allies and assigining their start locations under "Else"? The actions in that section are only run if your condition returns false... Which unless you have AIs or empty slots on your team (not sure about the second), will never be the case, so the actions wont be run.
Make those actions run AFTER the If then else. Actually, make them run after the entire "Pick each player" loop - there's no reason to repeat those actions for each player since you're not using the "picked player" function in them, and repeating the actions multiple times doesn't change anything.
Sorry if theres a logical reason why you've got the loops inside each other and all those actions in the "Else" part which escapes me.
Actualy no, i didnt notice the else statement. Come to think of it, that very well be my issue. I have never used the else command (didn't mean to here either).
Alright, so I have the trigger working, or so it appears to do so. However, whenever I launch a the map, I get an error.
I have attached the trigger, along with the error.
The funny thing, is that everything seems to work just fine, and I dont know what the error means.
Conditions.
If I have both Team1 and Team2, the error shows up but says Team2, and the Team1 error doesnt show up.'
If I have only Team 1, the error show up with Team 1
Instead of using the trigger event "map initialization"
use
Event - Time elapsed 1 second.
certain actions are not permissible durring the map initialization due to the fact that these are done prior to the game really starting ( or thats my understanding of it)
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Have tested it alone or with 7 other players? I can image the function (Player (picked integer) from Team1) would end with an error when (picked integer) is 4 and the group only has one player. (Same of course for team 2)
at your last loop you've got pick each int from 1 through 4. why not use something like this:
Set PlayerCounter = 0;
pick each player in player group (Players on Team 1) and do actions
Actions
Modify Variable PlayerCounter: + 1
Set (SpawnLocations[picked player]) = SpawnZones[PlayerCounter]
Set (SpectorLocations[picked player]) = SectorZones[PlayerCounter]
The playerspots in Team 1 who aren't taken are skipped with this method.
Although the first player might not always be spot 1 in the lobby. (Don't know if there is a get location in playergroup orso)
But anyway the error would be caused by you trying to retrieve an unexisting player (-1) and using that value in an array.
The function he uses (Player (picked integer) from Team1) is exactly what you talked about - it returns Xth player from player group. The only problem here is that the loop should go from 1 to (Number of players in team 1), instead of always 4.
@Helral: Go
"The playerspots in Team 1 who aren't taken are skipped with this method. Although the first player might not always be spot 1 in the lobby. (Don't know if there is a get location in playergroup orso)"
Actualy I solved that issue already. Because Blizzard was retarded and didnt make player numbers associated with lobby spot, I had to go around it, which took a while to figure out. The command (Pick (picked integer) from (Team1) will return player w,x,y,z independently of what player number they have. The setup is dynamic, so I can associate any player with any point (an unlimited number of points).
@M0rt1mer: Go
I think you are correct. I have gone through and replaced all my loops with this, but I must have forgotten to change this one. I will see if it solves it.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am trying to get around the lobby =/= player number issue.
So what I was going to do, is as follows.
Team1
Events
Game - Map initialization
Local Variables
Conditions
Actions
Player Group - Pick each player in (Players on team 1) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == User
Then
Player Group - Add player (Picked player) to TeamPlayers1
Else
Player - Make all players in TeamPlayers1 treat each other as Ally With Shared Vision
Player Group - Pick each player in TeamPlayers1 and do (Actions)
Actions
Variable - Set Players[(Picked player)] = (Picked player)
Variable - Set SpawnLocations[(Picked player)] = Spawn#
NOTE:: So this gets the allies correct. Along with assigning an integer to each player that can be referenced by functions that need numbers.
NOTE:: The variable SpawnLocations is an array of start locations. Where Spawn# is a specific Start Location.
Now then, what I cannot figure out how to involves the last line. What I need is that each time the loop runs, for it so pick a different Spawn#, that way each player in the group gets a unique starting location, (which is what they are). Also, they need to be consecutive numbers beginning from 1. (example, 1,2,3,4)
If anyone could help me out that would be awesome.
@PBobbert: Go before the first loop you have run a pick each integer loop from 1 to (number of start locations) then set your spawn location to spawn(picked integer),
I hope thats what you wanted, and I think it should work, good luck.
Ok, so I have made some modifications, following what I think you were saying to do.
Instead of typing it all out, i have attached screen shots of the triggers, so they keep their proper formatting.
The team assigning works fine, the issue is with the points.
NOTES::
SpawnZones- A global variable point array. It has a point assigned to each number 1-8 in its array. (Spawn1,Spawn2...Spawn8)
SelectorZones- A global variable point array. It has a point assigned to each number 1-8 in its array. (Selector1,Selector2...Selector8)
Team1- A global variable playergroup array.
SpawnLocations- A global variable point array.
SelectorLocations- A global variable point array.
CreateQuantity- A global variable integer array.
The other half of these are in the Team1, which is exactly like Team1, so I didnt add it.
/NOTES::
Look at the Team1 attachment first.
So, from my understanding of how this trigger works, is that it first assigns all the SpawnZones and SelectorZones. Then it takes all the active user controlled players on team one (based on teams in lobby) and adds them into a playergroup Team1. I think this is working, as I have tested it with friends, and the team chats worked properly.
Now then, the part that doesnt work. I have an integer loop set up to run 4 times. Each time it runs, it picks a player from Team1 and sets a SpawnLocation and a SelectorLocation. This way all the players on team 1 have points that will group them together in the game.
However, this doesnt work. What I am using to test this is shown in the SpawnSelectorInitial attachment.
I have this trigger set to run 1 second into the game, so the Team1 trigger runs before this one, as some things need to be set up first. When this trigger executes, it sets all the CreateQuanitity array integers to 1. Then, for every active user controlled player in the game, it spawns 1 zealot at the SelectorLocation of each player. However, no zealot is spawned, and I have no Idea why.
If anyone can help, that would be awesome.I have the feeling that I am using/interpreting the loop statements incorrectly.
I think I found one issue, I was using the '"or each integer" along with "pick each integer" which are imcompatable, So i changes it up a little.
The new versions are attached.
Any help would be awesome.
Anyone?
Ummmm... May i ask why you are setting everyone as allies and assigining their start locations under "Else"? The actions in that section are only run if your condition returns false... Which unless you have AIs or empty slots on your team (not sure about the second), will never be the case, so the actions wont be run.
Make those actions run AFTER the If then else. Actually, make them run after the entire "Pick each player" loop - there's no reason to repeat those actions for each player since you're not using the "picked player" function in them, and repeating the actions multiple times doesn't change anything.
Sorry if theres a logical reason why you've got the loops inside each other and all those actions in the "Else" part which escapes me.
@TheAlmaity: Go
Actualy no, i didnt notice the else statement. Come to think of it, that very well be my issue. I have never used the else command (didn't mean to here either).
NM
looks like you may have gotten it
Alright, so I have the trigger working, or so it appears to do so. However, whenever I launch a the map, I get an error.
I have attached the trigger, along with the error.
The funny thing, is that everything seems to work just fine, and I dont know what the error means.
Conditions. If I have both Team1 and Team2, the error shows up but says Team2, and the Team1 error doesnt show up.' If I have only Team 1, the error show up with Team 1
Any thoughts?
bumpidy
@PBobbert: Go
Instead of using the trigger event "map initialization"
use
Event - Time elapsed 1 second.
certain actions are not permissible durring the map initialization due to the fact that these are done prior to the game really starting ( or thats my understanding of it)
@SouLCarveRR: Go
hmm, that doesnt seem to have any effect.
Have tested it alone or with 7 other players? I can image the function (Player (picked integer) from Team1) would end with an error when (picked integer) is 4 and the group only has one player. (Same of course for team 2)
at your last loop you've got pick each int from 1 through 4. why not use something like this:
Set PlayerCounter = 0;
pick each player in player group (Players on Team 1) and do actions
Actions
Modify Variable PlayerCounter: + 1
Set (SpawnLocations[picked player]) = SpawnZones[PlayerCounter]
Set (SpectorLocations[picked player]) = SectorZones[PlayerCounter]
The playerspots in Team 1 who aren't taken are skipped with this method. Although the first player might not always be spot 1 in the lobby. (Don't know if there is a get location in playergroup orso)
But anyway the error would be caused by you trying to retrieve an unexisting player (-1) and using that value in an array.
The function he uses (Player (picked integer) from Team1) is exactly what you talked about - it returns Xth player from player group. The only problem here is that the loop should go from 1 to (Number of players in team 1), instead of always 4.
@Helral: Go "The playerspots in Team 1 who aren't taken are skipped with this method. Although the first player might not always be spot 1 in the lobby. (Don't know if there is a get location in playergroup orso)"
Actualy I solved that issue already. Because Blizzard was retarded and didnt make player numbers associated with lobby spot, I had to go around it, which took a while to figure out. The command (Pick (picked integer) from (Team1) will return player w,x,y,z independently of what player number they have. The setup is dynamic, so I can associate any player with any point (an unlimited number of points).
@M0rt1mer: Go I think you are correct. I have gone through and replaced all my loops with this, but I must have forgotten to change this one. I will see if it solves it.