Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Detecting if a reaver has no scarabs?
Detecting if a reaver has no scarabs?
May 31 2010, 2:04 pm
By: Aristocrat  

May 31 2010, 2:04 pm Aristocrat Post #1



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

Quote
Bring("Current Player", "Protoss Scarab", "field", At least, 1);
Quote
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.

May 31 2010, 2:54 pm Heinermann Post #2

memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes

I would've thought command would work.
What happens if you switch the order of the conditions?




May 31 2010, 3:06 pm Cinolt Post #3



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.

May 31 2010, 3:55 pm Aristocrat Post #4



Quote from Heinermann
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.

May 31 2010, 4:26 pm Gidoza Post #5



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.

May 31 2010, 4:42 pm Cinolt Post #6



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.

May 31 2010, 4:48 pm Gidoza Post #7



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.

May 31 2010, 9:40 pm Azrael Post #8



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.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:27 am]
Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
[2026-7-17. : 2:58 pm]
Ultraviolet -- Symmetry
Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
fr fr
[2026-7-17. : 2:39 am]
Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
[2026-7-16. : 6:28 am]
NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
[2026-7-16. : 6:26 am]
NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
[2026-7-16. : 6:25 am]
NudeRaider -- Symmetry
Symmetry shouted: Ohhh imagine a SC map that could delete itself
not the map, the editor
[2026-7-16. : 2:28 am]
Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
[2026-7-16. : 2:28 am]
Symmetry -- Ohhh imagine a SC map that could delete itself
[2026-7-15. : 8:51 pm]
NudeRaider -- Symmetry
Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
[2026-7-15. : 4:10 am]
Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
Please log in to shout.


Members Online: O)FaRTy1billion[MM]