Difference between revisions of "Triggers"

From War Thunder Wiki
Jump to: navigation, search
m (Make fields descriptions for actions expandable)
(Seeing as someone else has added some stuff I added what I've got so far (been working on it for a while). Where we have both covered same triggers I merged text, keeping best of both. Have also tweaked formatting to keep consistency with rest of page.)
Line 741: Line 741:
 
This is a list of all Actions and their known behaviour. '''Note:''' This list is user-provided, there could be missing actions or the described behaviour could be incorrect
 
This is a list of all Actions and their known behaviour. '''Note:''' This list is user-provided, there could be missing actions or the described behaviour could be incorrect
  
[[Category:War Thunder CDK]]
+
{| class="wikitable mw-collapsible" style="width: 95%;"
[[Category:Custom missions]]
 
{| class="wikitable mw-collapsible"
 
 
|+Actions List
 
|+Actions List
!Action
+
! style="width: 20%;" |Action
!Description
+
! style="width: 70%;" |Description
!MP/SP
+
! style="width: 5%;" |MP/SP
!Working
+
! style="width: 5%;" |Working
 
|-
 
|-
 
|addAirfield
 
|addAirfield
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Adds a virtual airfield using the given areas<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Adds a virtual airfield using the given areas<div class="mw-collapsible-content">
 +
This trigger is used to make an airfield already present as part of the map a functioning airfield in the mission, use of this trigger is not needed for aircraft carriers and airfields made using the "dynaf_" object groups.
 
'''Fields:'''
 
'''Fields:'''
 
 
* runwayStart: The area you want to be the beginning of the runway
 
* runwayStart: The area you want to be the beginning of the runway
 
* runwayEnd: The area you want to be the end of the runway (can be placed in diagonal)
 
* runwayEnd: The area you want to be the end of the runway (can be placed in diagonal)
Line 759: Line 757:
 
* army: To what army this airfield should belong  to
 
* army: To what army this airfield should belong  to
 
* spawnPoint: The area where you want the planes to spawn. '''Note:''' Multiple can be added
 
* spawnPoint: The area where you want the planes to spawn. '''Note:''' Multiple can be added
* visibleOnHud: If checked, the airfield icon will be shown to players</div></div>
+
* visibleOnHud: If checked, the airfield icon will be shown to players
|Unknown
+
* cable: Creates an arrestor cable, once added requires start and end fields be specified, multiple cables can be created.
|Unknown
+
** start: An area is specified as the start of the cable
 +
** end: An area is specified as the end of the cable
 +
</div></div>
 +
|Both
 +
|Yes
 
|-
 
|-
 
|addTextToUnit
 
|addTextToUnit
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Adds text on the given unit<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Adds text on the given unit<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
 
* langID: The identifier of the text to add
 
* langID: The identifier of the text to add
 
* fontSize: The text size
 
* fontSize: The text size
* target: The target unit</div></div>
+
* target: The target unit
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldSetIndication
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Makes airfield flash green on map / radar<div class="mw-collapsible-content">
 +
'''Fields:'''
 +
* target: Assign the area set as the start of the runway (if airfield was created using the addAirfield action) or the object group / carrier unit here (if airfield was made using a dynaf_ object group or AI aircraft carrier unit)
 +
* team: Which team the airfield should appear as flashing for "A", "B" or "Both" or "None"
 +
* set: If the airfield indication should be turn on or off by the trigger
 +
</div></div>
 +
|Both
 +
|Yes
 +
|-
 +
|airfieldSetVisibility
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">This action does not appear to currently be functional<div class="mw-collapsible-content">
 +
Presumably this action should change the airfield's visibility on the map / radar, but it currently appears to do nothing.
 +
 
 +
'''Fields:'''
 +
* target: Assign the area set as the start of the runway (if airfield was created using the addAirfield action) or the object group / carrier unit here (if airfield was made using a dynaf_ object group or AI aircraft carrier unit)
 +
* team: Which team the airfield should be visible / invisible to
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldGetModuleHP
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to get the HP of a part of an airfield and save it to a real (decimal number) variable.
 +
 
 +
'''Fields:'''
 +
* object: The airfield to check
 +
* module: The part of the airfield to get the HP of  of
 +
* var: The variable to save the HP to
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldSetModuleHP
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to set the HP of a part of an airfield and save it to a real (decimal number) variable.
 +
 
 +
'''Fields:'''
 +
* object: The airfield to set the hp of
 +
* module: The part of the airfield to set the HP of
 +
* hp: A number accurate to 2 decimal places, what to set the HP of the part of the airfield to
 +
* hp_var: A real (decimal number) variable can be assigned here to override the value of the "hp" field
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldAddModuleHP
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to add a set number to the HP of a part of an airfield and save it to a real (decimal number) variable.
 +
 
 +
'''Fields:'''
 +
* object: The airfield to add to the hp of
 +
* module: The part of the airfield to add to the HP of
 +
* hp: A number accurate to 2 decimal places, what value to add to the HP of the part of the airfield
 +
* hp_var: A real (decimal number) variable can be assigned here to override the value of the "hp" field
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldSetFuelMul
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is refueled, however testing has shown it to have no effect
 +
 
 +
'''Fields:'''
 +
* object: The airfield to apply the multiplier to
 +
* fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of refueling
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldSetReloadMul
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is reloaded, however testing has shown it to have no effect
 +
 
 +
'''Fields:'''
 +
* object: The airfield to apply the multiplier to
 +
* fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of reloading
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|airfieldSetRepairMul
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is refueled, however testing has shown it to have no effect
 +
 
 +
'''Fields:'''
 +
* object: The airfield to apply the multiplier to
 +
* fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of repairing
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|awardAchievement
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
Presumably this action is designed to award achievements to the player, but in testing it has had effect.
 +
 
 +
'''Fields:'''
 +
* achievement: Allows the selection of a "localization string" from a very long list, not clear what this does functionally
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
|changeUnit
 +
|This action does not appear to currently be functional
 +
|Unknown
 +
|Unknown
 +
|-
 +
|checkEntity
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Functionality unknown<div class="mw-collapsible-content">
 +
'''Fields:'''
 +
* entities: Allows the selection of an entity (presumably to check)
 +
</div></div>
 
|Unknown
 
|Unknown
 
|Unknown
 
|Unknown
 
|-
 
|-
 
|comment
 
|comment
|Allows you to put comments in the actions list
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Adds comments to the trigger for documentation purposes<div class="mw-collapsible-content">
 +
This action has no effect, it is coloured green in the editor and is used to simply add text comments to the trigger in the editor to document what it does.
 +
 
 +
'''Fields:'''
 +
* value: The comment to appear in the trigger
 +
</div></div>
 
|Both
 
|Both
 
|Yes
 
|Yes
 
|-
 
|-
 
|countUnitsKilledByTeam
 
|countUnitsKilledByTeam
|<div class="mw-collapsible mw-collapsed" style="width:100%">Convenience action that lets you set an automatic counter<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Counts the number of units killed by the specified team and assigns the value to a variable<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
  
 
* team: The team to track kills from, can be both
 
* team: The team to track kills from, can be both
* var: You need to first create a variable of type '''Integer''' (usually with a base value of 0) and then provide it here</div></div>
+
* var: You need to first create a variable of type '''Integer''' (usually with a base value of 0) and then provide it here
 +
</div></div>
 
|Both
 
|Both
|Unknown
+
|Yes
 
|-
 
|-
 
|beginRaceMode
 
|beginRaceMode
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Starts a plane or tank race with the given settings<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Starts a plane or tank race with the given settings<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
+
* tankRace: If checked the race will be treated as a tank race, if unchecked the race will be treated as an air race.
* tankRace: If unchecked, will be a plane race
+
* groundFxType: For tank races lets you override the effect played at each waypoint
* checkAreaPrefix: The prefix for the checkpoint areas you created, the default prefix is <code>check_</code> , meaning the checkpoints need to be named like the following: <code>check_01</code>, <code>check_02</code>and so on...
+
* checkAreaPrefix: The prefix you chose for the waypoints (the area the player must pass through)
* waypointsPrefix: The same as '''checkAreaPrefix''' but for waypoints
+
* waypointsPrefix: If you want the waypoint effect to play at a different place to the waypoint's actual area you can create another set of areas with a different prefix, following the same rules as above, and specify that prefix here. '''Most of the time just set this to the same as the checkAreaPrefix''' field.
* statisticsScreenAfterFinish: If unchecked, the statistics won't be automatically shown to the players</div></div>
+
* doubleWaypoints: If the waypoint aster the current one should be shown
|Unknown
+
* waypointScale: Adjusts the size of the waypoint effect
|Unknown
+
* respawnVerticalOffset: How high the player should respawn relative to the waypoint
 +
* respawnForwardOffset: How far forwards the player should respawn relative to the waypoint
 +
* statisticsScreenAfterFinish: If ticked once players have finished the race they will be forced into the satistics screen
 +
* reverse: If the waypoints should be followed in reverse order (highest number to lowest number), mostly used for triggers launcuing the race when the user selects revere mode (used in conjunction with the missionNamePostfix condition)
 +
* isPathClosed: If the last waypoint of the race links back up to first waypoint (forming a circuit) or if it does not (race starts at one point, and ends at another).
 +
* defaultTimeToDisableWeapon: How long after start to disable player weapons (most races opt to use other actions such as the cannotShoot option in unitSetProperties to disable player weaponry).
 +
</div></div>
 +
|MP Only
 +
|Yes
 +
|-
 +
| bigQueryAddRecord
 +
| Functionality unknown
 +
| Unknown
 +
| Unknown
 +
|-
 +
| getOwnArea
 +
| Functionality unknown
 +
| Unknown
 +
| Unknown
 +
|-
 +
| hangarGetCountryNum
 +
| Functionality unknown
 +
| Unknown
 +
| Unknown
 
|-
 
|-
 
|makeSquad
 
|makeSquad
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Creates a squad from the given unit<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Creates a squad from the given unit<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
 
* name: The name of the squad, optional
 
* name: The name of the squad, optional
* object: The unit to add to the squad, can be multiple</div></div>
+
* object: The unit to add to the squad, can be multiple
 +
</div></div>
 
|Both
 
|Both
 
|Unknown
 
|Unknown
Line 810: Line 956:
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Same than '''makeSquad''' but with more options<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Same than '''makeSquad''' but with more options<div class="mw-collapsible-content">
 
'''Additional fields:'''
 
'''Additional fields:'''
 
+
* object_type: Allows you to filter any unit in the given list according to the given status
* object_type: Allows you to filter any unit in the given list according to the given status</div></div>
+
</div></div>
 
|Both
 
|Both
 
|Unknown
 
|Unknown
Line 818: Line 964:
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Same than above, but instead creates the '''head (leading) squad'''<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Same than above, but instead creates the '''head (leading) squad'''<div class="mw-collapsible-content">
 
'''Additional fields:'''
 
'''Additional fields:'''
 
 
* removeOnKill: If checked, the squad will be removed once killed
 
* removeOnKill: If checked, the squad will be removed once killed
 +
</div></div>
 
|Both
 
|Both
 
|Unknown
 
|Unknown
 
|-
 
|-
|missionAttempts
+
| missionAttempts
|<div class="mw-collapsible mw-collapsed" style="width:100%">Modify the amount of attempts the player has to complete the mission<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Allows you to modify how many attempts the player gets at a mission<div class="mw-collapsible-content">
 +
Each time a player dies in a single player mission they loose one attempt (by default you get 5, so 4 respawns); this trigger allows you to modify how many they have left. '''NOTE:''' The game works by counting deaths, so using "set" and "1" will set the player to 1 death (3 respawns remaining), not set the to 1 attempt left.
 +
 
 
'''Fields:'''
 
'''Fields:'''
 
 
* action: The modification to do, where:
 
* action: The modification to do, where:
 
** '''increase''' adds the given value to the existing amount of attempts
 
** '''increase''' adds the given value to the existing amount of attempts
Line 832: Line 979:
 
** '''restore''' gives back attempts based on the given value and the amount of attempts already lost by the player
 
** '''restore''' gives back attempts based on the given value and the amount of attempts already lost by the player
 
** '''set''' defines the base amount of attempts
 
** '''set''' defines the base amount of attempts
* value: The value to increase by, reduce from, restores attempts by or to set as base amount</div></div>
+
* value: An integer value to apply to the death count
|SP
+
</div></div>
 +
|SP Only
 
|Yes
 
|Yes
 
|-
 
|-
|missionBattleArea
+
| missionBattleArea
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the battle area and its layers to the given areas<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Allows you to restrict the battle area to within a specified area<div class="mw-collapsible-content">
 +
This action is used to either restrict the map to a certain area (make it smaller), or specify areas where players will be killed / spotted if they enter.
 +
 
 +
'''Notes:'''
 +
* Vertical hight of the area is irrelevant, if area is 10km x 10km x 2km then the player can go as high as they like as long as they are within the 10km x 10km area.
 +
* Anywhere out of the battle area (air and ground) and not inside the killOutOfBattleArea will display the warning message "Return to the battlefield" constantly to the player until they go back inside the battle area
 +
* You can add multiple areas to set them as a whole at once (example: You select your 4 "north_restricted_area", "south_restricted_area", "east_restricted_area", "west_restricted_area" areas and check the killOutOfBattleArea field to combine their coverage)
 +
 
 
'''Fields:'''
 
'''Fields:'''
 
+
* area: The area(s) you want the trigger to act on. Multiple areas can be selected whether they overlap or not. The inside of each selected area will be affected by the trigger, all other area in the map will not be.
* area: The area(s) to configure
+
* message: Does not appear to currently be functional
* air: If checked, sets the given area(s) to be the battle area for air warfare
+
* air: If ticked the battle area will be restricted for aircraft
* ground: If checked, sets the given area(s) to be the battle area for ground warfare
+
* ground: If ticked the battle area will be restricted for ground vehicles
 
* mapArea: If checked, sets the given area(s) to be the area shown on the minimap of ground vehicles
 
* mapArea: If checked, sets the given area(s) to be the area shown on the minimap of ground vehicles
 
* airMapArea: If checked, sets the given area(s) to be the area shown on the minimap of air vehicles
 
* airMapArea: If checked, sets the given area(s) to be the area shown on the minimap of air vehicles
* killArea: If checked, sets the restricted areas where the player dies if they stay in for more than 25 seconds. This one is regularly used for spawn-kill protection
+
* killArea: If checked, then the areas become a "kill area", players in them for more than 25 seconds will be destroyed (only works for ground units). This one is regularly used for spawn-kill protection.
* detectionArea: If checked, sets the area in which the player constantly appears on the enemy map (even in realistic). This one is regularly used for soft spawn-kill protection (usually larger than the '''killArea''' as it doesn't outright kill intruders)
+
* detectionArea: If checked, sets the area in which the player constantly appears on the enemy map (even in realistic). This one is regularly used for soft spawn-kill protection (usually larger than the killArea as it doesn't outright kill intruders)
* killOutOfBattleArea: If checked, sets the restricted areas considered "out of the battle" where the player dies should they fail to go back to the battle area
+
* killOutOfBattleArea: If checked, sets the restricted areas considered "out of the battle" where the player dies should they fail to go back to the battle area
* gridCellCount: The amount of cells on the map grid, you first need to create a variable of type '''Integer''' and then provide it here
+
* newGridHorizontalCellCount: How many grid squares should be drawn between each edge of the battle area
* team: To what teams should the given areas apply to, regularly used to specify '''killAreas''' and '''detectionAreas''' specific to each team
+
* gridCellCountVar: An integer variable can be assigned here to override the value of the "newGridHorizontalCellCount" field
 
+
* team: To what teams should the given areas apply to, regularly used to specify killAreas and detectionAreas specific to each team
'''Notes:'''
+
</div></div>
 
 
-Anywhere out of the '''battle area''' ('''air''' and '''ground''') and not inside the '''killOutOfBattleArea''' will display the warning message "Return to the battlefield" constantly to the player until they go back inside the '''battle area'''
 
 
 
-You can add multiple areas to set them as a whole at once (example: You select your 4 "north_restricted_area", "south_restricted_area", "east_restricted_area", "west_restricted_area" areas and check the '''killOutOfBattleArea''' field to combine their coverage)</div></div>
 
 
|Both
 
|Both
 
|Yes
 
|Yes
 
|-
 
|-
|missionCompleted
+
| missionComplete
|<div class="mw-collapsible mw-collapsed" style="width:100%">Marks the mission as complete, ends the battle<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the mission as complete (victory) for the selected team, ends the battle<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
+
* team: Which team completed the mission (the winning team)
* team: Whose team completed the mission
+
* timer: If a timer should be displayed until the mission ends and the player is returned to the hangar (if enabled it gives option to continue playing after the mission has ended, if disabled that option is not available)
* debriefingTimer: Amount of time in seconds to wait before sending the players back to the hangar
+
* debtiefingTimer: If the timer option is disabled, amount of time in seconds to wait before sending the players back to the hangar
 
* showCompleteMessage: If checked, displays the mission complete message
 
* showCompleteMessage: If checked, displays the mission complete message
 
* playCompleteMusic: If checked, plays the mission complete music
 
* playCompleteMusic: If checked, plays the mission complete music
* startReplayCamera: If checked, players will be taken to the replay instead of the hangar
+
* startReplayCamera: Removes control from player and puts them into cinematic camera position until they return to hangar
* afterComplete: Allows you to manually select a Trigger to run after that</div></div>
+
* afterComplete: Selects a trigger to run the actions of once the mission is completed (like the "triggerActivate" action)
 +
</div></div>
 
|Both
 
|Both
 
|Yes
 
|Yes
 +
|-
 +
| missionCustomArtillery
 +
|<div class="mw-collapsible mw-collapsed" style="width:100%">Enables custom artillery (unknown how or if custom artillery currently works)<div class="mw-collapsible-content">
 +
'''Fields:'''
 +
* enabled: If custom artillery should be enabled
 +
</div></div>
 +
|Unknown
 +
|Unknown
 +
|-
 +
| missionDebriefing
 +
| Forces the player back to the hangar, works only after mission has been completed
 +
| Unknown
 +
| Yes
 
|-
 
|-
 
|missionDestroyArea
 
|missionDestroyArea
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Marks the given area(s) as destruction objectives<div class="mw-collapsible-content">
 
|<div class="mw-collapsible mw-collapsed" style="width:100%">Marks the given area(s) as destruction objectives<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
 
* area: The area(s) to use
 
* area: The area(s) to use
* target_type: What kind of targets in the given area(s) needs to be destroyed</div></div>
+
* target_type: What kind of targets in the given area(s) needs to be destroyed
 +
</div></div>
 
|Both
 
|Both
 
|Unknown
 
|Unknown
 
|-
 
|-
 
|missionGetBalanceLevel
 
|missionGetBalanceLevel
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the mission's balance level to the given variable<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Gets the mission's balance level and stores it in the given variable<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
+
* input_var: You first need to create a variable of type '''Integer''', and then provide it here
* input_var: You first need to create a variable of type '''Integer''', set the value you want, and then provide it here</div></div>
+
</div></div>
 
|Both
 
|Both
 
|Unknown
 
|Unknown
 
|-
 
|-
|missionGetBombingAreaHP
+
| missionGetBombingAreaHP
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the HPs of one of the mission's bombing areas to the given variable<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Gets the remaining HP of a bombing area and assigns it to a variable<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
+
* target: The bombing area(s) to check
* input_var: You first need to create a variable of type '''Real''', set the value you want, and then provide it here</div></div>
+
* input_Var: The variable (type "real") to store the area's HP in
 +
</div></div>
 
|Both
 
|Both
|Unknown
+
|Yes
 
|-
 
|-
|missionGetMaxPlayers
+
| missionGetMaxPlayers
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the maximum amount of players to the given variable<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Gets the maximum amount of players allowed in the game (set before mission is launched) and assigns it to a variable<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 
+
* input_Var: The integervariable to store the max number of players in
* input_var: You first need to create a variable of type '''Integer''', set the value you want, and then provide it here</div></div>
+
</div></div>
|MP
+
| MP Only
|Unknown
+
| Yes
 
|-
 
|-
|missionGetMaxRespawns
+
| missionGetMaxRepawns
|<div class="mw-collapsible mw-collapsed" style="width:100%">Sets the maximum amount of respawn for each player to the given variable<div class="mw-collapsible-content">
+
|<div class="mw-collapsible mw-collapsed" style="width:100%">Gets the maximum number of respawns and assigns it to a variable (unclear if working currently)<div class="mw-collapsible-content">
 
'''Fields:'''
 
'''Fields:'''
 +
* input_Var: The integer variable to store the max number of respawns in
 +
</div></div>
 +
| Unknown
 +
| Unknown
 +
|-
 +
|}
  
* input_var: You first need to create a variable of type '''Integer''', set the value you want, and then provide it here</div></div>
+
[[Category:War Thunder CDK]]
|MP
+
[[Category:Custom missions]]
|Unknown
 
|}
 

Revision as of 09:20, 4 October 2019

Introducing Wiki 3.0


Triggers are an integral part of anything but the most basic of User Missions. This article cover the basic operation of triggers and what each available component does.

Overview

Triggers are a feature of the Mission Editor which allow for vastly more complicated missions to be be created, they can used for scripted events, as well as for enabling more advanced mission features such as capture points, spawn points, visible way-points, and much more. As well as being useful for making more advanced single player missions an understanding of triggers is a necessity for creating multi-player user missions, as such missions require triggers in order to function.

Triggers consist of three main components (also known as elements): Events, Conditions, and Actions. An event is what causes the trigger to executed, for example the "periodicEvent" event will execute the trigger once every user defined period of time (for example once a second, or once every 15 seconds). Once a trigger is executed a condition determines whether the trigger should continue on to carry out the actions assigned to it, or should not do anything / carry out any else actions assigned to it; for example the "UnitInArea" condition will carry out the triggers actions if the specified unit is within the specified area at the moment the trigger is executed. Finally actions define what the trigger actually does once it is executed and the condition is met; for example "playHint" displays a message on the user's screen and "unitDamage" can be used to damage part of, or completely destroy a unit. Actions can also can also be assigned as "elseActions" which instead of being carried out when the condition is met, will be carried out when the trigger is executed, but the condition is not met. If there are no elseActions then the trigger will do nothing when the condition is not met. Triggers can be assigned multiple event, conditions and actions. If a trigger is created with no conditions then it will carry out its actions whenever it is executed, this is useful for triggers which always need to run, for example a trigger to draw various lines on the mini-map at the start of the mission. Be aware that if a trigger is created without conditions and "enableAfterComplete" is ticked then the trigger will run for ever, repeatedly every time tis event occurs (for a default trigger this means it would carry out its actions once a second, every second for the entirety of the mission, unless it is disabled by another trigger).

Creating Triggers

The Basics

The trigger window with a blank trigger (Trigger_01 selected), other triggers and categories are for demonstration purposes

In order to make a trigger you first need to display the trigger window in the mission editor, this can be done by clicking the "Properties and Triggers / Mission Obj. info" button (looks like CDK Open Triggers Window.jpg) on the mission editor bar at the top of the editor. This will open the "Triggers / Mission Obj. Info" window (from here on known as the "trigger window") at the right hand edge of your screen, this window is where you can edit triggers and mission objectives (for the time being it will be blank). Now in the properties window (where your mission settings are) scroll down until you reach the Triggers / Mission Ob. Navigation section and expand it if necessary.

This window is where all the triggers and objectives of your mission will be stored, organized under the (currently empty) "Triggers" and "Mission Objectives" folders. There are a number of buttons at the bottom of this section:

Trigger This button will create a new trigger, either inside the root "Triggers" folder inside the currently selected category.

Category This button will create a new category, either inside the root "Triggers" folder inside the currently selected category. Categories are essentially folders for triggers, functionally they serve no purpose to the mission and exist in order to allow you to organise your triggers. Categories can be created inside other categories and form folder trees which can be collapsed in order to hide triggers not currently of interest (collapsing categories will not disable or remove their contents). If a category is disabled all of its contents (including stuff in sub-categories) will be disabled.

Mission Obj This button will create a mission objective in the "Mission Objectives" folder. Mission objectives are described in other guides.

Copy and Paste The Copy button will copy the selected trigger of mission objective. If a mission objective is selected and the copy button is pressed then a duplicate mission objective will be created. If a trigger is selected when the copy button is pressed then the Paste button will become available this allows you to select a different category for the trigger to be pasted into, once the destination is selected pressing the Paste button will create a duplicate of the copied trigger there.

Del This button will delete the selected trigger or mission objective.

Up and Down These buttons will move the selected trigger, category or mission objective up or down in the list, this has no effect on the operation of the mission and is used in order to keep the lists organised.

In order to create your first trigger click the "Trigger" button, this will create your first trigger "Trigger_01" and display it in the trigger window. What you see will look similar to the image to the right (you will only have "Trigger_01" whereas the image has several other triggers, categories and objectives for demonstration purposes). At the top of the window is the triggers name, this can be changed to whatever you want (however should not the the same as any other triggers), it is best to pick a descriptive name such as "Setup" or "Teleport Player" to keep it clear what everything does, however this is completely optional. The next option is an "Enabled" check box by default all triggers start enabled, disabling a trigger effective stops it's event from functioning so it will never be executed; triggers can be enabled and disabled during the mission by other triggers. The next field is a comments box, this has no effect on the trigger's operation and is just for documenting what it does, it is completely optional.

Next is the trigger properties section this contains the following fields:

actionsType By default this is set to "PERFORM_ONE_BY_ONE" meaning the actions will be completed in the order they are present in the actions list of the trigger. This option can be changed to "PERFORM_ALL" where all actions are completed at the same time.

conditionsType By default this is set to "ALL", but can be changed to "ANY". For triggers with multiple conditions this determines whether all of the conditions need to be met in order for the trigger to carry out its actions, or if any of the conditions being me is enough for the trigger to carry out it's action.

enableAfterComplete By default this is set unchecked, meaning that once the trigger has carried out its actions it becomes disabled, if it is checked then the trigger will carry out its actions every time it is executed and the condition is met, instead of just the first time.

Now we have reached the "Elements" section, and below it the "Element" section (Gaijin could have come up with better names) this is where you build your trigger; the "Elements" section is where you create the events, conditions, actions, and else actions of your trigger, while the "Element" section is where you modify the properties of each component. The elements area consists of a window with four folders where the contents of your trigger will be displayed, and underneath a collection of buttons:

Event, Condition, Action and ElseAction These buttons will display a new window with a list off all the available events, conditions and actions, depending on what button is pressed (the Action and elseAction buttons display the same list of actions, but will insert them into either the Actions or ElseActions area. There is a search box which will find the first item matching the phrase entered, it will only return the first entry in the list however, there may be more matches further down. To inset a component select it from the list and click "Ok".

Up and Down These buttons will move the selected element up and down in the list. Changing the order of components only has an affect on the Actions and ElseActions area where the actions will be carried out in the order they appear in the list, if actionsType is set to "PERFORM_ONE_BY_ONE" (the default setting) in the trigger properties area.

Delete This button will delete the selected trigger component.

Copy' This will copy the selected trigger component, multiple components can be coped from different triggers (or the same one) without needing to press "Paste ..." each time.

Paste ... This button will display a list of all the copied components (grouped by type) and allow you to select one to paste into the currently selected trigger.

The "Element" section at the bottom will update with different fields and buttons depending on the currently selected trigger component.

Worked Example Trigger

The completed trigger and mission setup to Teleport a player

In this example we are going to make a simple trigger which will teleport the player to a new location when the player enters a specific area. For this example the player unit will be in a tank (placed as "tankModels" in the editor) called "Player", there will be an area called "Teleport_Area" and another called "Destination_Area" (exact setup can be seen in the image to the right). When the player tank enters "Teleport_Area" we want it to be teleported to "Destination_Area".

To follow along with this example create a "tankModels" unit type, assign it as the player's vehicle, call it "Player" and set it to a tank you own. Create two box areas for the teleport and destination areas (called "Teleport_Area" and "Destination_Area"). If not already present from reading the previous section create a new trigger.

You should now have a fresh trigger (likely called Trigger_01 or similar), we will begin by renaming the trigger to something more descriptive so if we come back to the mission later it is nice and clear what it does; to do this select the name field, delete the old name and type a new name for the trigger, for example "Teleport Player". We will leave leave most of the properties as default, however we will tick "enableAfterComplete" as we want the player to be teleported every time they enter the area, not just the first time. We will then select the "periodicEvent" event and set its time field in the Element area to 0.1, this means the trigger will be executed and check if the player is in the area every 0.1 seconds.

Next we will click the "Condition" button and look for the "unitWhenInArea" condition and insert it into the trigger, this condition allows us to check whether a chosen unit is within a specified area at the moment the trigger is executed. When the condition is added it should automatically become selected in the "Element" section, scroll down in the trigger window so that all of the settings can be seen. The "object" field is what the condition is going to act on, in our case we want to check the player's unit to see if it is in the area, so we will set this field to the player unit (in this example called "Player"); to do this simply click the field and select the player's unit from the list of available units. The "+ object" button will create another object field, allowing you to check if multiple units are in the area. The target field in this case refers to what area we are checking the unit is in, so we will set this to "Teleport_Area". The "+ target" button does the same thing for targets that the "+ objects" button does for objects. We will leave all other settings at defaults, but for future reference here is what they do:

Math allows you to specify how the unit is checked to be in the area; by default it is set to "3D" so the unit must we within the area, if it is set to 2D then along as the unit is within the 2D footprint of the area it doesn't matter how high up the unit is (this setting is mainly useful for triggers aimed at aircraft). This field can also be set to "notNear2D" or "notNear3D", these work the same as "2D" and "3D", but will activate the trigger when the unit is not within the area, instead of when the unit is within the area. The "object_type" and "unit_type_ex" settings allow you to specify criteria about the unit, by default it is set to "isAlive" which means the condition will be met as long as the unit is alive while it is in the area, this can be changed to other settings such as "isDamaged" so the trigger will only activate if the player is both within the area and has damage to their vehicle. Finally check_objects comes in useful if you have specified multiple units to check, it allows you to say whether the trigger should activate if any of the units are in the area, or if all of the specified units must be in the area for the trigger to carry out its actions. This also works if a squad has been set as the object instead of an individual unit, it let you choose whether a single unit from the squad or the entire squad is required to be in the area.

Next click the "Action" button and from the list select "unitMoveTo" and insert it into your trigger. This action can be used to do various things relating to unit movement (such as telling AI to move to a certain place in a certain way), but we will use it for its ability to teleport units, in this case the player. Once inserted set the object to the player's unit and target to "Destination_Area", then click the "+ move_type" button to add the move_type field to the trigger and set the field to "teleport". There are a lot of other fields here which will be useful for when you make more advanced missions, but they are outside the scope of this basic guide.

Our trigger is now complete; every 0.1 seconds (10 times a second) it will check if the player's unit is within the "Teleport_Area" area and if it is it will teleport the player to the "Destination_Area" area, if the player is not in the teleport area it won't do anything. Now finish off the mission (give it a name, assign the player unit as the player, set the map to the correct map, that sort of stuff) and test it out in game.

List of all Events

For each item in the table click [Expand] for more details on implementation and available settings.

Event Description Available in SP or MP?
periodicEvent
Will execute the trigger repeatedly at a user defined interval

Fields:

  • time: The amount of seconds between each execution of the trigger, accurate to 2 decimal places
  • var: An integer variable can be assigned here to override the value of the "time" field (use of integer variable limits interval to whole seconds if this option is chosen)
Both
timeExpires
Will execute the trigger once after a set number of seconds from mission start

Fields:

  • time: The amount of seconds from the start of the mission after which the trigger will be executed, accurate to 2 decimal places
  • var: An integer variable can be assigned here to override the value of the "time" field (use of integer variable limits interval to whole seconds if this option is chosen)
Both
initMission Trigger will be executed once at the start of the mission Both

List of all Conditions

For each item in the table click [Expand] for more details on implementation and available settings. Note: This section lists the intended functionality (where known) for each condition, some (a minority) may be legacy features, or just broken, and may not work properly if at all. "SP only", "MP only", "Both" and "Unknown" show whether the trigger component only works in Single-player missions, only works in Multi-player missions, works in both types of missions, or that the component is currently non-function / not enough is known about it to say.

Condition Description Available in SP or MP?
airfieldIsModuleHP Condition does not appear to currently be functional Unknown
gameWhenDifficulty
Will check what the current game-mode is (AB, RB, SB or custom)

Fields:

  • difficulty: what game-mode (AB, RB, SB or custom) the condition will check for
  • is: Can either be "equal" or "notEqual", if "equal" then trigger carries out actions when the current game-mode matches the one set in the "difficulty" field, if "notEqual" trigger will carry out actions when the game-mode does not match the one set in the "difficulty" field.
Both
gameWhenControlMode
Will check what the control mode the user has selected (mouse-aim, etc.)

Fields:

  • controlMode: what control mode (mouse-aim, instructor / simplified, realistic or full-real) the condition will check for
  • is: Can either be "equal", "notEqual", "less", or "more", if "equal" then trigger carries out actions when the current control-mode matches the one set in the "controlMode" field, if "notEqual" trigger will carry out actions when the game-mode does not match the one set in the "controlMode" field. Functionality of "less" and "more" not confirmed but may allow for checking if the user's control scheme is set to less or more realist than the chosen value.
SP only
gameWhenControlWarning Condition does not appear to currently be functional Unknown
gameWhenHintIsNotActive Will check if a hint is currently being displayed on the UI Unknown
gameWhenManualGear Will activate trigger if the user currently has "Autocontrol of landing gear" turned off in game controls SP only
gameWhenObjectivesNotDisplayed Will activate trigger if no mission objective is currently being displayed on screen Unknown
infantryTroopWhenKilledByPlayerMatches
Will check if the number of infantry units killed by the player matches a specified value

Fields:

  • object: Which group of infantry the condition is checking if the player has killed
  • func: Can be "less", "more", "equal", "notEqual" "notLess", "noteMore", determines how to compare the number of infantry killed to the number specified.
  • value: the number to compare the number of infantry killed by the player to.
  • var: An integer variable can be assigned here to override the value of the "value" field
SP only
isAllPlayersInGame Will activate trigger if all the players are in the game MP only
misObjStatus
Will activate trigger if a specified objective's current status matches a specified value

Fields:

  • target: The objective to be checked
  • status: Can be "completed", "failed", "notCompleted", "notFailed", "inProgress", "notInProgress", spcifies the value to compre the trigger's status to.
Both
missionNamePostfix Condition does not appear to currently be functional Unknown
missionIsBombingAreaDestroyed
Will activate the trigger if the specified bombing area is destroyed

Fields:

  • target: The bombing area to check (bombing areas are assigned with the "missionSetBombingArea" action, for the condition select the area you assigned as a bombing area with this action)
Both
missionIsLZCaptured
Will activate trigger if a specified landing zone is captured by a specified team (unclear if / how LZs currently work)

Fields:

  • lz: The Landing Zone to be checked
  • army: Which team should have captured landing zone
Unknown
missionIsRespawnAllowed Checks if respawns are allowed in mission settings Unknown
missionIsSuccess Activates trigger if mission is completed successfully Both
missionIsZoneCaptured
Will activate trigger if a specified zone is captured by a specified team

It may be possible to make this trigger work in single player, but requires certain mission settings to be set.

Fields:

  • target: The Zone to be checked
  • army: Which team should have captured zone
MP only
missionWhenAdditionalTime
Will activate trigger if a specified amount of time has passed since the successful completion of the mission

When a (single player) mission is marked as successfully completed the player has the option to return to the hangar or continue playng, this condition will activate the trigger once a specified amount of time has passed from the completion of the mission, if the player chooses to continue playing.

Fields:

  • value: The amount of time (in seconds) that should elapse after completion of the mission
  • use_variable: Enables the use of a variable instead of the specified value.
  • var_value: An integer variable can be assigned here to override the value of the "value" field, if "use_variable" is ticked
SP only
missionWhenInBattleArea
Will activate the trigger if any units are within the defined battle area

Fields:

  • area: The battle area to check (battle areas are assigned with the "missionBattleArea" action, for the condition select the area you assigned as a battle area with this action)
Both
missionWhenTime
Will activate the trigger if a specified amount of time has passed since the start of the mission

Fields:

  • value: The amount of time which sold pass since the start of the mission.
Both
objectExists Functionality unknown Unknown
objGroupWhenStatus Functionality unknown Unknown
playersDistanceBetween
Will activate the trigger if the player is within a set distance of a set object

Fields:

  • target: The object to check the player's distance between
  • value: The distance between the player and the target
  • var: An integer variable can be assigned here to override the value of the "value" field
  • math: Can be "2D", "3D", "notNear2D" or "notNear3D", determines how distance is calculated 2D is just concerned with 2D distance (distance between two objects on if drawn on a top down map), whereas 3D takes height difference into consideration; notNear will activate trigger if players are not within the distance, instead of being within the specified distance.
  • player: the status of the player in order to be considered by the condition
  • target_type: The status of the object in order to be considered by the condition
  • check_players: can be "any" or "all", decides if all players must be within distance or just one
  • check_targets: can be "any" or "all", decides if player must be within the specified distance of all targets or just one
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
Both
playersWhenEnemyNear
Will activate the trigger if the player is within a set distance of an enemy

Fields:

  • players: the status of the player in order to be considered by the condition
  • enemy_type: The status of the enemy unit in order to be considered by the condition
  • distance: the distance between the player and the enemy unit
  • check_players: can be "any" or "all", decides if all players must be within distance or just one
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
Both
playersWhenInArea
Will activate the trigger if the player is within a set area

Fields:

  • target: the area to check if the player is within
  • math: Can be "2D", "3D", "notNear2D" or "notNear3D", determines how the players position is calculated 2D is just concerned with if the player is within the 2D footp[rint of the area, regardless of hight, whereas 3D takes height into consideration; notNear will activate trigger if player is not within the area, instead of being within the specified area.
  • players: the status of the player in order to be considered by the condition
  • check_players: can be "any" or "all", decides if all players must be within distance or just one
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
Both
playerWhenSpawn
Will activate when the player spawns

This condition is best used with the "useForTriggerFiltered" option on actions to allow the trigger to act only on units which have just spawned.

Fields:

  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
  • clearHandledEvents: Functionality unknown
Both
playersWhenOnLZ
Checks if a player is within the landing zone (unclear if / how LZs currently work)

It is currently unclear if this trigger works

Fields:

  • object: The units to check
  • target: The landing zone to check (landing zones are assigned with the "missionMarkAsLandingZone" action, for the condition select the area you assigned as a landing zone with this action)
  • object_type: the status of the player in order to be considered by the condition
  • check_objects: can be "any" or "all", decides if all players must be within distance or just one
  • aterRepaired: Functionality unknown
Unknown
playersWhenReachHeight
Checks if a player has reached a specified altitude

Fields:

  • players: the status of the player in order to be considered by the condition
  • check_players: can be "any" or "all", decides if all players must be above height or just one
  • value: the altitude to reach (in metres)
  • comparison_func: can be "more" or "less", decides if trigger should activate if player is above or bellow set value
  • absolute_value: Determines whether absolute altitude (referenced to sea level) or altitude over terrain should be used
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
Both
playersWhenStatus
Checks the status of the player

Fields:

  • players: the value the player's current status should be compared to
  • check_players: can be "any" or "all", decides if all players must meet status or just one
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
Both
playersWhenManeuver
Checks what maneuver the player is carrying out

Fields:

  • manName: the maneuver to compare player's current behavior to
Unknown
playersWhenOptions
Checks what options the player is currently has using

This condition has a list of check boxes and drop downs to let you act on the players settings such as if they are currently in cockpit mode, currently zoomed in, are using a touch screen to play, are using mouse aim, are using a joystick, etc. Some or all settings may not work and some such as "currentMissileType" are left over from previous Gaijin games on the same engine and not relevant to War Thunder.

Unknown
playersWhenOrientation
Checks what orientation the player is currently at

Fields:

  • value: The angle the player should be at (-180 to +180, accurate to 2 decimal places)
  • orientation: Which axis (yaw, pitch, or roll) the trigger should check the value against
  • comparison_func: Can be "more" or "less", whether the trigger should activate when the player's angle is above or below the specified value in the specified axis.
Unknown
playersWhenCameraState
Checks what orientation the of the camera (in free look mode)

Fields:

  • value: The angle the camera should be at (-180 to +180, accurate to 2 decimal places)
  • orientation: Which axis (yaw, pitch, fov (field of view)) the trigger should check the value against
  • comparison_func: Can be "more" or "less", whether the trigger should activate when the camera angle is above or below the specified value in the specified axis.
Unknown
playersWhenCursorIn
Functionality unknown

This appears to relate to how the mouse cursor is being used (mouse-aim, on-screen joystick, control of tank cross-hair etc.), but no functionality has been established after testing.

Unknown
playersWhenCurrentBullet
Checks which ammo slot the player has selected and activate trigger if it matches set value

As this condition only is believed to only work in single player, this effectively lets you check what ammo type the user is using as in single player missions you assign ammo to the player, so know what slot each shell is in.

Fields:

  • buttletNo: Can be a number between 0 and 3, determines what ammo slot the player should have selected in order for the trigger. Is a 0 based numbering system, so 0 is the first ammo slot (ammo slot 1), up to 3 which is ammo slot 4.
Unknown
triggerStatus
Checks the status of another trigger and activates trigger if it matches a set value

Fields:

  • target: The trigger to check the status of
  • status: What status the trigger should be, either "enabled" or "disabled"
Both
unitDistanceBetween
Will activate the trigger if a unit is within a set distance of a set object

Fields:

  • object: The unit to check the distance from
  • target: The target to check the unit's distance from
  • value: The distance between the unit and the target
  • var: An integer variable can be assigned here to override the value of the "value" field
  • math: Can be "2D", "3D", "notNear2D" or "notNear3D", determines how distance is calculated 2D is just concerned with 2D distance (distance between two objects on if drawn on a top down map), whereas 3D takes height difference into consideration; notNear will activate trigger if players are not within the distance, instead of being within the specified distance.
  • object_type: The status of the unit in order to be considered by the condition
  • unit_type_ex: Unknown, likely more options for checking the status of units before activating the trigger
  • target_type: The status of the target in order to be considered by the condition
  • target_marking: Only works for Multiplayer A number between 0 and 31. Checks the marking of the target unit, units are marked with a number using the unitMark action. If multiple targets are selected only targets with the correct marking are considered by the trigger, e.g. if set to 5 the trigger will only activate if the unit is within the set distance of a target with a marking of 5, even if the unit is within distance of another target with a different marking.
  • check_objects: can be "any" or "all", where there are multiple objects set decides if all objects must be within distance or just one
  • check_targets: can be "any" or "all", decides if object must be within the specified distance of all targets or just one
  • compareCenters: Determines if measurement is taken from center of object and target or from closest point
  • check_all_units: Functionality unknown
Both
unitFuelLess
Activates the trigger when the specified units remaining fuel is below a specified amount (may be bugged / non-functional)

Fields:

  • object: The unit to check the fuel of
  • object_type: The status of the unit in order to be considered by the condition
  • fuelRelMin: A number accurate to two decimal places, specified the amount of remaining fuel, unit is unknown and condition may not be functioning correctly.
Unknown
unitAnyLess
Activates trigger if at least one unit from those specified does not match the given status

Fields:

  • object: The unit(s) to check
  • object_type: The status of the unit to be checked by the condition
Both
unitWhenControls
Activates trigger if the units control positions match a given value

Fields:

  • object: The unit to check
  • func: Can be "less", "more", "equal", "notEqual" "notLess", "noteMore", determines how to compare the control position to the number specified.
  • value: A number accurate to 2 d.p, determines what the control setting should be checked against (e.g. for flaps 0 might be flaps fully up, 1 might be flaps fully down and 0.5 flaps half way; these are made up and untested numbers, you will need to experiment).
  • property: The control to check.
Both
unitWhenCountMatches
Activates trigger when the number of units meeting the condition is equal to the number set

All units assigned under the object field of this condition are counted together, including units which have had their count increased. For example if two units have been assigned and one has had its count increased to 5 then the trigger will consider the status of all 5 sub units and the other unit, for a total of 6. If the object_type is set to isAlive with the function less than 3 then the death of any four units will activate the trigger.

Fields:

  • object: The unit(s) to check, allows for multiple objects to be assigned, groups can also be assigned.
  • object_type: The criteria the units are evaluated against e.g. "isAlive" or "damaged"
  • unit_type_ex: Unknown, likely more options to check the unit's status.
  • object_marking_var: Allows and integer variable to be assigned, likely takes the value of the variable as a marking (set with the unitMark action), allowing the trigger to be activated depending on the number of units with certain marking.
  • func: Can be "less", "more", "equal", "notEqual" "notLess", "noteMore", determines how to compare the control position to the number specified.
  • value: An integer value for the number of units required to meet the condition.
  • var: An integer variable can be assigned here to override the value of the "value" field
Both
unitWhenEnemyNear
Will activate the trigger if the specified unit is within a set distance of an enemy

Fields:

  • object: The unit to check
  • object_type: The status of the unit in order to be considered by the condition
  • unit_type_ex: Unknown, likely more options to check the unit's status.
  • enemy_type: The status of the enemy unit in order to be considered by the condition
  • distance: the distance between the player and the enemy unit (in metres)
  • use_variable: Enables the use of a variable instead of the specified value.
  • distance_var: An integer variable can be assigned here to override the value of the "distance" field, if "use_variable" is ticked
  • check_objects: can be "any" or "all", decides if all specified units must be within distance or just one
Both
unitWhenInArea
Will activate the trigger if the specified unit is within the specified area

Fields:

  • object: The unit to check
  • target: The area to check if the unit is within
  • math: Can be "2D", "3D", "notNear2D" or "notNear3D", determines how the players position is calculated 2D is just concerned with if the player is within the 2D footprint of the area, regardless of hight, whereas 3D takes height into consideration; notNear will activate trigger if player is not within the area, instead of being within the specified area.
  • object_type: The status of the unit in order to be considered by the condition
  • unit_type_ex: Unknown, likely more options to check the unit's status.
  • enemy_type: The status of the enemy unit in order to be considered by the condition
  • check_objects: can be "any" or "all", decides if all specified units must be within the area or just one
Both
unitWhenOnLZ
Checks if a unit is within the landing zone (unclear if / how LZs currently work)

It is currently unclear if this trigger works

Fields:

  • object: The units to check
  • target: The landing zone to check (landing zones are assigned with the "missionMarkAsLandingZone" action, for the condition select the area you assigned as a landing zone with this action)
  • object_type: the status of the unit in order to be considered by the condition
  • check_objects: can be "any" or "all", decides if all players must be within distance or just one
  • aterRepaired: Functionality unknown
Unknown
unitWhenPartHp
Checks the health of a part of a unit

Using this trigger requires knowing the names of different parts of a unit's damage model, finding this information is up to you.

Fields:

  • object: The units to check
  • func: Can be "less", "more", "equal", "notEqual" "notLess", "noteMore", determines how to compare the part's health to the number specified
  • check_objects: Can be "any" or "all", decides if all players must be within distance or just one
  • check_parts: Can be "any", "all", "notAll", "notAny", if multiple damage model parts are listed determines which ones of them need to meet the criteria in order for the trigger to activate (e.g. if "any" is set then if any part meets the required HP then the trigger will activate)
  • value: A number accurate to 2 decimal places, the value the current health of the part should be compared to (0 is destroyed 1 is full health)
  • var: A real (decimal number) variable can be assigned here to override the value of the "value" field
  • planePart: You may type the name of the damage model part you wish to check for an aircraft unit
  • tankPart: You may type the name of the damage model part you wish to check for a tank unit
Unknown
unitWhenProperties
Activates the trigger if a unit's current properties match specified values

Fields:

  • object: The units to check
  • func: Can be "less", "more", "equal", "notEqual" "notLess", "noteMore", determines how to compare the part's property to the number specified
  • value: A number accurate to 2 decimal places, the value to compare the unit's current property to
  • property: Can be "speed", "throttle", or "heading", determines which of the unit's properties should be compared to the value.
  • check_filter: Can be "any", "all", "notAll", "notAny", functionality unknown.
  • object_type: the status of the unit in order to be considered by the condition
  • unit_type_ex: Unknown, likely more options to check the unit's status.
Both
unitWhenReachHeight
Checks if the specified unit has reached a specified altitude

Fields:

  • object: The unit to be checked
  • object_type: the status of the player in order to be considered by the condition
  • unit_type_ex: Unknown, likely more options to check the unit's status.
  • check_objects: can be "any" or "all", decides if all of the specified units must be above the height or just one
  • value: the altitude to reach (in metres)
  • comparison_func: can be "more" or "less", decides if trigger should activate if player is above or bellow set value
  • absolute_value: Determines whether absolute altitude (referenced to sea level) or altitude over terrain should be used
Both
unitWhenStatus
Checks the status of the specified unit

Fields:

  • object: The unit to check
  • object_type: the value the unit's current status should be compared to
  • unit_type_ex: Unknown, likely more options to check the unit's status.
  • check_objects: can be "any" or "all", decides if all the specified units must meet status or just one
Both
unitCheckTag
Checks the tags of a specified unit

Each unit in the game has various tags assigned to it which describe it, such as what unit type it is (fighter, bomber, tank, ship, etc.) and what country it is. Working out what the tags are for a specific unit has is a fairly easy task and is done by just thinking about the unit, e.g. a spitfire will probably have the "type_fighter" and "country_britain" tags.

Fields:

  • target: The unit to check
  • useForTriggerFiltered: This option is only usually seen in actions, it is unclear what purpose it serves in a condition
  • tags: Clicking this will give you the option to add in various check boxes to check the units tag against, if the unit's tags align with those selected then the trigger will activate. For example adding and unchecking the "type_bomber" tag will activate the trigger if the specified unit is not a bomber; likewise if only the "type_medium_tank" and "country_ussr" boxes are added and ticked then the trigger will only activate if the specified unit is a Russian medium tank.
Both
unitWhenHit
Will activate the trigger if the specified unit is hit (shot) with the option of specifying which unit hit it

Fields:

  • target: The unit to check if it has been hit
  • offender: The unit which hit the specified unit (if "tank01" hit the units, but this was set to "tank02" the trigger should not activate, if "tank02" hit the unit the trigger would activate)
  • clearHandledEvents: Functionality unknown
  • setIntVar: Does not appear to currently be functional
  • addIntVar: Does not appear to currently be functional
Both
unitWhenKilled
Will activate the trigger if the specified unit is killed

Fields:

  • target: The unit to check if it has been killed
  • offender: The unit which killed the specified unit (if "tank01" hit the units, but this was set to "tank02" the trigger should not activate, if "tank02" killed the unit the trigger would activate)
  • clearHandledEvents: Functionality unknown
Both
unitsInLineOfSight
Checks if two units have line of sight with each other

Fields:

  • object: The unit to check
  • target: The unit to check if the first unit has line of sight with
  • check_objects: can be "any", "all", "notAny", "notAll", decides if all the specified units must have line of sight with the target or just one
  • check_targets: can be "any", "all", "notAny", "notAll", decides if the specified unit must have line of sight with all the targets or just one
  • Distance: Max distance between units for trigger to activate
Both
unitsInSearchLight
Checks if unit is caught in a search light

Fields:

  • object: The unit to check
  • target: The search light to check if the unit is in
Both
varCompareBool
Activates the trigger if the specified boolean variable matches the specified value

Fields:

  • var_value: The variable to compare
  • value: Whether the boolean variable should be true (ticked) or false (un-ticked)
  • comparison_func: Can be "equal" or "notEqual" determines whether the variable should equal the value or not equal the value.
Both
varCompareInt
Activates the trigger if the specified integer variable matches the specified value

Fields:

  • var_value: The variable to compare
  • value: The value to compare the variable to
  • var_value_other: An integer variable can be assigned here to override the value of the "value" field
  • value: The value to compare the variable to
  • comparison_func: Can be "less", "more", "equal", "notEqual", "notLess", "notMore", determines how the variable should compare the the value in order to activate the trigger.
Both
varCompareReal
Activates the trigger if the specified real (decimal number) variable matches the specified value

Fields:

  • var_value: The variable to compare
  • value: The value to compare the variable to
  • var_value_other: A real variable can be assigned here to override the value of the "value" field
  • comparison_func: Can be "less", "more", "equal", "notEqual", "notLess", "notMore", determines how the variable should compare the the value in order to activate the trigger.
Both
varCompareString
Activates the trigger if the specified string variable matches the specified value

Fields:

  • var_value: The variable to compare
  • value: The value to compare the variable to
  • var_value_other: A string variable can be assigned here to override the value of the "value" field
  • comparison_func: Can be "equal" or "notEqual" determines whether the variable should equal the value or not equal the value.
Both
playerShortcutPressed
Activates the trigger if player presses a specified control

Fields:

  • control: The control the player should press, they are fairly self explanatory as to which key they refer to
  • timer: How long the player needs to hold the control down for in order for the trigger to activate (in seconds)
  • pressed: If checked the trigger will activate when the player presses the control, if unchecked the trigger will activate when the player is not pressing the key
  • checkUp: If checked trigger will be activated when player releases the specified control, if checked trigger will be activated when player presses control. It is unclear whether this option currently functions correctly.
  • gamepadControls: Exact functionality unknown, presumably relates to use of a gamepad instead of mouse and keyboard.
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
SP only
playerSeesUnit
Checks if player can see a specified unit

This appears to work like "unitsInLineOfSight", only requiring LOS between the player and the target unit, the player does not need to be looking at the unit.

Fields:

  • target: The unit to check if the player can see
  • target_type: The status of the target in order to be considered by the condition
  • check_targets: Can be "any" or "all", decides if player must be able to see all targets or just one
  • viewAngle: Functionality unknown
  • distance: The maximum distance between the player and the target in order for the trigger to activate. Unclear thif this field is currently working
SP only
playerAxisValueReached
Checks if player has reached a certain value on a specified control axis

Fields:

  • axis: The control axis which is being checked
  • value: the value to compare the current axis value to
  • timer: How long the axis must have been at a value matching the requirement (in seconds)
  • absValue: Functionality unknown
  • gamepadControls: Exact functionality unknown, presumably relates to use of a gamepad instead of mouse and keyboard.
  • team: Can be "A", "B", or "Both", determines which team's players should be considered by the condition
  • func: Can be "less", "more", "equal", "notEqual", "notLess", "notMore", determines how the axis value should compare the the value in order to activate the trigger.
  • joyAngle: Exact functionality unknown, presumably relates to angle of the player's joystick (for players using one).
  • joyDispersion: Exact functionality unknown, presumably relates to players using a joystick
  • joyMinRad: Exact functionality unknown, presumably relates to players using a joystick
SP only
destructibleInArea
Checks the number of objects destroyed within a specified area

Fields:

  • area: The area to check objects destroyed within
  • moreThan: the value to compare the number of destroyed objects to
  • func: Can be "less", "more", "equal", "notEqual", "notLess", "notMore", determines how the number of destroyed objects should compare the the value in order to activate the trigger.
  • check_areas: Can be "any" or "all", decides if all specified areas must meet match number of targets destroyed or just one.
Unknown
airDropsNear
Checks if an airDrop is near a unit (unclear if / how air drops currently work)

Fields:

  • object: The unit to check for airdrops near
  • distance: The distance between the unit and an airdrop in order to activate a trigger
Unknown
areaWhenInArea
Checks if an area is within another area

Fields:

  • target: The area to check if it is within another area
  • object: The area to check if the first area is within
  • math: Can be "2D", "3D", "notNear2D" or "notNear3D", determines how the area's position is calculated 2D is just concerned with if the area is within the 2D footprint of the other area, regardless of hight, whereas 3D takes height into consideration; notNear will activate trigger if the area is not within the area, instead of being within the specified area.
Both

List of all Actions

This is a list of all Actions and their known behaviour. Note: This list is user-provided, there could be missing actions or the described behaviour could be incorrect

Actions List
Action Description MP/SP Working
addAirfield
Adds a virtual airfield using the given areas

This trigger is used to make an airfield already present as part of the map a functioning airfield in the mission, use of this trigger is not needed for aircraft carriers and airfields made using the "dynaf_" object groups. Fields:

  • runwayStart: The area you want to be the beginning of the runway
  • runwayEnd: The area you want to be the end of the runway (can be placed in diagonal)
  • runwayWidth: The width of the runway
  • army: To what army this airfield should belong to
  • spawnPoint: The area where you want the planes to spawn. Note: Multiple can be added
  • visibleOnHud: If checked, the airfield icon will be shown to players
  • cable: Creates an arrestor cable, once added requires start and end fields be specified, multiple cables can be created.
    • start: An area is specified as the start of the cable
    • end: An area is specified as the end of the cable
Both Yes
addTextToUnit
Adds text on the given unit

Fields:

  • langID: The identifier of the text to add
  • fontSize: The text size
  • target: The target unit
Unknown Unknown
airfieldSetIndication
Makes airfield flash green on map / radar

Fields:

  • target: Assign the area set as the start of the runway (if airfield was created using the addAirfield action) or the object group / carrier unit here (if airfield was made using a dynaf_ object group or AI aircraft carrier unit)
  • team: Which team the airfield should appear as flashing for "A", "B" or "Both" or "None"
  • set: If the airfield indication should be turn on or off by the trigger
Both Yes
airfieldSetVisibility
This action does not appear to currently be functional

Presumably this action should change the airfield's visibility on the map / radar, but it currently appears to do nothing.

Fields:

  • target: Assign the area set as the start of the runway (if airfield was created using the addAirfield action) or the object group / carrier unit here (if airfield was made using a dynaf_ object group or AI aircraft carrier unit)
  • team: Which team the airfield should be visible / invisible to
Unknown Unknown
airfieldGetModuleHP
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to get the HP of a part of an airfield and save it to a real (decimal number) variable.

Fields:

  • object: The airfield to check
  • module: The part of the airfield to get the HP of of
  • var: The variable to save the HP to
Unknown Unknown
airfieldSetModuleHP
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to set the HP of a part of an airfield and save it to a real (decimal number) variable.

Fields:

  • object: The airfield to set the hp of
  • module: The part of the airfield to set the HP of
  • hp: A number accurate to 2 decimal places, what to set the HP of the part of the airfield to
  • hp_var: A real (decimal number) variable can be assigned here to override the value of the "hp" field
Unknown Unknown
airfieldAddModuleHP
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to add a set number to the HP of a part of an airfield and save it to a real (decimal number) variable.

Fields:

  • object: The airfield to add to the hp of
  • module: The part of the airfield to add to the HP of
  • hp: A number accurate to 2 decimal places, what value to add to the HP of the part of the airfield
  • hp_var: A real (decimal number) variable can be assigned here to override the value of the "hp" field
Unknown Unknown
airfieldSetFuelMul
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is refueled, however testing has shown it to have no effect

Fields:

  • object: The airfield to apply the multiplier to
  • fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of refueling
Unknown Unknown
airfieldSetReloadMul
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is reloaded, however testing has shown it to have no effect

Fields:

  • object: The airfield to apply the multiplier to
  • fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of reloading
Unknown Unknown
airfieldSetRepairMul
Functionality unknown

It is unclear exactly what this action does or if it works, it appears to apply a multiplier to the rate at which the aircraft is refueled, however testing has shown it to have no effect

Fields:

  • object: The airfield to apply the multiplier to
  • fuel_mul: A number accurate to 2 decimal places, the multiplier to apply to the rate of repairing
Unknown Unknown
awardAchievement
Functionality unknown

Presumably this action is designed to award achievements to the player, but in testing it has had effect.

Fields:

  • achievement: Allows the selection of a "localization string" from a very long list, not clear what this does functionally
Unknown Unknown
changeUnit This action does not appear to currently be functional Unknown Unknown
checkEntity
Functionality unknown

Fields:

  • entities: Allows the selection of an entity (presumably to check)
Unknown Unknown
comment
Adds comments to the trigger for documentation purposes

This action has no effect, it is coloured green in the editor and is used to simply add text comments to the trigger in the editor to document what it does.

Fields:

  • value: The comment to appear in the trigger
Both Yes
countUnitsKilledByTeam
Counts the number of units killed by the specified team and assigns the value to a variable

Fields:

  • team: The team to track kills from, can be both
  • var: You need to first create a variable of type Integer (usually with a base value of 0) and then provide it here
Both Yes
beginRaceMode
Starts a plane or tank race with the given settings

Fields:

  • tankRace: If checked the race will be treated as a tank race, if unchecked the race will be treated as an air race.
  • groundFxType: For tank races lets you override the effect played at each waypoint
  • checkAreaPrefix: The prefix you chose for the waypoints (the area the player must pass through)
  • waypointsPrefix: If you want the waypoint effect to play at a different place to the waypoint's actual area you can create another set of areas with a different prefix, following the same rules as above, and specify that prefix here. Most of the time just set this to the same as the checkAreaPrefix field.
  • doubleWaypoints: If the waypoint aster the current one should be shown
  • waypointScale: Adjusts the size of the waypoint effect
  • respawnVerticalOffset: How high the player should respawn relative to the waypoint
  • respawnForwardOffset: How far forwards the player should respawn relative to the waypoint
  • statisticsScreenAfterFinish: If ticked once players have finished the race they will be forced into the satistics screen
  • reverse: If the waypoints should be followed in reverse order (highest number to lowest number), mostly used for triggers launcuing the race when the user selects revere mode (used in conjunction with the missionNamePostfix condition)
  • isPathClosed: If the last waypoint of the race links back up to first waypoint (forming a circuit) or if it does not (race starts at one point, and ends at another).
  • defaultTimeToDisableWeapon: How long after start to disable player weapons (most races opt to use other actions such as the cannotShoot option in unitSetProperties to disable player weaponry).
MP Only Yes
bigQueryAddRecord Functionality unknown Unknown Unknown
getOwnArea Functionality unknown Unknown Unknown
hangarGetCountryNum Functionality unknown Unknown Unknown
makeSquad
Creates a squad from the given unit

Fields:

  • name: The name of the squad, optional
  • object: The unit to add to the squad, can be multiple
Both Unknown
makeSquadFromUnits
Same than makeSquad but with more options

Additional fields:

  • object_type: Allows you to filter any unit in the given list according to the given status
Both Unknown
setHeadSquad
Same than above, but instead creates the head (leading) squad

Additional fields:

  • removeOnKill: If checked, the squad will be removed once killed
Both Unknown
missionAttempts
Allows you to modify how many attempts the player gets at a mission

Each time a player dies in a single player mission they loose one attempt (by default you get 5, so 4 respawns); this trigger allows you to modify how many they have left. NOTE: The game works by counting deaths, so using "set" and "1" will set the player to 1 death (3 respawns remaining), not set the to 1 attempt left.

Fields:

  • action: The modification to do, where:
    • increase adds the given value to the existing amount of attempts
    • reduce subtracts the given value from the existing amount of attempts
    • restore gives back attempts based on the given value and the amount of attempts already lost by the player
    • set defines the base amount of attempts
  • value: An integer value to apply to the death count
SP Only Yes
missionBattleArea
Allows you to restrict the battle area to within a specified area

This action is used to either restrict the map to a certain area (make it smaller), or specify areas where players will be killed / spotted if they enter.

Notes:

  • Vertical hight of the area is irrelevant, if area is 10km x 10km x 2km then the player can go as high as they like as long as they are within the 10km x 10km area.
  • Anywhere out of the battle area (air and ground) and not inside the killOutOfBattleArea will display the warning message "Return to the battlefield" constantly to the player until they go back inside the battle area
  • You can add multiple areas to set them as a whole at once (example: You select your 4 "north_restricted_area", "south_restricted_area", "east_restricted_area", "west_restricted_area" areas and check the killOutOfBattleArea field to combine their coverage)

Fields:

  • area: The area(s) you want the trigger to act on. Multiple areas can be selected whether they overlap or not. The inside of each selected area will be affected by the trigger, all other area in the map will not be.
  • message: Does not appear to currently be functional
  • air: If ticked the battle area will be restricted for aircraft
  • ground: If ticked the battle area will be restricted for ground vehicles
  • mapArea: If checked, sets the given area(s) to be the area shown on the minimap of ground vehicles
  • airMapArea: If checked, sets the given area(s) to be the area shown on the minimap of air vehicles
  • killArea: If checked, then the areas become a "kill area", players in them for more than 25 seconds will be destroyed (only works for ground units). This one is regularly used for spawn-kill protection.
  • detectionArea: If checked, sets the area in which the player constantly appears on the enemy map (even in realistic). This one is regularly used for soft spawn-kill protection (usually larger than the killArea as it doesn't outright kill intruders)
  • killOutOfBattleArea: If checked, sets the restricted areas considered "out of the battle" where the player dies should they fail to go back to the battle area
  • newGridHorizontalCellCount: How many grid squares should be drawn between each edge of the battle area
  • gridCellCountVar: An integer variable can be assigned here to override the value of the "newGridHorizontalCellCount" field
  • team: To what teams should the given areas apply to, regularly used to specify killAreas and detectionAreas specific to each team
Both Yes
missionComplete
Sets the mission as complete (victory) for the selected team, ends the battle

Fields:

  • team: Which team completed the mission (the winning team)
  • timer: If a timer should be displayed until the mission ends and the player is returned to the hangar (if enabled it gives option to continue playing after the mission has ended, if disabled that option is not available)
  • debtiefingTimer: If the timer option is disabled, amount of time in seconds to wait before sending the players back to the hangar
  • showCompleteMessage: If checked, displays the mission complete message
  • playCompleteMusic: If checked, plays the mission complete music
  • startReplayCamera: Removes control from player and puts them into cinematic camera position until they return to hangar
  • afterComplete: Selects a trigger to run the actions of once the mission is completed (like the "triggerActivate" action)
Both Yes
missionCustomArtillery
Enables custom artillery (unknown how or if custom artillery currently works)

Fields:

  • enabled: If custom artillery should be enabled
Unknown Unknown
missionDebriefing Forces the player back to the hangar, works only after mission has been completed Unknown Yes
missionDestroyArea
Marks the given area(s) as destruction objectives

Fields:

  • area: The area(s) to use
  • target_type: What kind of targets in the given area(s) needs to be destroyed
Both Unknown
missionGetBalanceLevel
Gets the mission's balance level and stores it in the given variable

Fields:

  • input_var: You first need to create a variable of type Integer, and then provide it here
Both Unknown
missionGetBombingAreaHP
Gets the remaining HP of a bombing area and assigns it to a variable

Fields:

  • target: The bombing area(s) to check
  • input_Var: The variable (type "real") to store the area's HP in
Both Yes
missionGetMaxPlayers
Gets the maximum amount of players allowed in the game (set before mission is launched) and assigns it to a variable

Fields:

  • input_Var: The integervariable to store the max number of players in
MP Only Yes
missionGetMaxRepawns
Gets the maximum number of respawns and assigns it to a variable (unclear if working currently)

Fields:

  • input_Var: The integer variable to store the max number of respawns in
Unknown Unknown