nearestMines: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 14: | Line 14: | ||
|p1= position: [[Object]] or [[Array]] in format [[Position#PositionAGL|PositionAGL]] or [[Position#Introduction|Position2D]] - search position centre | |p1= position: [[Object]] or [[Array]] in format [[Position#PositionAGL|PositionAGL]] or [[Position#Introduction|Position2D]] - search position centre | ||
|p2= types: [[Array]] - list of class name of the objects to search for (uses [[isKindOf]] comparison instead of direct class name == comparison). Use an empty array | |p2= types: [[Array]] - list of class name of the objects to search for (uses [[isKindOf]] comparison instead of direct class name == comparison). Use an empty array <sqf inline>[]</sqf> to search for all classes | ||
|p3= radius: [[Number]] - search range | |p3= radius: [[Number]] - search range |
Revision as of 17:14, 25 July 2022
Description
- Description:
- Returns a list of nearest mines of the given types to the given position or object, within the specified distance. If more than one mine are found they will be ordered by proximity by default, the closest one will be first in the array. The sorting can be turned off.
- Groups:
- Object Detection
Syntax
- Syntax:
- nearestMines [position, types, radius, sort, 2Dmode]
- Parameters:
- position: Object or Array in format PositionAGL or Position2D - search position centre
- types: Array - list of class name of the objects to search for (uses isKindOf comparison instead of direct class name == comparison). Use an empty array [] to search for all classes
- radius: Number - search range
- sort: Boolean - (Optional, default true) true to sort the results closest first, false to turn off sorting
- 2Dmode: Boolean - (Optional, default false) true for 2D distance, false for 3D distance comparison
- Return Value:
- Array - found mines as array of Objects
Examples
- Example 1:
- Example 2:
- Example 3:
- Example 4:
- Return every mine in 50 metres radius around player sorted by distance:
Additional Information
- See also:
- nearestTerrainObjects findNearestEnemy nearestBuilding nearestObject nearObjects nearestLocation nearEntities nearTargets nearSupplies nearestLocationWithDubbing nearObjectsReady nearRoads nearestObjects
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note