setTriggerArea: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add since template usage)
m (Text replacement - "{{Feature | Informative | " to "{{Feature|informative|")
 
(54 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= ofpe
|version1= 1.00


|1.00|Game version=
|game2= arma1
|version2= 1.00


|arg= global|Multiplayer Arguments=
|game3= arma2
|version3= 1.00


|eff= local |Multiplayer Effects=
|game4= arma2oa
|version4= 1.50


|gr1= Triggers |GROUP1=
|game5= tkoh
____________________________________________________________________________________________
|version5= 1.00


| [[Image:setTriggerArea.jpg|thumb|300px|Trigger axis a, b and c (''half'' of their x, y and z dimensions)]] Defines the area monitored by the given trigger. The area could be either rectangular or elliptical.
|game6= arma3
{{Informative |  
|version6= 0.50
Just like with a and b dimensions, c dimension will alter area in opposite directions from the trigger position along z axis. Therefore if the trigger position is on the surface, half of the trigger area will be above the surface and half below. To place the whole area above the surface, adjust trigger position (move it up c meters). If c is not specified or <{{=}} 0, the trigger's height is considered infinite like 2D triggers.}} |DESCRIPTION=
____________________________________________________________________________________________


| trigger '''setTriggerArea''' [a, b, angle, isRectangle, c] |SYNTAX=
|arg= global


|p1= trigger: [[Object]] - object of the type "EmptyDetector"|PARAMETER1=
|eff= local


|p2= [a, b, angle, isRectangle, c]: [[Array]] |PARAMETER2=
|gr1= Triggers


|p3= a: [[Number]] - trigger area X size / 2, in meters |PARAMETER3=
|descr= [[File:setTriggerArea.jpg|thumb|300px|Trigger axis a, b and c (''half'' of their x, y and z dimensions)]] Defines the area monitored by the given trigger. The area could be either rectangular or elliptical.
{{Feature|informative|
Just like with a and b dimensions, c dimension will alter area in opposite directions from the trigger position along z axis. Therefore if the trigger position is on the surface, half of the trigger area will be above the surface and half below. To place the whole area above the surface, adjust trigger position (move it up c meters). If c is not specified or <{{=}} 0, the trigger's height is considered infinite like 2D triggers.}}


|p4= b: [[Number]] - trigger area Y size / 2, in meters |PARAMETER4=
|s1= trigger [[setTriggerArea]] [a, b, angle, isRectangle, c]


|p5= angle: [[Number]] - trigger area rotation in degrees |PARAMETER5=
|p1= trigger: [[Object]] - object of the type "EmptyDetector"


|p6= isRectangle: [[Boolean]] - [[true]] if rectangle |PARAMETER6=
|p2= a: [[Number]] - trigger area X size / 2, in meters


|p7= c: [[Number]] - (Optional) trigger area Z size / 2, in meters. -1 for infinite height {{since|arma3|1.59.135137|y}} |PARAMETER7=
|p3= b: [[Number]] - trigger area Y size / 2, in meters


| [[Nothing]] |RETURNVALUE=
|p4= angle: [[Number]] - trigger area rotation in degrees
____________________________________________________________________________________________
 
|x1= <code>_trigger [[setTriggerArea]] [100, 50, 45, [[false]]];</code> |EXAMPLE1=


|x2= <code>_trigger [[setTriggerArea]] [100, 50, 45, [[false]], 100];</code> |EXAMPLE2=
|p5= isRectangle: [[Boolean]] - [[true]] if rectangle


|x3= <code>_trg = [[createTrigger]] ["EmptyDetector", [[getPos]] [[player]], [[false]]];
|p6= c: [[Number]] - (Optional, default -1) trigger area Z size / 2, in meters. -1 for infinite height
_trg [[setTriggerArea]] [5, 5, 0, [[false]]];
|p6since= arma3 1.60
_trg [[setTriggerActivation]] ["CIV", "PRESENT", [[true]]];
_trg [[setTriggerStatements]] ["[[this]]", "[[hint]] 'Civilian near player'", "[[hint]] 'no civilian near'"];</code>|EXAMPLE3=
____________________________________________________________________________________________


| [[triggerArea]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerStatements]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[inArea]], [[inAreaArray]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]] |SEEALSO=
|r1= [[Nothing]]
}}
 
|x1= <sqf>_trigger setTriggerArea [100, 50, 45, false];</sqf>


<h3 style="display:none">Notes</h3>
|x2= <sqf>_trigger setTriggerArea [100, 50, 45, false, 100];</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x3= <sqf>
</dl>
_trg = createTrigger ["EmptyDetector", getPos player, false];
_trg setTriggerArea [5, 5, 0, false];
_trg setTriggerActivation ["CIV", "PRESENT", true];
_trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];
</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[triggerArea]] [[createTrigger]] [[setTriggerActivation]] [[setTriggerStatements]] [[setTriggerText]] [[setTriggerTimeout]] [[setTriggerType]] [[inArea]] [[inAreaArray]] [[triggerInterval]] [[setTriggerInterval]] [[enableSimulation]] [[simulationEnabled]]
[[Category:Scripting Commands OFP Elite |{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 21:41, 16 May 2024

Hover & click on the images for description

Description

Description:
Trigger axis a, b and c (half of their x, y and z dimensions)
Defines the area monitored by the given trigger. The area could be either rectangular or elliptical.
Just like with a and b dimensions, c dimension will alter area in opposite directions from the trigger position along z axis. Therefore if the trigger position is on the surface, half of the trigger area will be above the surface and half below. To place the whole area above the surface, adjust trigger position (move it up c meters). If c is not specified or <= 0, the trigger's height is considered infinite like 2D triggers.
Groups:
Triggers

Syntax

Syntax:
trigger setTriggerArea [a, b, angle, isRectangle, c]
Parameters:
trigger: Object - object of the type "EmptyDetector"
a: Number - trigger area X size / 2, in meters
b: Number - trigger area Y size / 2, in meters
angle: Number - trigger area rotation in degrees
isRectangle: Boolean - true if rectangle
since Arma 3 logo black.png1.60
c: Number - (Optional, default -1) trigger area Z size / 2, in meters. -1 for infinite height
Return Value:
Nothing

Examples

Example 1:
_trigger setTriggerArea [100, 50, 45, false];
Example 2:
_trigger setTriggerArea [100, 50, 45, false, 100];
Example 3:
_trg = createTrigger ["EmptyDetector", getPos player, false]; _trg setTriggerArea [5, 5, 0, false]; _trg setTriggerActivation ["CIV", "PRESENT", true]; _trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];

Additional Information

See also:
triggerArea createTrigger setTriggerActivation setTriggerStatements setTriggerText setTriggerTimeout setTriggerType inArea inAreaArray triggerInterval setTriggerInterval enableSimulation simulationEnabled

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