setTriggerStatements: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(45 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma1 | |game1= arma1 | ||
|version1= 1.00 | |||
|game2= arma2 | |||
|version2= 1.00 | |||
|game3= arma2oa | |||
|version3= 1.50 | |||
|game4= tkoh | |||
|version4= 1.00 | |||
|game5= arma3 | |||
|version5= 0.50 | |||
|arg= global | |arg= global | ||
|eff= local | |eff= local | ||
Line 9: | Line 21: | ||
|gr1= Triggers | |gr1= Triggers | ||
| 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. | |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. | ||
| trigger | |s1= trigger [[setTriggerStatements]] [condition, activation, deactivation] | ||
|p1= trigger: [[Object]] - | |p1= trigger: [[Object]] - trigger object | ||
| | |p2= condition: [[String]] - code containing trigger condition. Special variables available here: | ||
* [[this]] ([[Boolean]]) - detection event | * [[Magic Variables#this_2|this]] ([[Boolean]]) - detection event | ||
* [[thisTrigger]] ([[Object]]) - trigger instance | * [[thisTrigger]] ([[Object]]) - trigger instance | ||
* [[thisList]] ([[Array]]) - array of all detected entities | * [[thisList]] ([[Array]]) - array of all detected entities | ||
| | |||
|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 | * [[thisList]] ([[Array]]) - array of all detected entities | ||
| | |||
|p4= deactivation: [[String]] - code that is executed when the trigger is deactivated. Special variable available here: | |||
* [[thisTrigger]] ([[Object]]) - trigger instance | * [[thisTrigger]] ([[Object]]) - trigger instance | ||
|r1= [[Nothing]] | |||
|x1= <sqf>_trg setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];</sqf> | |||
|x1= < | |||
| [[triggerStatements]] | |seealso= [[triggerStatements]] [[createTrigger]] [[setTriggerActivation]] [[setTriggerArea]] [[setTriggerText]] [[setTriggerTimeout]] [[setTriggerType]] [[Magic Variables#this_2|this]] [[thisList]] [[thisTrigger]] [[triggerInterval]] [[setTriggerInterval]] [[enableSimulation]] [[simulationEnabled]] | ||
}} | |||
{{Note | |||
|user= Scifer | |||
|timestamp= 20110314205200 | |||
|text= An array with three arguments is mandatory for this function. | |||
}} | }} | ||
{{Note | |||
|user= Heeeere's Johnny! | |||
|timestamp= 20140916174100 | |||
|text= Magic variable ''thisList'' does not contain dead units. | |||
}} | |||
{{ | |||
Magic variable ''thisList'' does not contain dead units. | |||
Latest revision as of 18:14, 15 August 2022
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:
- thisTrigger (Object) - trigger instance
- thisList (Array) - array of all detected entities
- deactivation: String - code that is executed when the trigger is deactivated. Special variable available here:
- thisTrigger (Object) - trigger instance
- 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
- Posted on Mar 14, 2011 - 20:52 (UTC)
- An array with three arguments is mandatory for this function.
- Posted on Sep 16, 2014 - 17:41 (UTC)
- Magic variable thisList does not contain dead units.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Triggers
- Scripting Commands: Local Effect