BIS fnc inTrigger: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
(opt params)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Detects whether a position is within the trigger area of the given trigger. Since Arma 3 v1.57 an engine solution is available [[inArea]]|= Description
| Detects whether position is within trigger 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.|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| [trigger, position, (isScalar)] call [[BIS_fnc_inTrigger]] |= Syntax
| [trigger, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] |= Syntax


|p1= trigger: [[Object]] or [[Array]] - [[Triggers|Trigger]] or trigger area |=
|p1= trigger: [[Object]] or [[Array]] - [[Triggers|Trigger]] or area in format [center, distance] or [center, [a, b, angle, rect]] or [center, [a, b, angle, rect, height]]|=
|p2= position: [[Object]] or [[Array]] - reference object (e.g. player) or [[Position]] |=
|p2= position: [[Object]] or [[Array]] - Position to check (e.g. player) or [[Position]] |=
|p3= isScalar (Optional): [[Boolean]] - true for scalar result [default: false] |=
|p3= returnDistance (Optional): [[Boolean]] - [[true]] to return distance to nearest edge of trigger area. Default: [[false]] |=
| [[Boolean]] - true when position is in trigger area, false otherwise<br />
|p4= includeFloorCeiling (Optional): [[Boolean]] - [[true]] to include trigger area floor and ceiling in calculation when calculating distance to nearest edge. Default: [[false]] |=
[[Number]] - distance from border if ''isScalar'' is true |= Return value
| [[Boolean]] - [[true]] when position is in area, false if not
<br>
'''or'''
<br>[[Number]] - (when ''returnDistance'' is [[true]]) - distance from closest border: negative distance - from inside, positive distance - from outside |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 01:47, 10 February 2017


Hover & click on the images for description

Description

Description:
Detects whether position is within trigger 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:
Uncategorised

Syntax

Syntax:
[trigger, position, returnDistance, includeFloorCeiling] call BIS_fnc_inTrigger
Parameters:
trigger: Object or Array - Trigger or area 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:
createTriggercreateMarkersetTriggerAreasetMarkerSizetriggerAreamarkerSizeinAreainAreaArray

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

Notes

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:14 (UTC)
Larrow
As of ["Arma 3","Arma3",152,132676,"Stable",true] this command is still broken if checking against markers that have axisB larger axisA. To get around this if needed you can create your marker with the largest radius in axisA and rotate your marker by 90degrees.
Posted on October 4, 2015 - 11:22 (UTC)
Larrow
Also works with [ pos, radius ] [ [position, radius], player ] call BIS_fnc_inTrigger