BIS fnc nearestPosition: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[[cC]ategory:\{\{Name\|arma3\}\}: [fF]unctions\|\{\{uc:[a-z A-Z_]*\}\}\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>") |
||
(18 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|game1= arma2 | |game1= arma2 | ||
|version1= 1.00 | |||
| | |game2= arma2oa | ||
|version2= 1.50 | |||
|game3= tkoh | |||
|version3= 1.00 | |||
|game4= arma3 | |||
|version4= 0.50 | |||
|gr1= Positions | |gr1= Positions | ||
Line 17: | Line 25: | ||
|r1= [[Object]], [[Location]], [[Group]], [[String]] (marker) or [[Position]] - the closest from ''items'' | |r1= [[Object]], [[Location]], [[Group]], [[String]] (marker) or [[Position]] - the closest from ''items'' | ||
|x1= < | |x1= <sqf>// Find the nearest marker from player | ||
_nearestMarker = | _nearestMarker = [allMapMarkers, player] call BIS_fnc_nearestPosition;</sqf> | ||
|x2= < | |x2= <sqf>// Find the nearest marker to trigger using trigger onActivation code | ||
_nearestMarker = | _nearestMarker = [allMapMarkers, thisTrigger] call BIS_fnc_nearestPosition;</sqf> | ||
|seealso= [[nearObjects]] | |seealso= [[nearObjects]] [[nearestObject]] [[nearestObjects]] [[BIS_fnc_nearestPoint]] [[BIS_fnc_nearestNum]] [[BIS_fnc_nearestRoad]] [[BIS_fnc_nearestHelipad]] [[BIS_fnc_isPosBlacklisted]] | ||
}} | }} | ||
Latest revision as of 17:00, 13 July 2022
Description
- Description:
- Function to find the nearest Object or position from a list, when compared to a given reference.
- Execution:
- call
- Groups:
- Positions
Syntax
- Syntax:
- [items, origin] call BIS_fnc_nearestPosition
- Parameters:
- items: Array of Object, Location, Group, String (marker) and/or Position - note that for a group, leader's position is used
- origin: Object, Location, Group, String (marker) or Position
- Return Value:
- Object, Location, Group, String (marker) or Position - the closest from items
Examples
- Example 1:
- // Find the nearest marker from player _nearestMarker = [allMapMarkers, player] call BIS_fnc_nearestPosition;
- Example 2:
- // Find the nearest marker to trigger using trigger onActivation code _nearestMarker = [allMapMarkers, thisTrigger] call BIS_fnc_nearestPosition;
Additional Information
- See also:
- nearObjects nearestObject nearestObjects BIS_fnc_nearestPoint BIS_fnc_nearestNum BIS_fnc_nearestRoad BIS_fnc_nearestHelipad BIS_fnc_isPosBlacklisted
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