MSFS Mission Script - Triggers

From FSDeveloper Wiki
Revision as of 17:26, 1 October 2021 by Mr LiamT (talk | contribs) (Created page to explain and list trigger elements of the msfs mission script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Triggers fire when a condition is met. When a trigger fires, the actions referenced in the ObjectReferenceList are played.

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.

Common triggers

AirportLandingTrigger

Detects landings on a runway.

AreaLandingTrigger

Detects landings in an area.

CounterTrigger

Has a counter that can be changed by a CountAction. It fires when a specif 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