Triggers: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (added trigger frequency)
(some rephrasing)
Line 1: Line 1:
===Introduction===
==Introduction==
 
Triggers are an essential function for mission designers. A trigger (sometimes called a sensor) allows a mission designer to control events within a mission. Some common uses for triggers are controlling the timing of squad moves, camera control in cutscene, or even play the appropriate music when the time is right.
'''Triggers''' are an essential function for mission designers. A trigger (sometimes called a sensor) allows a mission designer to control events within a mission. Some common uses for triggers are controlling the timing of when a squad moves in, or used in a cutscene with the camera feature, or even play the appropriate music when the time is right.
 


==Activation==
==Activation==
- this allows you to choose how the trigger is activated. There are several combinations that can be created to activate the trigger. The trigger can be used to check if [[east]] or [[west]] is ''present'' or ''not present'' or even ''detected'' within the trigger. A trigger can also be used to set up ''radio'' commands.
How the trigger is activated.<br>
There are several combinations that can be created to activate the trigger. The trigger can be used to check if [[east]] or [[west]] is ''present'', ''not present'', or even ''detected'' within the trigger. A trigger can also be used to set up ''radio'' commands.


==Countdown==
==Countdown==
- defines how long to wait until the '''On Activation''' is fired. Min, Max and Mid allow you to add some randomization to the time.  
Defines (in seconds) how long to wait until '''On Activation''' is fired. Min, Max and Mid allow you to add some randomization to the time.  


==Condition==
==Condition==
- expression is used to determine when the trigger is activated.<br>
In addition to the 'Activation' options above, this field allows you to specify other conditions that have to be fulfilled before  the Trigger activates.<br>
[[Boolean]] variable '''this''' is set during evaluation of condition expression to primary sensor activation condition.<br>
By default only the [[Boolean|boolean]] variable '''this''' is present in this field. It is set to the result of the main 'Activation' condition (e.g. 'east'/'present').<br>
Array variable '''thisList''' is set to list of all vehicles that would satisfy primary sensor activation condition.<br>
The expression in this field must return a [[Boolean|boolean]] value (e.g. "this && alive player").<br>
Condition must return [[Boolean]] value.<br>
Trigger conditions are tested every .5 seconds.
Trigger conditions are tested every .5 seconds.


==On Activation/Deactivation==
==On Activation/Deactivation==
- expressions define action that is performed when trigger condition changes to [[true]] or [[false]].<br>
Defines action that is performed when trigger condition changes to [[true]] or [[false]].<br>
Expression must either be an assignment or return nothing (see type [[Nothing]]).<br>
Expression must either be an assignment or return [[Nothing|nothing]].<br>
Variable denoting trigger can be created by filling in [[name]] field.
Variable denoting trigger can be created by filling in [[name]] field.<br>
Array variable '''thisList''' will contain a list of all vehicles that met the trigger condition (e.g. hint format ["%1 units in area",count thisList]).<br>


==Effects==
==Effects==
- allow the mission designer to add music, or environmental sounds to the mission. Many use the effects to create quick and easy cutscenes.
Allows the mission designer to add music, environmental sounds, or to display title messages.<br>
Many use the effects to create quick and easy cutscenes.






[[Category: Scripting_Topics ]]
[[Category: Scripting_Topics ]]

Revision as of 21:51, 22 July 2006

Introduction

Triggers are an essential function for mission designers. A trigger (sometimes called a sensor) allows a mission designer to control events within a mission. Some common uses for triggers are controlling the timing of squad moves, camera control in cutscene, or even play the appropriate music when the time is right.

Activation

How the trigger is activated.
There are several combinations that can be created to activate the trigger. The trigger can be used to check if east or west is present, not present, or even detected within the trigger. A trigger can also be used to set up radio commands.

Countdown

Defines (in seconds) how long to wait until On Activation is fired. Min, Max and Mid allow you to add some randomization to the time.

Condition

In addition to the 'Activation' options above, this field allows you to specify other conditions that have to be fulfilled before the Trigger activates.
By default only the boolean variable this is present in this field. It is set to the result of the main 'Activation' condition (e.g. 'east'/'present').
The expression in this field must return a boolean value (e.g. "this && alive player").
Trigger conditions are tested every .5 seconds.

On Activation/Deactivation

Defines action that is performed when trigger condition changes to true or false.
Expression must either be an assignment or return nothing.
Variable denoting trigger can be created by filling in name field.
Array variable thisList will contain a list of all vehicles that met the trigger condition (e.g. hint format ["%1 units in area",count thisList]).

Effects

Allows the mission designer to add music, environmental sounds, or to display title messages.
Many use the effects to create quick and easy cutscenes.