nearObjects – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
The returned object is not necessarily the closest one.

But an array of objects is returned, so this doesnt make sense. --T_D 09:46, 4 May 2007 (CEST)

Yeah, sorry. I'll rephrase that.
I meant to say that the first element in the array is not necessarily the closest one (like it is in the other "near*" commands). --Kronzky 16:31, 4 May 2007 (CEST)

Note recently added:

{_x setdamage 1} foreach (player nearObjects 50);

This neglects to mention that the player will also be killed, as will any other units within the range.

Planck 20:12, 26 August 2007 (CEST)

This can find #particlesource where as nearestObjects can't (?). --Doolittle 03:58, 28 August 2009 (CEST)


In Arma 2 buildings that are hidden by LOD are not visible using this command. There is also an interesting fact: if you use this command to detect buildings in the nearest location of type NameCity or NameCityCapital, it'll work properly. For NameVillage, however, the returned array is empty. --18:04, 27 September 2009 (CEST) tsuki.

Check the Z coordinate of the location. In Arma some NameVillage Locations are positioned below sea level (IIRC Bonanza is at [<x>,<y>,-200]), so searching for stuff near them (e.g. 100m) won't yield any results. --Worldeater 05:29, 30 September 2009 (CEST)

It would be better to talk of distance rather than radius for the parameter.
Radius might imply a 2d plain, while distance is more accurate. Thoughts?

Same for nearestObjects and nearObjects. --Kju 14:59, 21 June 2010 (CEST)

Radii are defined for spheres just like for circles, so I don't see why this should imply a distance on a plane. Anyways, I think radius is just fine, as it implies a spherical shape with position as center, and everything inside that shape is returned. Distance is a good fit too, though. Both have their pros and cons. --TeRp 17:13, 21 June 2010 (CEST)