My map has 2 teams each of 3 players, and my idea was to give have each team a set number of supplies, say 150. This supply would divide to the number of players that are in-game, thus 150/3 = 50 supply for each player. I was going to have the map automatically re-allocated supply when a player leaves. This way, if there are leavers on either team, the remaining players on that team will have their supply increased so that the match will remain balanced.
The problem is, I couldn't possibly find any way of setting current supply value from triggers. The only supply related trigger is the one for setting MAX supply limit, which is not the actual supply value, it's the max value cap. Apparently the supply can only be manually set from the unit stat. Or, you could create a behavior that modifies the unit stat to increase/decrease supply provided by that unit and then use triggers to apply/remove that behavior.
My map doesn't use structures, players only have units, so I ended up creating a dummy supply depot unit with an invisible model, invulnerable and no collision/selection. Having this allows me to set whatever supply I want without actually displaying any structures for players to see in game. However, since there's no way to directly modify the supply from triggers, my only option would be to create a behavior and stack it multiple times, which is pretty retarded.
I want to be able to set the allocated team supply in a variable and then have the script divide it by the number of players. If I use a behavior, it means that I'll have to set the behavior to +1 supply, and then stack it on top of my dummy supply depot many times till I get my number right, it's such an ugly solution...
Any ideas? Am I missing something? Maybe there's a way to set the supply level from triggers and I am not aware of it (I did ask on the mIRC channel and did a lot of searches too and couldn't find a solution)?
Ok so as I was re-reading my post I just had an idea...
I will modify my dummy supply depot to give 200 supply or so, and then just lower/raise the max supply limit to the value I want using triggers. This should achieve my goal elegantly. Dunno why I didn't think of this before, instead of trying to control the actual amount, I set the amount really high, and then control the cap.
I just used a quick workaround, instead of adding supply to make the max 210,220, etc, I made the units themselves cost less supply, but this doesnt really solve the distribution of supplys once a player leaves
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
My map has 2 teams each of 3 players, and my idea was to give have each team a set number of supplies, say 150. This supply would divide to the number of players that are in-game, thus 150/3 = 50 supply for each player. I was going to have the map automatically re-allocated supply when a player leaves. This way, if there are leavers on either team, the remaining players on that team will have their supply increased so that the match will remain balanced.
The problem is, I couldn't possibly find any way of setting current supply value from triggers. The only supply related trigger is the one for setting MAX supply limit, which is not the actual supply value, it's the max value cap. Apparently the supply can only be manually set from the unit stat. Or, you could create a behavior that modifies the unit stat to increase/decrease supply provided by that unit and then use triggers to apply/remove that behavior.
My map doesn't use structures, players only have units, so I ended up creating a dummy supply depot unit with an invisible model, invulnerable and no collision/selection. Having this allows me to set whatever supply I want without actually displaying any structures for players to see in game. However, since there's no way to directly modify the supply from triggers, my only option would be to create a behavior and stack it multiple times, which is pretty retarded.
I want to be able to set the allocated team supply in a variable and then have the script divide it by the number of players. If I use a behavior, it means that I'll have to set the behavior to +1 supply, and then stack it on top of my dummy supply depot many times till I get my number right, it's such an ugly solution...
Any ideas? Am I missing something? Maybe there's a way to set the supply level from triggers and I am not aware of it (I did ask on the mIRC channel and did a lot of searches too and couldn't find a solution)?
Ok so as I was re-reading my post I just had an idea...
I will modify my dummy supply depot to give 200 supply or so, and then just lower/raise the max supply limit to the value I want using triggers. This should achieve my goal elegantly. Dunno why I didn't think of this before, instead of trying to control the actual amount, I set the amount really high, and then control the cap.
Thanks a lot man! I couldn't figure out how to add supply to my games for a while.
I just used a quick workaround, instead of adding supply to make the max 210,220, etc, I made the units themselves cost less supply, but this doesnt really solve the distribution of supplys once a player leaves