Killzone_Kid
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.
Results appear below as you type; use the arrow keys to move through them.
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.
Possible type names:
"BUILDING""BUNKER""BUSH""BUSSTOP""CHAPEL""CHURCH""CROSS""FENCE""FOREST BORDER""FOREST SQUARE""FOREST TRIANGLE""FOREST""FORTRESS""FOUNTAIN""FUELSTATION""HIDE""HOSPITAL""HOUSE""LIGHTHOUSE""MAIN ROAD""POWER LINES""POWERSOLAR""POWERWAVE""POWERWIND""QUAY""RAILWAY""ROAD""ROCK""ROCKS""RUIN""SHIPWRECK""SMALL TREE""STACK""TOURISM""TRACK""TRAIL""TRANSMITTER""TREE""VIEW-TOWER""WALL""WATERTOWER"Important
The names are / The filter is based on the named property map - not on the named property class or any config definition!
Note
Types which are missing are not present in the given world. Virtual Reality has no terrain objects. Last updated Arma 3 v2.12
Note
Extraction script can be found on the Biki Export Scripts page.
nearestTerrainObjects [position, types, radius, sort, 2Dmode]
Parameters:
position: Object, PositionAGL or Position2D - where to find objects, center positiontypes: Array - list of case-insensitive types of the objects to search for. [] to search without filtersradius: Number - range from center position to search for objectssort: Boolean - (Optional, default true) sort objects by distance to the center or not - setting to false greatly improves performance (since arma3 1.62)2Dmode: Boolean - (Optional, default false) the object search and sorting mode: true - 2D, false - 3D (since arma3 1.66)Returns: Array of Objects - Before Arma 3 v2.00 this command did not return roads of type "ROAD", "MAIN ROAD", "TRACK", "TRAIL"
nearestTerrainObjects [player, ["Tree", "Bush"], 200];
nearestTerrainObjects [player, ["House"], 200];
nearestTerrainObjects [[2716, 2949, 0], ["Chapel", "Fuelstation"], 100];
Return every terrain object in 50 metres radius around player sorted, closest first:
nearestTerrainObjects [player, [], 50];
Return every terrain object in 50 metres radius around player unsorted:
nearestTerrainObjects [player, [], 50, false];
Hide all terrain objects (run locally for each client):
private _allTerrainObjects = nearestTerrainObjects
[
[worldSize / 2, worldSize / 2],
[],
worldSize * sqrt 2 / 2,
false,
true
];
{ _x hideObject true } forEach _allTerrainObjects;
nearestObjects · findNearestEnemy · hideObject · nearestBuilding · nearestObject · nearObjects · nearestLocation · nearEntities · nearTargets · nearSupplies · nearestLocationWithDubbing · nearObjectsReady · nearRoads · roadsConnectedTo · roadAt · isOnRoad · getRoadInfo · nearestMines
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]
Large bridges are map type "ROAD". Small foot bridges are not roads and not included into road net.