setTriggerStatements: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Missing any mention of thisTrigger variable.)
(description)
Line 9: Line 9:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Defines a trigger's condition, and executable code for its activation and deactivation events. |= 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. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 15: Line 15:


|p1= trigger: [[Object]] - Trigger object |= Parameter 1
|p1= trigger: [[Object]] - Trigger object |= Parameter 1
|p2= condition: [[String]] - Code containing the trigger's condition, which has to return a [[boolean]] value. If ''this'' is used, the result of the trigger's [[setTriggerActivation|activation condition]] is interpreted. (The variable [[this#thisTrigger|thisTrigger]] contains a variable of the trigger.)|= Parameter 2
|p2= [condition, activation, deactivation]: [[Array]]  |=
|p3= activation: [[String]] - Code that is executed when the trigger is activated (The variable [[this#thisList|thisList]] contains an array with the units that activated the trigger. The variable [[this#thisTrigger|thisTrigger]] contains a variable of the trigger.)|= Parameter 3
|p3= condition: [[String]] - Code containing trigger condition. Special variables available here:
|p4= deactivation: [[String]] - Code that is executed when the trigger is deactivated. (The variable [[this#thisList|thisList]] does not exist here. The variable [[this#thisTrigger|thisTrigger]] contains a variable of the trigger.)|= Parameter 4
* [[this]] ([[Boolean]]) - detection event
* [[thisTrigger]] ([[Object]]) - trigger instance
* [[thisList]] ([[Array]]) - array of all detected entities |=  
|p4= 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|=  
|p5= deactivation: [[String]] - Code that is executed when the trigger is deactivated. Special variable available here:
* [[thisTrigger]] ([[Object]]) - trigger instance
|= Parameter 4


| [[Nothing]] |= Return value
| [[Nothing]] |= Return value
Line 25: Line 33:
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[triggerStatements]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerArea]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[this#thisList|thisList]], [[this#thisTrigger|thisTrigger]] |= See also
| [[triggerStatements]], [[createTrigger]], [[setTriggerActivation]], [[setTriggerArea]], [[setTriggerText]], [[setTriggerTimeout]], [[setTriggerType]], [[this]], [[thisList]], [[thisTrigger]] |= See also


}}
}}

Revision as of 10:12, 1 October 2015

-wrong parameter ("Arma") defined!-1.00
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:
Uncategorised

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:
triggerStatementscreateTriggersetTriggerActivationsetTriggerAreasetTriggerTextsetTriggerTimeoutsetTriggerTypethisthisListthisTrigger

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.

Bottom Section

Posted on September 16, 2014 - 17:41 (UTC)
Heeeere's Johnny!
Magic variable thisList does not contain dead units.