I can't believe, it's impossible. It seems so simple. There must be some tricky ways. I can see a couple of ways, but they are a bit complicated comparebly with a simple function. I can, for example, remove the unit, create him again, and fill his magazines again, except the units I was going to remove. Plus, simultaneously save and restore unit's stats. Too much work for the simple operation... So, still i hope someone knows, how to do it easier.
Yes that is the answer. If you would like to know why you cannot set it to a negative number, I will explain. The number of interceptors is controlled by this number, obviously. It is not a command. When this number gets bigger, an interceptor is created immediately. If the number was able to go into the negatives, then interceptors would just disappear out of thing air. This isn't a problem when they are in the hangar, but it is while they are flying around.
What you have done is give the magazine a suggestion to remove an interceptor from the magazine. The interceptor will get itself to a point where it can be removed, and then deleted.
Some of this might be off slightly, as I haven't done anything with hangars in a while, but this is the general idea of what is happening.
If the number was able to go into the negatives, then interceptors would just
disappear out of thing air. This isn't a problem when they are in the
hangar, but it is while they are flying around.
I still don't see any reason, why didn't blizzard describe the UnitMagazineArm() function to accept negative values. Magaizines are always control their units, no matter where they are, in the sky or in a hangar, because when some magazine units die, the magazine ammo amount reduces. So, there is no problem just to remove some units after receiveing a "remove some units" command. It's my map, I want to decide, can interceptors just disappear in the air or they can not. And I can remove flying interceptors, by picking them when they fly, and there is no problem about. The only problem is [1, N] restriction of the function argument.
You have to think of it from a coding perspective. That function is a raw data modifier, and has no effect on the unit itself. Blizzard would have to write an entire method describing what to do with the interceptor and how to remove it when this value becomes negative, which is tedious. If you want the unit to disappear, you can do exactly what you did. There are a lot of cases like this. Making the method's parameters "no negative" is much easier than having to write an entire method to handle the negative number.
Making the method's parameters "no negative" is much easier than having to write an entire
method to handle the negative number.
It's true. And it aquits them if they would want to create the editor with minimum efforts. But it seems like they would like to create a perfect editor. And seems like there is no principle restrictions about handling a negative number of ammo modifier value. It's just a question of 10 minutes of code writing. It feels more right when things like this are symmetric, and feels a little incorrect when you can't do opposite thing. So, I understand, why didn't they created the remove thing, but I don't agree with this decision :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
UnitMagazineArm function doesn't accept negative quantity.
But I need to set magazine units quantity to zero sometimes. Are there any ways to do it?
guys?
I can't believe, it's impossible. It seems so simple. There must be some tricky ways. I can see a couple of ways, but they are a bit complicated comparebly with a simple function. I can, for example, remove the unit, create him again, and fill his magazines again, except the units I was going to remove. Plus, simultaneously save and restore unit's stats. Too much work for the simple operation... So, still i hope someone knows, how to do it easier.
oh yeah, just found a solution
I simply pick all hidden units in a small radius around the magazine holder, and remove those of them I want to remove from the magazine
@Zolden: Go
Yes that is the answer. If you would like to know why you cannot set it to a negative number, I will explain. The number of interceptors is controlled by this number, obviously. It is not a command. When this number gets bigger, an interceptor is created immediately. If the number was able to go into the negatives, then interceptors would just disappear out of thing air. This isn't a problem when they are in the hangar, but it is while they are flying around.
What you have done is give the magazine a suggestion to remove an interceptor from the magazine. The interceptor will get itself to a point where it can be removed, and then deleted.
Some of this might be off slightly, as I haven't done anything with hangars in a while, but this is the general idea of what is happening.
Great to be back and part of the community again!
I still don't see any reason, why didn't blizzard describe the UnitMagazineArm() function to accept negative values. Magaizines are always control their units, no matter where they are, in the sky or in a hangar, because when some magazine units die, the magazine ammo amount reduces. So, there is no problem just to remove some units after receiveing a "remove some units" command. It's my map, I want to decide, can interceptors just disappear in the air or they can not. And I can remove flying interceptors, by picking them when they fly, and there is no problem about. The only problem is [1, N] restriction of the function argument.
@Zolden:
You have to think of it from a coding perspective. That function is a raw data modifier, and has no effect on the unit itself. Blizzard would have to write an entire method describing what to do with the interceptor and how to remove it when this value becomes negative, which is tedious. If you want the unit to disappear, you can do exactly what you did. There are a lot of cases like this. Making the method's parameters "no negative" is much easier than having to write an entire method to handle the negative number.
Great to be back and part of the community again!
It's true. And it aquits them if they would want to create the editor with minimum efforts. But it seems like they would like to create a perfect editor. And seems like there is no principle restrictions about handling a negative number of ammo modifier value. It's just a question of 10 minutes of code writing. It feels more right when things like this are symmetric, and feels a little incorrect when you can't do opposite thing. So, I understand, why didn't they created the remove thing, but I don't agree with this decision :)