Revision as of 19:32, 20 January 2022 by Lou Montana(talk | contribs)(Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1$2")
Returns a list of nearest terrain objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered according to 3D distance to the object (i.e. the closest one will be first in the array).
In contrast to nearestObjects this command returns terrain placed objects like trees, rocks and buildings which don't necessarily need an associated config class.
Since Arma 3 v1.62 it is possible to switch the sorting algorithm off by providing optional param, which significantly increases the performance of this command, especially if the search is performed with large radius.
Since Arma 3 v1.66 it is possible to switch search and sorting mode between 2D and 3D.
Since Arma 3 v2.00 this command also returns missing roads: "ROAD", "MAIN ROAD", "TRACK", "TRAIL"
ⓘ
Types which are missing are not present in the given world. Virtual Reality has no terrain objects. Last updated 1.99
Since Arma 3 v1.66 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation.
Be aware that some terrain objects types might be tricky to be found, such as terrain rocks and boulders which are not considered to be "ROCKS" or "ROCK", but "HIDE". Example:
nearestTerrainObjects [player, ["HIDE"], 20]; // [939688: bluntstone_01.p3d,939691: garbagebags_f.p3d,939671: wreck_car_f.p3d,939692: junkpile_f.p3d]