Greetings!
I am close to fininshing my first map, but my skills in CRPL are still very poor, so I want to ask your help.
I'd like to create a core that can detect nearby runners and will execute further commands upon detection. Something similar to the IsCreeperInRange command.
I have already searched this forum but could not find anything useful and I assume that there is no built-in command for that. Do you have any suggestions how to implement this? Is there a way to identify unique runners instead of the runner nests? Or are the runners hard-coded?
Thanks!
p.s. I just registered today and this is my first post on the CW forum ever, even though I am a huge fan of CW since 2009.
Runners count as units. You can use GetEnemyUnitsInRange to see them then filter using GetUnitType. As units, you can track them individually by memorising their unit ID.
Edit: if they don't show up in GetEnemyUnitsInRange, they will with GetAllUnitsInRange.
Here is a quick code. May contain bugs:
CurrentCoords 8 FALSE GetAllUnitsInRange 0 do
->unit
<-unit GetUnitType "RUNNER" eq if
@activate
endif
loop
Thanks for the quick reply! It works perfectly!