Essentially, the player has a reaver, and I wish to destroy it when it fires the first shot/has no remaining scarabs. I have tried several trigger conditions, such as "Command", "Bring", etc., but none seem to work. Most intriguing is the fact that BOTH of the following conditions
Bring("Current Player", "Protoss Scarab", "field", At least, 1);
Bring("Current Player", "Protoss Scarab", "field", At most, 0);
return "true" no matter what. (That means if they are put in the conditions of the SAME trigger, the trigger will still fire. wut)
How do I accomplish this? The player will have at most one reaver at any time and will only ever have one scarab.
EDIT> I figured out how to do it, but I am still not aware of the reason why those two conditions can be simultaneously true. Would anyone care to elucidate?
Post has been edited 1 time(s), last time on May 31 2010, 2:12 pm by Aristocrat.
None.
SDE, BWAPI owner, hacker.
I would've thought command would work.
What happens if you switch the order of the conditions?
It only returns true when a scarab is inside the reaver. So my guess is that a scarab still inside a reaver returns as a negative value with the bring condition and StarCraft doesn't handle the comparisons as expected.
None.
I would've thought command would work.
What happens if you switch the order of the conditions?
Still fires for some incomprehensible reason.
I suppose -1 is at most 0 and at least 1, but I don't see how you can bring -1 of a unit to a location...
None.
I had a similar problem recently, but I figured out how to get around it. I've found that if a unit is loaded in a transport, regardless of location levels, ANY value you place on "at most" and ANY amount of units of that type on the screen loaded in transports will return true.
However, when I used "exactly", it worked perfectly.
Try using Exactly 0 and see if it doesn't work for Scarabs as well.
None.
If my theory is correct then one reason it would return negative is for a special case like a scarab inside the reaver, because it's not visible but it's still there. It isn't detecting that -1 of a scarab is brought there, it's just returning a reserved value for the special case which is negative because in a normal case you can't bring a negative number of units to a location.
None.
Oops, sorry kwun, I didn't want to minusate your post. =P For some reason I never noticed before what those pluses and minuses were and decided to click one to see what it did, haha.
None.
I thought this was more commonly known than it apparently is. Gidoza is right, the problem here is that you are using "at most" instead of "exactly". Conditions using "exactly" and "at least" work the same way, but "at most" operates under its own set of rules, such as detecting unfinished buildings. You should never be using "at most 0" unless you're specifically trying to get some sort of special effect from it.
In this specific instance, the reason your conditions are both coming back true is because "at most" does not detect units that are within other units, such as units in a shuttle, scarabs in a reaver, etc.
That being the case, "at most" will always return a value of 0 when checking for scarabs. Use "exactly" and you can detect their quantity the way you are expecting it to work.
Post has been edited 2 time(s), last time on Oct 12 2010, 12:23 pm by DevliN. Reason: Mineral abuse.