Well, one way I can think of would be to make a trigger with a "when player leaves" event, have a couple of actions to set their resources to 0. But, I'm unsure of whether this will take place prior to the splitting of resources.
Another option may be to make a trigger with an "every x second of game time" event, and have it store the player's resources into variables, and then when a player leaves, to divide the amount of resources that player had when they left by the number of currently active players, and minus that off from the remaining players.
Aside from that, I didn't see a specific trigger to turn that sharing off, or a way to turn it off in any other portion of the editor, but I was just skimming so I may have missed it. Let me know if you figure out a way to do this, as it may be helpful.
Going to assume that that means changing their alliance will not work, either.
Maybe in initialization, turning off resource trading and spending, as well as shared control for all the players in the alliance? Also, a possibility may be to disable the default melee defeat options.
Not sure if this is possible; you could work around it by saving everyone's resources, and when a player leaves subtract 1/(players in his team)*his minerals/gas from all the players in his team.
I'm having the same problem. As I can see this is a widespread problem. Hope blizzard give us a way to control this.
@ mark8264:
Your solution could work. But my main problem is that after a player leaves the game, every resource given to the left player won't be added to its resources, but instead will keep splitting between its team mates. So I can't make my AI control this player as it will never get resources.
Anyone has found a workaround? Anyone knows if Blizzard is working to give us some function to change this behaviour?
PD: click on my signature and give me feedback on my map.
This is what you need to do. Create two integer arrays with a number of indexes equal to the total number of possible players in the game. One array for vespene one for minerals. you need to create a while loop with a counter and set each index in the array 1,2,3 and so on to their corresponding player vespene amount, player 1,2,3 and so on: set array(playernumb) = player playernumb(vespene). your going to want to update these arrays every few seconds or so or even every second depending on how your game works. When you update the arrays only update up to player count, so if you have 12 potential players, but only 5 players are in the game your player count will be 5 and it will only store the values for those 5 players. If you don't do this its probably fine, you may get a timeout error but i doubt it (you can get player count by at map int do pick every player in player group active players and modify variable playercount + 1). Now that your arrays are being updated you you need to write triggers for when the player leaves the game. So when player leaves game, you first need to set each array to: set array(triggering player) = 0 to set the leavers vesp/min to 0, then run a while loop with a counter with this line of code: set playernumb vespene = array(playernumb). Once the while loop runs through your done and the values are set to were they should be.
Lol first off onetwosc id like to thank you for your first person rpg tutorial on youtube, i used it when i was learning how to put a sky into the game. For your question, I haven't tried it, but it might not work. What this trigger does overall is player leaves, his resources are split amongst his allies, the leavers resource array value is set to zero, and then all of the players in the game's resource values are set to their corresponding array values, this all happens instantly (note the arrays aren't updated after the player leaves the game and gives out his resources, those previous values must be maintained for the trigger). If you updated the resource array values whenever a persons resources changed, which does happen when someone leaves: for example they leave the game, and you get 10 vespene from them, due to the fact that your resources changed, your vespene array value is automatically updated to include those resources from your ally. If this is what happens, then it might not work, but who knows maybe it will like i said i haven't tried it. I made this trigger for a game that has turn based income so i dont really have the problem of needing to constantly update the arrays. Also to add to what i said before using the pick every player and picked player functions could replace the do whiles and counters, i just typically don't use them, and i don't know if they would work for sure haven't tried it.
I would just keep track of the minerals and vespene and save them into variables every few seconds. Then when somebody leaves, take their mineral variable and divide it by the number of allies they have, then subtract that number of minerals from each ally.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Not sure if this is an option for you but you can always set players to be neutral with shared vision. It's nearly like allied and no ressources are shared.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Like when a player leaves, it splits the remaining resources between the remaining players. How do you turn this off?
@Zero0018: Go
Well, one way I can think of would be to make a trigger with a "when player leaves" event, have a couple of actions to set their resources to 0. But, I'm unsure of whether this will take place prior to the splitting of resources.
Another option may be to make a trigger with an "every x second of game time" event, and have it store the player's resources into variables, and then when a player leaves, to divide the amount of resources that player had when they left by the number of currently active players, and minus that off from the remaining players.
Aside from that, I didn't see a specific trigger to turn that sharing off, or a way to turn it off in any other portion of the editor, but I was just skimming so I may have missed it. Let me know if you figure out a way to do this, as it may be helpful.
Ya, I already tried doing a trigger that when the player leaves set the resources to 0, but it doesn't work.
There has to be some way to turn that aspect of the game off. I just don't know how :\
@Zero0018: Go
Going to assume that that means changing their alliance will not work, either.
Maybe in initialization, turning off resource trading and spending, as well as shared control for all the players in the alliance? Also, a possibility may be to disable the default melee defeat options.
@Feithless: Go
Ya all of those are already setup.
No one knows how to disable this? Come on sc2mapster!! need help!?
bumpage
Not sure if this is possible; you could work around it by saving everyone's resources, and when a player leaves subtract 1/(players in his team)*his minerals/gas from all the players in his team.
I'm having the same problem. As I can see this is a widespread problem. Hope blizzard give us a way to control this.
@ mark8264:
Your solution could work. But my main problem is that after a player leaves the game, every resource given to the left player won't be added to its resources, but instead will keep splitting between its team mates. So I can't make my AI control this player as it will never get resources.
Anyone has found a workaround? Anyone knows if Blizzard is working to give us some function to change this behaviour?
PD: click on my signature and give me feedback on my map.
@Zero0018: Go
This is what you need to do. Create two integer arrays with a number of indexes equal to the total number of possible players in the game. One array for vespene one for minerals. you need to create a while loop with a counter and set each index in the array 1,2,3 and so on to their corresponding player vespene amount, player 1,2,3 and so on: set array(playernumb) = player playernumb(vespene). your going to want to update these arrays every few seconds or so or even every second depending on how your game works. When you update the arrays only update up to player count, so if you have 12 potential players, but only 5 players are in the game your player count will be 5 and it will only store the values for those 5 players. If you don't do this its probably fine, you may get a timeout error but i doubt it (you can get player count by at map int do pick every player in player group active players and modify variable playercount + 1). Now that your arrays are being updated you you need to write triggers for when the player leaves the game. So when player leaves game, you first need to set each array to: set array(triggering player) = 0 to set the leavers vesp/min to 0, then run a while loop with a counter with this line of code: set playernumb vespene = array(playernumb). Once the while loop runs through your done and the values are set to were they should be.
@lemmy734: Go
You can always run a trigger with the event of when a players vespene changes (or minerals) and update the arrays then... right?
@OneTwoSC: Go
Lol first off onetwosc id like to thank you for your first person rpg tutorial on youtube, i used it when i was learning how to put a sky into the game. For your question, I haven't tried it, but it might not work. What this trigger does overall is player leaves, his resources are split amongst his allies, the leavers resource array value is set to zero, and then all of the players in the game's resource values are set to their corresponding array values, this all happens instantly (note the arrays aren't updated after the player leaves the game and gives out his resources, those previous values must be maintained for the trigger). If you updated the resource array values whenever a persons resources changed, which does happen when someone leaves: for example they leave the game, and you get 10 vespene from them, due to the fact that your resources changed, your vespene array value is automatically updated to include those resources from your ally. If this is what happens, then it might not work, but who knows maybe it will like i said i haven't tried it. I made this trigger for a game that has turn based income so i dont really have the problem of needing to constantly update the arrays. Also to add to what i said before using the pick every player and picked player functions could replace the do whiles and counters, i just typically don't use them, and i don't know if they would work for sure haven't tried it.
I'm thinking this might be a default action in a melee-based map. Has anyone seen if this happens in a campaign-based map?
I would just keep track of the minerals and vespene and save them into variables every few seconds. Then when somebody leaves, take their mineral variable and divide it by the number of allies they have, then subtract that number of minerals from each ally.
Not sure if this is an option for you but you can always set players to be neutral with shared vision. It's nearly like allied and no ressources are shared.