BIS fnc inTrigger: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(\[[a-zA-Z,. ]*\] call ('''|\[\[)?BI(N|S)_fnc_[a-zA-Z]+('''|\]\])?) * \|p1=" to " |s1=$1 |p1=") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma2 | |game1= arma2 | ||
|1.00 | |version1= 1.00 | ||
|game2= arma2oa | |game2= arma2oa | ||
Line 15: | Line 15: | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
| Detects whether position is within area | |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.}} | |||
|s1=[area, position, returnDistance, includeFloorCeiling] call [[BIS_fnc_inTrigger]] | |s1= [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]] | ||
| | |p3= returnDistance (Optional): - (Optional, default [[false]]) [[true]] to return distance to nearest edge of trigger area | ||
| [[Boolean]] - [[true]] when position is in area, false if not | |||
|p4= includeFloorCeiling: [[Boolean]] - (Optional, default [[false]]) to include trigger area floor and ceiling in calculation when calculating distance to nearest edge | |||
|r1= | |||
* [[Boolean]] - [[true]] when position is in area, false if not | |||
* [[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 = [_trigger, [[player]]] [[call]] [[BIS_fnc_inTrigger]]; {{cc|_inTrigger = true}}</code> | ||
|seealso= [[createTrigger]], [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | |seealso= [[createTrigger]], [[createMarker]], [[setTriggerArea]], [[setMarkerSize]], [[triggerArea]], [[markerSize]], [[inArea]], [[inAreaArray]], [[BIS_fnc_getArea]] | ||
}} | }} | ||
<dl class="command_description"> | <dl class="command_description"> | ||
Line 49: | Line 46: | ||
<dd class="note"> | <dd class="note"> | ||
Works with markers too: | Works with markers too: | ||
<code>inMarker | <code>inMarker = ["markername", _position] [[call]] [[BIS_fnc_inTrigger]];</code> | ||
</dd> | </dd> | ||
Line 56: | Line 53: | ||
<dt class="note">[[User:Larrow|Larrow]]</dt> | <dt class="note">[[User:Larrow|Larrow]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Also works with [ pos, radius ] | Also works with [pos, radius] | ||
<code>[ [position, radius], player ] call BIS_fnc_inTrigger</code> | <code>[<nowiki/>[position, radius], player] [[call]] [[BIS_fnc_inTrigger]];</code> | ||
</dd> | </dd> | ||
</dl> | </dl> |
Revision as of 14:22, 13 June 2021
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 - 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): - (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:
_trigger = createTrigger ["EmptyDetector", getPosATL player]; _trigger setTriggerArea [10, 10, 0, false]; _inTrigger = [_trigger, player] call BIS_fnc_inTrigger; // -no comment defined-
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
- 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;