This is an annoying problem whose solution eludes me. I have tried a bunch of stuff in the editor and I have searched here but to no avail. Essentially, when a player leaves the game his minerals and vespene are split with other players on his team. The solution I found is to make people treat each other as neutral but this is quite hacky and far from optimal. I was hoping there is another way of preventing this resource split.
Basically, I store the amount of vespene and minerals owned by each player in variables. Then, everytime when the amount of minerals or vespene changes, I check if the player has left the game, and then I subtract the minerals and vespene that has been split between all the other players.
That approached worked great for minerals, thank you. However, it does not work for vespene. I use small amounts and the amounts need to be exact. Therefore, I have tried to instead negate vespene gain at all times except when given by game (using control for this). I ran into an infinite loop though;
I also tried moving the wait to right after the turn off trigger (or set variable to true) instead of before the turn on trigger (or set variable to false). No difference.
Why not just check if the change is positive? If you're subtracting the change whenever the gas changes, you're changing the gas, so yes, you'll have an infinite loop, and your gas would rapidly go back and forth between the pre-change and post-change amounts. Instead, use the condition that Triggering Player Property > 0, guaranteeing that subtractions will not cause the same trigger to occur.
This is an annoying problem whose solution eludes me. I have tried a bunch of stuff in the editor and I have searched here but to no avail. Essentially, when a player leaves the game his minerals and vespene are split with other players on his team. The solution I found is to make people treat each other as neutral but this is quite hacky and far from optimal. I was hoping there is another way of preventing this resource split.
Setting them on different teams with hostile relations?
Problem is chat. Forces people to use all chat and there is no way to make that the default option.
I solved this in my map:
Basically, I store the amount of vespene and minerals owned by each player in variables. Then, everytime when the amount of minerals or vespene changes, I check if the player has left the game, and then I subtract the minerals and vespene that has been split between all the other players.
That approached worked great for minerals, thank you. However, it does not work for vespene. I use small amounts and the amounts need to be exact. Therefore, I have tried to instead negate vespene gain at all times except when given by game (using control for this). I ran into an infinite loop though;
I also tried;
I also tried moving the wait to right after the turn off trigger (or set variable to true) instead of before the turn on trigger (or set variable to false). No difference.
Hmmm Kara, if all players are on seperate teams then there is no ally chat, should go to all chat automatically? Also moving this to triggers
I wish this happened :(. Technically they are on the same team I think, just treating each other as neutral alliance.
@Karawasa: Go
Hmmm, I swear this does it when your all enemies. if you actually set the alliances in triggers
edit. also come on msn quickly :)
Why not just check if the change is positive? If you're subtracting the change whenever the gas changes, you're changing the gas, so yes, you'll have an infinite loop, and your gas would rapidly go back and forth between the pre-change and post-change amounts. Instead, use the condition that Triggering Player Property > 0, guaranteeing that subtractions will not cause the same trigger to occur.
Solved. Please mark this thread as such for future reference. The most optimal method is;