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

SDE, BWAPI owner, hacker.

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.
[10:53 pm]
Butch -- prob some weird character on a string somewhere or something dumb like that
[09:50 pm]
Ultraviolet -- It's weird indeed, not really sure what is so special about Spellsword that causes it to react differently on Remastered, usually EUDs are the cause of things like that
[05:35 pm]
Zoan -- I haven't played in like 2 years so maybe something changed I don't know about
[05:35 pm]
Zoan -- No-Name-Needed-II
No-Name-Needed-II shouted: Zoan No idea if anything changed.. I've made several maps that push TMOANC to the limit and they are still working.. 3 causes of it I've narrowed down are -Too many islands which some terrain on certain tilesets can create micro islands on cliff edges with basic isometric.. -Too many changes in elevation from high to mid to low ground.. -And too many tiles from certain doodads that block tank fire..
Any clue as to why a map which would previously work fine on past patches would now suddenly not work on the current remastered patch?
[05:34 pm]
Zoan -- I'll try Butch's suggestion of running in 32-bit, maybe that will fix it?
[05:34 pm]
Zoan -- Oh_Man
Oh_Man shouted: Did martiss' link not work?
It crashes as it does when you use EUD's incorrectly - like it closes starcraft and has the error window pop up with a ticket to send to Blizzard. I know it's not EUDs though since obviously spellsword doesn't use any, so IDK what it is.
[03:19 pm]
No-Name-Needed-II -- Zoan No idea if anything changed.. I've made several maps that push TMOANC to the limit and they are still working.. 3 causes of it I've narrowed down are -Too many islands which some terrain on certain tilesets can create micro islands on cliff edges with basic isometric.. -Too many changes in elevation from high to mid to low ground.. -And too many tiles from certain doodads that block tank fire..
[2022-5-23. : 12:21 am]
Oh_Man -- Wat precisely is wrong with spellsword now?
[2022-5-23. : 12:19 am]
Oh_Man -- Did martiss' link not work?
[2022-5-22. : 8:11 pm]
Zoan -- Also my KOTK maps all have the nooks and crannies issue when they didn't before; what changed?
Please log in to shout.


Members Online: Roy