MSFS Mission Script - Triggers

From FSDeveloper Wiki
Revision as of 08:51, 13 October 2021 by Mr LiamT (talk | contribs) (Added transclusion to msfs mission script)
Jump to navigationJump to search


Triggers fire when a condition is met. When a trigger fires, the actions referenced in the ObjectReferenceList are played. See MSFS Mission Script for general information about creating a mission script.

General attributes

Triggers have a few general parameters:

Activated

If a trigger is activated it will wait for its condition is met and it can fire. You may not want the trigger to be active at the start of the mission. If you want the trigger to be disabled at the start you should uncheck this property. You can change it throughout the mission with an ObjectActivationAction.

DefaultActivated

Usage unknown.

OneShot

You can change a trigger to be able to fire again and again by unchecking the OneShot property. If this property is set to true, a trigger will only fire once.

Latched

When a trigger is latched it means it has fired and will never fire again. This happens when a OneShot trigger fires. When that happens, the Latched property is automatically set to True. You shouldn’t change this property in the script editor.

You can use a Property trigger to check to see if another trigger is “latched.” This is useful in cases where you want to give the user an award after they’ve completed one or multiple parts of a mission.

OnScreenTimer

You can choose a trigger with a timer element to be the onscreen timer, but it is unclear how to actually display this in msfs.

Common triggers

AirportLandingTrigger & AreaLandingTrigger

Detects landings on a runway or in an area.

CounterTrigger

Has a counter that can be changed by a CountAction. It fires when a specific count has been reached.

PropertyTrigger

A propertytrigger is a very useful trigger. It can be used for instance to fire when the users' plane reaches a specific altitude or speed.

ProximityTrigger

A proximity trigger fires when objects enters or exits an area.

TimerTrigger

A timer trigger is a very useful trigger that is often used to start the first actions in the mission.

Event

EventTrigger

See: MSFS Mission Script - Events.

Flowstate

FlowEventTrigger

TimerTriggerFlowStateAction

See: MSFS Mission Script - Flow states.

Untested triggers

AnimationEventTrigger

CameraEventTrigger

CollisionTrigger

LastLapTrigger

MenuPromptTrigger

ObjectInteractionTrigger

ParkingTrigger

RaceEndTrigger

NodeDistanceTrigger