BIS fnc inTrigger: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1 = Object Manipulation | |gr1 = Object Manipulation | ||
| Detects whether position is within area (Since Arma 3 v1.57 an engine solution is available [[inArea]]) '''or''' calculates distance to the nearest edge of trigger area by using optional params. | | Detects whether position is within area (Since Arma 3 v1.57 an engine solution is available [[inArea]]) '''or''' calculates distance to the nearest edge of trigger area by using optional params. | ||
| [area, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] | | [area, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] | ||
|p1= area: [[Object]] - trigger, [[String]] - marker, [[Location]] - location or [[Array]] - in format [center, distance] or [center, [a, b, angle, rect]] or [center, [a, b, angle, rect, height]] | |p1= area: [[Object]] - trigger, [[String]] - marker, [[Location]] - location or [[Array]] - in format [center, distance] or [center, [a, b, angle, rect]] or [center, [a, b, angle, rect, height]] | ||
|p2= position: [[Object]] or [[Array]] - Position to check (e.g. player) or [[Position]] | |p2= position: [[Object]] or [[Array]] - Position to check (e.g. player) or [[Position]] | ||
|p3= returnDistance (Optional): [[Boolean]] - [[true]] to return distance to nearest edge of trigger area. Default: [[false]] | |p3= returnDistance (Optional): [[Boolean]] - [[true]] to return distance to nearest edge of trigger area. Default: [[false]] | ||
|p4= includeFloorCeiling (Optional): [[Boolean]] - [[true]] to include trigger area floor and ceiling in calculation when calculating distance to nearest edge. Default: [[false]] | |p4= includeFloorCeiling (Optional): [[Boolean]] - [[true]] to include trigger area floor and ceiling in calculation when calculating distance to nearest edge. Default: [[false]] | ||
| [[Boolean]] - [[true]] when position is in area, false if not | | [[Boolean]] - [[true]] when position is in area, false if not | ||
<br> | <br> | ||
'''or''' | '''or''' | ||
<br>[[Number]] - (when ''returnDistance'' is [[true]]) - distance from closest border: negative distance - from inside, positive distance - from outside | <br>[[Number]] - (when ''returnDistance'' is [[true]]) - distance from closest border: negative distance - from inside, positive distance - from outside | ||
|x1= <code>_trigger = [[createTrigger]] ["EmptyDetector", [[getPosATL]] [[player]]]; | |x1= <code>_trigger = [[createTrigger]] ["EmptyDetector", [[getPosATL]] [[player]]]; | ||
_trigger [[setTriggerArea]] [10, 10, 0, false]; | _trigger [[setTriggerArea]] [10, 10, 0, false]; | ||
_inTrigger = [_trigger, [[player]]] [[call]] [[BIS_fnc_inTrigger]]; //_inTrigger = true</code> | _inTrigger = [_trigger, [[player]]] [[call]] [[BIS_fnc_inTrigger]]; //_inTrigger = true</code> | ||
| [[createTrigger]], [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | | [[createTrigger]], [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | ||
}} | }} |
Revision as of 23:08, 17 January 2021
Description
- Description:
- Detects whether position is within area (Since Arma 3 v1.57 an engine solution is available inArea) or calculates distance to the nearest edge of trigger area by using optional params.
- Execution:
- call
- Groups:
- Object Manipulation
Syntax
- Syntax:
- [area, position, returnDistance, includeFloorCeiling] call BIS_fnc_inTrigger
- Parameters:
- area: Object - trigger, String - marker, Location - location or Array - in format [center, distance] or [center, [a, b, angle, rect]] or [center, [a, b, angle, rect, height]]
- position: Object or Array - Position to check (e.g. player) or Position
- returnDistance (Optional): Boolean - true to return distance to nearest edge of trigger area. Default: false
- includeFloorCeiling (Optional): Boolean - true to include trigger area floor and ceiling in calculation when calculating distance to nearest edge. Default: false
- Return Value:
- Boolean - true when position is in area, false if not
or
Number - (when returnDistance is true) - distance from closest border: negative distance - from inside, positive distance - from outside
Examples
- Example 1:
_trigger = createTrigger ["EmptyDetector", getPosATL player]; _trigger setTriggerArea [10, 10, 0, false]; _inTrigger = [_trigger, player] call BIS_fnc_inTrigger; //_inTrigger = true
Additional Information
- See also:
- createTriggercreateMarkersetTriggerAreasetMarkerSizetriggerAreamarkerSizeinAreainAreaArrayBIS_fnc_getArea
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
Bottom Section
- Posted on May 6, 2015 - 19:34 (UTC)
- Killzone Kid
-
Works with markers too:
inMarker = ["markername", _position] call BIS_fnc_inTrigger;
- Posted on October 4, 2015 - 11:22 (UTC)
- Larrow
-
Also works with [ pos, radius ]
[ [position, radius], player ] call BIS_fnc_inTrigger