MSFS Mission Script - Triggers: Difference between revisions

From FSDeveloper Wiki
Jump to navigationJump to search
Line 56: Line 56:
A proximity trigger fires when objects enters or exits an area.
A proximity trigger fires when objects enters or exits an area.
==== [[Timer Trigger|TimerTrigger]] ====
==== [[Timer Trigger|TimerTrigger]] ====
A timer trigger is a very useful trigger that is often used to start the first actions in the mission.
A timer trigger is a very useful trigger that waits a specified number of seconds before executing actions. It is often used to start the first actions in the mission.


== Event ==
== Event ==

Revision as of 10:22, 13 October 2021


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

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

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.

IsGlobal

In multiplayer missions, triggers with the IsGlobal property set to True will affect all other players. Probably doesn't work 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 waits a specified number of seconds before executing actions. It 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