Eden Editor: Trigger: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (update)
(Add trigger's SFX note)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<div style="width:640px; margin: 0 auto 0 auto;">
{{TOC|side}}
A trigger is a virtual entity which executes an action once a specific condition is met.
A trigger is a virtual entity which executes an action once a specific condition is met.
[[File:3den_triggerArea3D.jpg|center]]
[[File:3den_triggerArea3D.jpg|center]]


== Trigger Area ==


A trigger has an area. It can be scaled in all axes and it can be rotated around Z (up) axis. Some areas have unlimited height by default, but that can be changed by manually adjusting their vertical scale. Setting it to negative value will make them unlimited vertically again.
A trigger has an area. It can be scaled in all axes and it can be rotated around Z (up) axis. Some areas have unlimited height by default, but that can be changed by manually adjusting their vertical scale. Setting it to negative value will make them unlimited vertically again.
Line 8: Line 10:




You can see it visualized both in the scene and in the map, but by default you cannot interact with it. However, when the trigger is selected, you can drag it by its area in the map.
You can see it visualised both in the scene and in the map, but by default you cannot interact with it. However, when the trigger is selected, you can drag it by its area in the map.
[[File:3den_triggerMove2D.gif|center]]
[[File:3den_triggerMove2D.gif|center]]


== Activation Condition ==


The activation condition can be based on the trigger area (e.g. no OFPOR present within a 500 m radius), but a scripted condition or combination of both can be applied as well.
The activation condition can be based on the trigger area (e.g. no OFPOR present within a 500 m radius), but a scripted condition or combination of both can be applied as well.
{{Feature|important|Animals are part of the civillian side. That means they can activate triggers which condition is set to "Civilian".}}


== Trigger Owner ==


Use '''Set Trigger Owner''' connection to assign the trigger to a specific group. It will change the available activation options from the general ones (e.g., any BLUFOR character) to the group specific ones (e.g., any member of the group).
Use the '''Set Trigger Owner''' connection to assign the trigger to a specific group. It will change the available activation options from the general ones (e.g. any BLUFOR character) to the group specific ones (e.g. any member of the group).
[[File:3den_connectTriggerOwner.gif|center]]
[[File:3den_connectTriggerOwner.gif|center]]




Using the '''Timer''' attribute, you can allow the trigger to be activated either after a certain period of time since the condition has been met, or while the condition is met for the specified duration.
== Timer ==
 
Using the '''Timer''' attribute, you can set the trigger to be activated either after a certain period of time since the condition has been met, or while the condition is met for the specified duration.
 
 
== On Activation ==


Once the condition is met, the trigger becomes activated. Its '''On Activation''' expression is executed, and connected waypoints or modules may be activated as well.


Once the condition is met, the trigger becomes activated. Its '''On Activation''' expression is executed, and the connected waypoints or modules may be activated as well.


== Repeatable ==


If the trigger is set as repeatable, it will be deactivated once the condition is not met anymore. Afterwards, the trigger can be activated again, and this can continue until the scenario ends.
If the trigger is set as repeatable, it will be deactivated once the condition is not met anymore. Afterwards, the trigger can be activated again, and this can continue until the scenario ends.
Line 29: Line 42:


Triggers are the primary way to design the scenario flow without use of external scripts. Find out more about their configuration in the tooltips of their attributes.
Triggers are the primary way to design the scenario flow without use of external scripts. Find out more about their configuration in the tooltips of their attributes.
</div>
 


== Attributes ==
== Attributes ==
<onlyinclude>
<!-- Exported from the game by BIS_fnc_3DENExportAttributes. Manual edits may be replaced by future exports. -->
<!-- Exported from the game by BIS_fnc_3DENExportAttributes. Manual edits may be replaced by future exports. -->
{| class="wikitable sortable"
{| class="wikitable sortable"
Line 46: Line 61:
| Init
| Init
| Unique system name. Can contain only letters, numbers and underscore. The name is not case sensitive, so 'someName' and 'SOMENAME' are treated as the same variables.
| Unique system name. Can contain only letters, numbers and underscore. The name is not case sensitive, so 'someName' and 'SOMENAME' are treated as the same variables.
| <small><tt>name</tt></small>
| <small>{{hl|name}}</small>
| [[String]]
| [[String]]
|-
|-
Line 52: Line 67:
| Init
| Init
| Trigger description. Players can see it in the radio menu when its activation is set to 'Radio'. Also visible in tooltip when hovering over the trigger in the editor.
| Trigger description. Players can see it in the radio menu when its activation is set to 'Radio'. Also visible in tooltip when hovering over the trigger in the editor.
| <small><tt>text</tt></small>
| <small>{{hl|text}}</small>
| [[String]]
| [[String]]
|-
|-
Line 58: Line 73:
| Transformation
| Transformation
| World coordinates in meters. X goes from West to East, Y from South to North and Z is height above terrain.
| World coordinates in meters. X goes from West to East, Y from South to North and Z is height above terrain.
| <small><tt>position</tt></small>
| <small>{{hl|position}}</small>
| [[Position3D]]
| [[Position#Introduction|Position3D]]
|-
|-
| '''Rotation'''
| '''Rotation'''
| Transformation
| Transformation
| Local rotation in degrees. X is pitch, Y is roll and Z is yaw.
| Local rotation in degrees. X is pitch, Y is roll and Z is yaw.
| <small><tt>rotation</tt></small>
| <small>{{hl|rotation}}</small>
| [[Number]]
| [[Number]]
|-
|-
| '''Size'''
| '''Size'''
| Transformation
| Transformation
| Area size in meters.
| Area size in meters in format [a, b, c].
| <small><tt>size2</tt></small>
| <small>{{hl|size3}}</small>
| [[Array]]
|-
| '''Size'''
| Transformation
| Area size in meters.
| <small><tt>size3</tt></small>
| [[Array]]
| [[Array]]
|-
|-
Line 86: Line 95:
* '''Rectangle'''
* '''Rectangle'''


| <small><tt>IsRectangle</tt></small>
| <small>{{hl|IsRectangle}}</small>
| [[Bool]]
| [[Boolean]]
|-
|-
| '''Type'''
| '''Type'''
Line 94: Line 103:
Available options:
Available options:
* '''None''' - No other effects except of those defined by 'On Activation' expression.
* '''None''' - No other effects except of those defined by 'On Activation' expression.
* '''Guarded by BLUFOR, Guarded by OPFOR, Guarded by Independent''' - The trigger position becomes a point to be guarded by the given side. Groups with a 'Guard' waypoint will protect all guard points in the scenario, prioritizing them by the distance and order in which they were placed (the first placed is the most important).
* '''Guarded by BLUFOR'''/'''OPFOR'''/'''Independent''' - The trigger position becomes a point to be guarded by the given side. Groups with a 'Guard' waypoint will protect all guard points in the scenario, prioritizing them by the distance and order in which they were placed (the first placed is the most important).
* '''Skip Waypoint''' - Meant to work with a waypoint linked to the trigger using the 'Set Waypoint Activation' connection. Once activated, the trigger will force the waypoint to skip. Particularly useful for 'Hold' or 'Guard' waypoint types, which do not complete automatically.
* '''Skip Waypoint''' - Meant to work with a waypoint linked to the trigger using the 'Set Waypoint Activation' connection. Once activated, the trigger will force the waypoint to skip. Particularly useful for 'Hold' or 'Guard' waypoint types, which do not complete automatically.
* '''End #1, End #2, End #3, End #4, End #5, End #6''' - Complete the scenario successfully.
* '''End #1'''/'''#2'''/'''#3'''/'''#4'''/'''#5'''/'''#6''' - Complete the scenario successfully.
* '''Lose''' - Fail the scenario.
* '''Lose''' - Fail the scenario.


| <small><tt>TriggerType</tt></small>
| <small>{{hl|TriggerType}}</small>
| [[String]]
| [[String]]
|-
|-
Line 109: Line 118:
* '''Any Player''' - Activated when any player of the given side satisfies the 'Activation Condition'.
* '''Any Player''' - Activated when any player of the given side satisfies the 'Activation Condition'.
* '''Anybody''' - Activated when any object satisfies the 'Activation Condition'.
* '''Anybody''' - Activated when any object satisfies the 'Activation Condition'.
* '''BLUFOR, OPFOR, Independent, Civilian, Game Logic''' - Activated when any object of the given side satisfies the 'Activation Condition'.
* '''BLUFOR'''/'''OPFOR'''/'''Independent'''/'''Civilian Game Logic''' - Activated when any object of the given side satisfies the 'Activation Condition'.
* '''Seized by BLUFOR, Seized by OPFOR, Seized by Independent''' - Activated when the given side is in control of the area. Strength matters, which means one tank can be in control of an area while ten enemy infantrymen are still present.
* '''Seized by BLUFOR'''/'''OPFOR'''/'''Independent''' - Activated when the given side is in control of the area. Strength matters, which means one tank can be in control of an area while ten enemy infantrymen are still present.
* '''Radio Alpha, Radio Bravo, Radio Charlie, Radio Delta, Radio Echo, Radio Foxtrot, Radio Golf, Radio Hotel, Radio India, Radio Juliet''' - Activated by a player using a radio command (accessible for the player by pressing 0-0 on a standard keyboard). The trigger 'Text' will be used as the command title.
* '''Radio Alpha'''/'''Bravo'''/'''Charlie'''/'''Delta'''/'''Echo'''/'''Foxtrot'''/'''Golf'''/'''Hotel'''/'''India'''/'''Juliet''' - Activated by a player using a radio command (accessible for the player by pressing 0-0 on a standard keyboard). The trigger's 'Text' will be used as the command title.


| <small><tt>ActivationBy</tt></small>
| <small>{{hl|ActivationBy}}</small>
| [[String]]
| [[String]]
|-
|-
Line 125: Line 134:
* '''Any Group Member''' - Activated when anyone from the owner's group satisfies the 'Activation Condition'.
* '''Any Group Member''' - Activated when anyone from the owner's group satisfies the 'Activation Condition'.


| <small><tt>activationByOwner</tt></small>
| <small>{{hl|activationByOwner}}</small>
| [[String]]
| [[String]]
|-
|-
Line 134: Line 143:
* '''Present''' - Activated when objects are in the area.
* '''Present''' - Activated when objects are in the area.
* '''Not Present''' - Activated when objects are not in the area.
* '''Not Present''' - Activated when objects are not in the area.
* '''Detected by BLUFOR, Detected by OPFOR, Detected by Independent, Detected by Civilian''' - Activated when objects are in the area and are discovered by the given side.
* '''Detected by BLUFOR'''/'''OPFOR'''/'''Independent'''/'''Civilian''' - Activated when objects are in the area and are discovered by the given side.


| <small><tt>activationType</tt></small>
| <small>{{hl|activationType}}</small>
| [[String]]
| [[String]]
|-
|-
Line 142: Line 151:
| Activation
| Activation
| Repetition rules. When enabled, the trigger can be activated again once deactivated.
| Repetition rules. When enabled, the trigger can be activated again once deactivated.
| <small><tt>repeatable</tt></small>
| <small>{{hl|repeatable}}</small>
| [[Bool]]
| [[Boolean]]
|-
|-
| '''Server Only'''
| '''Server Only'''
| Activation
| Activation
| When enabled, the trigger will be evaluated only on server.
| When enabled, the trigger will only be created and evaluated on the server.
| <small><tt>isServerOnly</tt></small>
| <small>{{hl|isServerOnly}}</small>
| [[Bool]]
| [[Boolean]]
|-
|-
| '''Condition'''
| '''Condition'''
Line 158: Line 167:
* thisList - list of all objects in trigger area, based on 'Activation'
* thisList - list of all objects in trigger area, based on 'Activation'
* thisTrigger - trigger object
* thisTrigger - trigger object
| <small><tt>condition</tt></small>
| <small>{{hl|condition}}</small>
| [[String]]
| [[String]]
|-
| '''Interval'''
| Expression
| How frequently the trigger condition is evaluated in seconds.
| <small>{{hl|triggerInterval}}</small>
| [[Number]]
|-
|-
| '''On Activation'''
| '''On Activation'''
Line 167: Line 182:
* thisList - list of all objects in trigger area, based on 'Activation'
* thisList - list of all objects in trigger area, based on 'Activation'
* thisTrigger - trigger object
* thisTrigger - trigger object
| <small><tt>onActivation</tt></small>
| <small>{{hl|onActivation}}</small>
| [[String]]
| [[String]]
|-
|-
| '''On Deactivation'''
| '''On Deactivation'''
| Expression
| Expression
| Expression executed once the trigger is deactivated.
| Expression executed once the trigger is deactivated. {{Feature|informative|This only concerns '''Repeatable''' triggers.}}
Passed variables are:
Passed variables are:
* thisTrigger - trigger object
* thisTrigger - trigger object
| <small><tt>onDeactivation</tt></small>
| <small>{{hl|onDeactivation}}</small>
| [[String]]
| [[String]]
|-
|-
Line 185: Line 200:
* '''Timeout''' - The trigger's conditions must be satisfied for the specified duration for the trigger to be activated.
* '''Timeout''' - The trigger's conditions must be satisfied for the specified duration for the trigger to be activated.


| <small><tt>interuptable</tt></small>
| <small>{{hl|interuptable}}</small>
| [[Bool]]
| [[Boolean]]
|-
|-
| '''Timer Values'''
| '''Timer Values'''
| Timer
| Timer
| Timer values in seconds, selected randomly in a range from Min to Max, gravitating towards Mid.
| Timer values in seconds, selected randomly in a range from Min to Max, gravitating towards Mid.
| <small><tt>timeout</tt></small>
| <small>{{hl|timeout}}</small>
| [[Array]] in format [min, mid, max]
| [[Array]] in format [min, mid, max]
|-
|-
Line 197: Line 212:
| Effects
| Effects
| Condition for effects to be played, must return boolean expression.
| Condition for effects to be played, must return boolean expression.
| <small><tt>effectCondition</tt></small>
| <small>{{hl|effectCondition}}</small>
| [[String]]
| [[String]]
|-
|-
Line 203: Line 218:
| Effects
| Effects
| Sound played upon activation.
| Sound played upon activation.
| <small><tt>sound</tt></small>
| <small>{{hl|sound}}</small>
| [[String]]
| [[String]]
|-
|-
Line 209: Line 224:
| Effects
| Effects
| Sound spoken by the first unit which activated the trigger.
| Sound spoken by the first unit which activated the trigger.
| <small><tt>voice</tt></small>
| <small>{{hl|voice}}</small>
| [[String]]
| [[String]]
|-
|-
Line 215: Line 230:
| Effects
| Effects
| Environment sounds played upon activation.
| Environment sounds played upon activation.
| <small><tt>soundEnvironment</tt></small>
| <small>{{hl|soundEnvironment}}</small>
| [[String]]
| [[String]]
|-
|-
| '''SFX'''
| '''SFX'''
| Effects
| Effects
| Sound effect played by the trigger upon activation. Repeats as long as the trigger is active.
| Sound effect played by the trigger upon activation. Repeats as long as the repeatable trigger is active or forever for non-repeatable triggers.
| <small><tt>soundTrigger</tt></small>
| <small>{{hl|soundTrigger}}</small>
| [[String]]
| [[String]]
|-
|-
Line 227: Line 242:
| Effects
| Effects
| Music played upon activation. Replaces previously playing music track.
| Music played upon activation. Replaces previously playing music track.
| <small><tt>music</tt></small>
| <small>{{hl|music}}</small>
| [[String]]
| [[String]]
|-
|-
Line 233: Line 248:
| Effects
| Effects
| User interface overlay shown upon activation.
| User interface overlay shown upon activation.
| <small><tt>title</tt></small>
| <small>{{hl|title}}</small>
| [[String]]
| [[String]]
|}
|}
</onlyinclude>
</onlyinclude>


[[Category:Eden Editor|Triggers]]
 
[[Category:Eden Editor: Asset Types|Triggers]]
[[Category:Eden Editor: Asset Types|Triggers]]

Latest revision as of 16:37, 15 October 2024

A trigger is a virtual entity which executes an action once a specific condition is met.

3den triggerArea3D.jpg


Trigger Area

A trigger has an area. It can be scaled in all axes and it can be rotated around Z (up) axis. Some areas have unlimited height by default, but that can be changed by manually adjusting their vertical scale. Setting it to negative value will make them unlimited vertically again.

3den triggerAreaZ.gif


You can see it visualised both in the scene and in the map, but by default you cannot interact with it. However, when the trigger is selected, you can drag it by its area in the map.

3den triggerMove2D.gif


Activation Condition

The activation condition can be based on the trigger area (e.g. no OFPOR present within a 500 m radius), but a scripted condition or combination of both can be applied as well.

Animals are part of the civillian side. That means they can activate triggers which condition is set to "Civilian".


Trigger Owner

Use the Set Trigger Owner connection to assign the trigger to a specific group. It will change the available activation options from the general ones (e.g. any BLUFOR character) to the group specific ones (e.g. any member of the group).

3den connectTriggerOwner.gif


Timer

Using the Timer attribute, you can set the trigger to be activated either after a certain period of time since the condition has been met, or while the condition is met for the specified duration.


On Activation

Once the condition is met, the trigger becomes activated. Its On Activation expression is executed, and connected waypoints or modules may be activated as well.


Repeatable

If the trigger is set as repeatable, it will be deactivated once the condition is not met anymore. Afterwards, the trigger can be activated again, and this can continue until the scenario ends.


Triggers are the primary way to design the scenario flow without use of external scripts. Find out more about their configuration in the tooltips of their attributes.


Attributes

Info Development
Name Category Description Property Type
Variable Name Init Unique system name. Can contain only letters, numbers and underscore. The name is not case sensitive, so 'someName' and 'SOMENAME' are treated as the same variables. name String
Text Init Trigger description. Players can see it in the radio menu when its activation is set to 'Radio'. Also visible in tooltip when hovering over the trigger in the editor. text String
Position Transformation World coordinates in meters. X goes from West to East, Y from South to North and Z is height above terrain. position Position3D
Rotation Transformation Local rotation in degrees. X is pitch, Y is roll and Z is yaw. rotation Number
Size Transformation Area size in meters in format [a, b, c]. size3 Array
Shape Transformation Area shape.

Available options:

  • Ellipse
  • Rectangle
IsRectangle Boolean
Type Activation Trigger type, determines special behavior upon activation.

Available options:

  • None - No other effects except of those defined by 'On Activation' expression.
  • Guarded by BLUFOR/OPFOR/Independent - The trigger position becomes a point to be guarded by the given side. Groups with a 'Guard' waypoint will protect all guard points in the scenario, prioritizing them by the distance and order in which they were placed (the first placed is the most important).
  • Skip Waypoint - Meant to work with a waypoint linked to the trigger using the 'Set Waypoint Activation' connection. Once activated, the trigger will force the waypoint to skip. Particularly useful for 'Hold' or 'Guard' waypoint types, which do not complete automatically.
  • End #1/#2/#3/#4/#5/#6 - Complete the scenario successfully.
  • Lose - Fail the scenario.
TriggerType String
Activation Activation What or who can activate the trigger. Some options further depend on 'Activation Condition'.

Available options:

  • None - No default activation, only a custom condition expression can activate the trigger.
  • Any Player - Activated when any player of the given side satisfies the 'Activation Condition'.
  • Anybody - Activated when any object satisfies the 'Activation Condition'.
  • BLUFOR/OPFOR/Independent/Civilian Game Logic - Activated when any object of the given side satisfies the 'Activation Condition'.
  • Seized by BLUFOR/OPFOR/Independent - Activated when the given side is in control of the area. Strength matters, which means one tank can be in control of an area while ten enemy infantrymen are still present.
  • Radio Alpha/Bravo/Charlie/Delta/Echo/Foxtrot/Golf/Hotel/India/Juliet - Activated by a player using a radio command (accessible for the player by pressing 0-0 on a standard keyboard). The trigger's 'Text' will be used as the command title.
ActivationBy String
Activation Activation What or who can activate the trigger. Some options further depend on 'Activation Type'. The available options are specific to the connected trigger owner.

Available options:

  • Owner Only - Activated when the connected trigger owner (or its vehicle, if the owner is a crew member) satisfies the 'Activation Condition'.
  • Whole Group - Activated when all the owner's group members satisfy the 'Activation Condition'.
  • Group Leader - Activated when leader of the owner's group satisfies the 'Activation Condition'.
  • Any Group Member - Activated when anyone from the owner's group satisfies the 'Activation Condition'.
activationByOwner String
Activation Type Activation Condition of the 'Activation' attribute.

Available options:

  • Present - Activated when objects are in the area.
  • Not Present - Activated when objects are not in the area.
  • Detected by BLUFOR/OPFOR/Independent/Civilian - Activated when objects are in the area and are discovered by the given side.
activationType String
Repeatable Activation Repetition rules. When enabled, the trigger can be activated again once deactivated. repeatable Boolean
Server Only Activation When enabled, the trigger will only be created and evaluated on the server. isServerOnly Boolean
Condition Expression Repeatedly calculated condition, must return boolean expression. When true, the trigger will be activated.

Passed variables are:

  • this - boolean value of activation condition
  • thisList - list of all objects in trigger area, based on 'Activation'
  • thisTrigger - trigger object
condition String
Interval Expression How frequently the trigger condition is evaluated in seconds. triggerInterval Number
On Activation Expression Expression executed once the trigger is activated.

Passed variables are:

  • thisList - list of all objects in trigger area, based on 'Activation'
  • thisTrigger - trigger object
onActivation String
On Deactivation Expression Expression executed once the trigger is deactivated.
This only concerns Repeatable triggers.

Passed variables are:

  • thisTrigger - trigger object
onDeactivation String
Timer Type Timer Type of activation timer.

Available options:

  • Countdown - Once the conditions are met, the trigger will activate after the specified amount of time has elapsed.
  • Timeout - The trigger's conditions must be satisfied for the specified duration for the trigger to be activated.
interuptable Boolean
Timer Values Timer Timer values in seconds, selected randomly in a range from Min to Max, gravitating towards Mid. timeout Array in format [min, mid, max]
Effect Condition Effects Condition for effects to be played, must return boolean expression. effectCondition String
Sound Effects Sound played upon activation. sound String
Voice Effects Sound spoken by the first unit which activated the trigger. voice String
Environment Effects Environment sounds played upon activation. soundEnvironment String
SFX Effects Sound effect played by the trigger upon activation. Repeats as long as the repeatable trigger is active or forever for non-repeatable triggers. soundTrigger String
Music Effects Music played upon activation. Replaces previously playing music track. music String
UI Overlay Effects User interface overlay shown upon activation. title String