Kronzky
Units in vehicles are not detected via this command.
Results appear below as you type; use the arrow keys to move through them.
Find objects (Units, Vehicles, Dead, Map Objects) in a sphere with given radius. The first object in the returned array is not necessarily the closest one. If you need returned objects to be sorted by distance, use nearestObjects. If typeName is given, only objects of given type (or its subtype) are listed.
position nearObjects radius
Parameters:
position: Position, Position2D or Objectradius: Numberposition nearObjects [typeName, radius]
Parameters:
position: PositionAGL, Position2D or ObjecttypeName: Stringradius: Number_list = position player nearObjects 50;
_list = [_xpos,_ypos] nearObjects ["House", 20];
_list = player nearObjects 20;
findNearestEnemy · nearestBuilding · nearestObject · nearestObjects · nearestLocation · nearEntities · nearTargets · nearSupplies · nearestLocationWithDubbing · nearObjectsReady · nearRoads · nearestMines
Units in vehicles are not detected via this command.
In the second syntax, you can't omit the typeName parameter. It's required and you'll get an error if you don't supply it. Use "All" as an alternative to leaving it out. (CO 1.59)
If you use the first syntax, it will return objects many more objects such as pollen, honeybees and crucially, triggers. Triggers will show in the returned array as "no shape" but you can use typeOf to get the classname, which will give "EmptyDetector". This will not return objects that don't have classnames such as plants, stones and some map objects like vehicle wrecks. nearestObjects will find objects without classnames.
The syntax 2 means that the command will include all types which inherit from the given type. As an example, when using "Helipad_Base_F", the command will detect all types of helipads (Land_HelipadSquare_F, Land_HelipadCircle_F, Land_HelipadEmpty_F, etc) in the given radius.