setTriggerStatements: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Armed[ _]Assault(\|.*)]]" to "{{GameCategory|arma1|Scripting Commands}}")
m (Some wiki formatting)
 
(53 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma1 |Game name=
|game1= arma1
|version1= 1.00


|1.00|Game version=
|game2= arma2
|arg= global|Multiplayer Arguments=
|version2= 1.00
|eff= local |Multiplayer Effects=


|gr1= Triggers |GROUP1=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| Defines trigger condition, activation and deactivation statements. Trigger condition has to return [[Boolean]]. [[true]] will activate the trigger, [[false]] will deactivate it (only if activation is set to repeat). [[thisList]] returns the same result as [[list]] command, which includes all entities in the trigger area that are capable of activating the trigger. Dead entities are excluded as well as crew in vehicles, vehicles themselves are included. |DESCRIPTION=
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| trigger '''setTriggerStatements''' [condition, activation, deactivation] |SYNTAX=
|game5= arma3
|version5= 0.50


|p1= trigger: [[Object]] - Trigger object |PARAMETER1=
|arg= global
|p2= [condition, activation, deactivation]: [[Array]]  |Parameter2=
|eff= local


|p3= condition: [[String]] - Code containing trigger condition. Special variables available here:
|gr1= Triggers
* [[this]] ([[Boolean]]) - detection event
 
|descr= Defines trigger condition, activation and deactivation statements. Trigger condition has to return [[Boolean]]. [[true]] will activate the trigger, [[false]] will deactivate it (only if activation is set to repeat). [[thisList]] returns the same result as [[list]] command, which includes all entities in the trigger area that are capable of activating the trigger. Dead entities are excluded as well as crew in vehicles, vehicles themselves are included.
 
|s1= trigger [[setTriggerStatements]] [condition, activation, deactivation]
 
|p1= trigger: [[Object]] - trigger object
 
|p2= condition: [[String]] - code containing trigger condition. Special variables available here:
* [[Magic Variables#this_2|this]] ([[Boolean]]) - detection event
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisList]] ([[Array]]) - array of all detected entities |PARAMETER3=
* [[thisList]] ([[Array]]) - array of all detected entities
|p4= activation: [[String]] - Code that is executed when the trigger is activated. Special variables available here:
 
|p3= activation: [[String]] - code that is executed when the trigger is activated. Special variables available here:
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisList]] ([[Array]]) - array of all detected entities|PARAMETER4=
* [[thisList]] ([[Array]]) - array of all detected entities
|p5= deactivation: [[String]] - Code that is executed when the trigger is deactivated. Special variable available here:
 
|p4= deactivation: [[String]] - code that is executed when the trigger is deactivated. Special variable available here:
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisTrigger]] ([[Object]]) - trigger instance
|PARAMETER5=


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]
____________________________________________________________________________________________
 
|x1= <code>_trg [[setTriggerStatements]] ["this", "[[hint]] 'trigger on'", "[[hint]] 'trigger off'"]</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[triggerStatements]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerArea]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[this]], [[thisList]], [[thisTrigger]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]] |SEEALSO=
|x1= <sqf>_trg setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];</sqf>


|seealso= [[triggerStatements]] [[createTrigger]] [[setTriggerActivation]] [[setTriggerArea]] [[setTriggerText]] [[setTriggerTimeout]] [[setTriggerType]] [[Magic Variables#this_2|this]] [[thisList]] [[thisTrigger]] [[triggerInterval]] [[setTriggerInterval]] [[enableSimulation]] [[simulationEnabled]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Scifer
<!-- Note Section BEGIN -->
|timestamp= 20110314205200
<dd class="notedate">Posted on Mar 14, 2011 - 20:52
|text= An array with three arguments is mandatory for this function.
<dt class="note">[[User:Scifer|Scifer]]<dd class="note">
}}
An array with three arguments is mandatory for this function.
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|SETTRIGGERSTATEMENTS]]
|user= Heeeere's Johnny!
[[Category:Scripting Commands OFP Elite |SETTRIGGERSTATEMENTS]]
|timestamp= 20140916174100
{{GameCategory|arma1|Scripting Commands}}
|text= Magic variable ''thisList'' does not contain dead units.
[[Category:Command_Group:_Triggers|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 16, 2014 - 17:41 (UTC)</dd>
<dt class="note">[[User:Heeeere's Johnny!|Heeeere's Johnny!]]</dt>
<dd class="note">
Magic variable ''thisList'' does not contain dead units.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 18:14, 15 August 2022

Hover & click on the images for description

Description

Description:
Defines trigger condition, activation and deactivation statements. Trigger condition has to return Boolean. true will activate the trigger, false will deactivate it (only if activation is set to repeat). thisList returns the same result as list command, which includes all entities in the trigger area that are capable of activating the trigger. Dead entities are excluded as well as crew in vehicles, vehicles themselves are included.
Groups:
Triggers

Syntax

Syntax:
trigger setTriggerStatements [condition, activation, deactivation]
Parameters:
trigger: Object - trigger object
condition: String - code containing trigger condition. Special variables available here:
activation: String - code that is executed when the trigger is activated. Special variables available here:
deactivation: String - code that is executed when the trigger is deactivated. Special variable available here:
Return Value:
Nothing

Examples

Example 1:
_trg setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];

Additional Information

See also:
triggerStatements createTrigger setTriggerActivation setTriggerArea setTriggerText setTriggerTimeout setTriggerType this thisList thisTrigger 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
Scifer - c
Posted on Mar 14, 2011 - 20:52 (UTC)
An array with three arguments is mandatory for this function.
Heeeere's Johnny! - c
Posted on Sep 16, 2014 - 17:41 (UTC)
Magic variable thisList does not contain dead units.