BIS fnc inTrigger: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "code>_([a-zA-Z0-9_]+) = " to "code>private _$1 = ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 16: | Line 16: | ||
|descr= Detects whether position is within area '''or''' calculates distance to the nearest edge of trigger area by using optional params. | |descr= Detects whether position is within area '''or''' calculates distance to the nearest edge of trigger area by using optional params. | ||
{{Feature | arma3 | Since {{arma3}} v1.57 [[inArea]] is available for an area check.}} | {{Feature|arma3|Since {{arma3}} v1.57 [[inArea]] is available for an area check.}} | ||
|s1= [area, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] | |s1= [area, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] | ||
|p1= area: [[Object]] - trigger | |p1= area: [[Object]], [[String]], [[Location]] or [[Array]] | ||
* [[Object]] - trigger | |||
* [[String]] - marker | |||
* [[Location]] - location | |||
* [[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 | |p3= returnDistance: [[Boolean]] - (Optional, default [[false]]) [[true]] to return distance to nearest edge of trigger area | ||
|p4= includeFloorCeiling: [[Boolean]] - (Optional, default [[false]]) to include trigger area floor and ceiling in calculation when calculating distance to nearest edge | |p4= includeFloorCeiling: [[Boolean]] - (Optional, default [[false]]) to include trigger area floor and ceiling in calculation when calculating distance to nearest edge | ||
Line 32: | Line 36: | ||
* [[Number]] - (when ''returnDistance'' is [[true]]) - distance from closest border: negative distance - from inside, positive distance - from outside | * [[Number]] - (when ''returnDistance'' is [[true]]) - distance from closest border: negative distance - from inside, positive distance - from outside | ||
|x1= < | |x1= <sqf> | ||
_trigger | private _trigger = createTrigger ["EmptyDetector", getPosATL player]; | ||
_inTrigger = [_trigger, | _trigger setTriggerArea [10, 10, 0, false]; | ||
_inTrigger = [_trigger, player] call BIS_fnc_inTrigger; // _inTrigger = true | |||
</sqf> | |||
|seealso= [[createTrigger]] [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | |seealso= [[createTrigger]] [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | ||
}} | }} | ||
Revision as of 16:51, 30 June 2022
Description
- Description:
- Detects whether position is within area 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, String, Location or Array
- position: Object or Array - Position to check (e.g. player) or Position
- returnDistance: Boolean - (Optional, default false) true to return distance to nearest edge of trigger area
- includeFloorCeiling: Boolean - (Optional, default false) to include trigger area floor and ceiling in calculation when calculating distance to nearest edge
- Return Value:
Examples
- Example 1:
Additional Information
- See also:
- createTrigger createMarkersetTriggerAreasetMarkerSizetriggerAreamarkerSizeinAreainAreaArrayBIS_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