GetDeepestCreeperCell

Started by Clean0nion, April 15, 2014, 05:34:49 PM

Previous topic - Next topic

Clean0nion

No page on the wiki for GetDeepestCreeperCell. Does anyone know the arguments and notation for this?
Thank you!

Grayzzur

This is intended to sort of show you how to go about figuring that out on your own, while waiting for a response from Virgil or someone else who actually knows.

Experimental discovery of undocumented commands:

On a map with stuff relevant to the task at hand (in this case, probably an emitter so there's some creeper), put a CRPL core with something like this:


once
ShowTraceLog
ClearTraceLog

GetAllUnitsInRange
TraceStack
endonce



I show this one first, as it requires arguments. If you run it, the trace window will say something like:
WARNING: Taking item from an empty stack: GETALLUNITSINRANGE at line 11
It repeats that message 4 times. GetAllUnitsInRange requires 4 arguments. There's a starting point.

If you do the same thing with GetDeepestCreeperCell, it does not complain about any arguments at all, so it does not require any. After running it, TraceStack reveals that there are now 2 numbers on the stack (in my case, 20 and 21, approximately the cell where I had the most creeper). So, I'd guess it's pushing the X/Y values of the deepest cell on the whole map w/o requiring any arguments.


"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

knucracker

Yep, that is exactly what it does.  If there is no creeper on the map I believe -1 and -1 are pushed to the stack.

Clean0nion

Thank you! And thanks Grayzzur for that technique!

driesemol

The wiki page says that this can also be used for mortar-like aiming, but since this only gives the position of the deepest creeper in the whole map, how can you use this to get the deepest creeper cell in range?

warren

That is a good point. I would say the wiki is wrong. I do know that for simulating blasters you use the much more complicated GetNearestGroundEnemy. For mortars I suspect there is no alternative but to do a double loop containing getCreeper and a range check.

driesemol

as i said i'm not experienced yet... can you give me an example of how to do it exactly?