setTriggerStatements: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
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...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma1 |Game name=
| arma1


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


|gr1= Triggers |GROUP1=
|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. |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.


| trigger '''setTriggerStatements''' [condition, activation, deactivation] |SYNTAX=
| trigger '''setTriggerStatements''' [condition, activation, deactivation]


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


|p3= condition: [[String]] - Code containing trigger condition. Special variables available here:
|p3= condition: [[String]] - Code containing trigger condition. Special variables available here:
* [[this]] ([[Boolean]]) - detection event
* [[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:
|p4= 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:
|p5= 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=
 
| [[Nothing]]
   
   
|x1= <code>_trg [[setTriggerStatements]] ["this", "[[hint]] 'trigger on'", "[[hint]] 'trigger off'"]</code> |EXAMPLE1=
|x1= <code>_trg [[setTriggerStatements]] ["this", "[[hint]] 'trigger on'", "[[hint]] 'trigger off'"]</code>


| [[triggerStatements]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerArea]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[this]], [[thisList]], [[thisTrigger]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]] |SEEALSO=
| [[triggerStatements]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerArea]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[this]], [[thisList]], [[thisTrigger]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]]


}}
}}

Revision as of 11:12, 18 January 2021

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, activation, deactivation]: Array
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:
triggerStatementscreateTriggersetTriggerActivationsetTriggerAreasetTriggerTextsetTriggerTimeoutsetTriggerTypethisthisListthisTriggertriggerIntervalsetTriggerIntervalenableSimulationsimulationEnabled

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

Notes

Posted on Mar 14, 2011 - 20:52
Scifer
An array with three arguments is mandatory for this function.
Posted on September 16, 2014 - 17:41 (UTC)
Heeeere's Johnny!
Magic variable thisList does not contain dead units.