Difference between revisions of "MSFS Mission Script - Triggers"

From FSDeveloper Wiki
Jump to: navigation, search
(ProximityTrigger: Add WhileInside explanation)
(EventTrigger: Add event explanation)
Line 80: Line 80:
 
== [[MSFS_Mission_Script_-_Events|Event]] ==
 
== [[MSFS_Mission_Script_-_Events|Event]] ==
 
==== EventTrigger ====
 
==== EventTrigger ====
 +
Events are text popups you can put on the screen.
  
 
== [[MSFS Mission Script - Flow states|Flowstate]] ==
 
== [[MSFS Mission Script - Flow states|Flowstate]] ==

Revision as of 07:55, 6 December 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.

Mission logic

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.

CounterTrigger

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

TriggersFiredTrigger

Triggers when all triggers in list fired at least once.

TimelineAction

Start a timer and execute actions at specific times.

Player

MenuPromptTrigger

Provides GUI billboard menu and executes the mission actions for the chosen item. Not yet implemented in MSFS.

InputActionTrigger

When active, wait for inputs to be triggered (e.g., keypress, joystick button).

ValidatedChecklistStepTrigger

Fires when a specific checklist step is all validated.

ObjectInteractionTrigger

Fires when interacting with object

CockpitInteractionTrigger

Fires when the users interacts with a cockpit element.

CameraTargetTrigger

Trigger that fires when in camera frustum. So when it is in the boundaries of the camera, but it can be behind something else.

Plane

AirportLandingTrigger & AreaLandingTrigger

Detects landings on a runway or in an area.

PropertyTrigger

A propertytrigger is a very useful trigger. The trigger can take in Simvars to create a condition for firing. It can be used for instance to fire when the users' plane reaches a specific altitude or speed.

ProximityTrigger

Fires when objects enters or exits an area, or checks if an object is currently inside.

CollisionTrigger

Fires when user collides with the given object(s).

ProgressiveTaxiTrigger

Fires at the end of progressive taxi.

ParkingTrigger

Fires when the user parks in the ATC-designated spot

Event

EventTrigger

Events are text popups you can put on the screen.

Flowstate

FlowEventTrigger

Triggers when a certain flow event is fired.

TimerTriggerFlowStateAction

See: MSFS Mission Script - Flow states.

Race

RaceEndTrigger

Fires when local user completes the race (not necessarily when race is declared over).

LastLapTrigger

Fires when local user starts the last lap of the race.

Other

AnimationEventTrigger

When active, wait for an animationEvent before executing actions.

EndAnimationTrigger

Fires when an animation is over.

CameraEventTrigger

When active, wait for an cameraEvent before executing actions.

EndRTCTrigger

Triggers when the RTC ends.

AtoB_SphereWPTrigger

A to B waypoint

OnSpawnTrigger

Fires when the player's plane is spawned during loading. This allows you to do some things before the loading has ended. For example fire an RTCLocationsPreloadAction.

OnEndLoadingTrigger

AssistanceTrigger

NodeDistanceTrigger

Pages relevant to mission creation for MSFS.

Mission structure

Flightplan
Weather definitions
Flight file
Mission script
Triggers
AirportLandingTrigger & AreaLandingTrigger · CounterTrigger · PropertyTrigger · ProximityTrigger · TimerTrigger
Actions
ObjectActivationAction · DialogAction · AdjustPayloadAction · ChangeAssistanceItemAction · FadeToColorAction · RandomAction · RequestTeleportAction · CountAction · ResetTimerAction · TimerAdjustAction · GoalResolutionAction & SubGoalResolutionAction · GrantRewardAction · PointOfInterestActivationAction · ActivateWaypointsAction · AITakeControlsAction · SendMessageToAIAction
Mission objects
Mission definition · Goal · LivingWorldExclusion · Camera
Calculator
Flow states
Events
Areas
Rectangle Area · Cylinder Area · Polygon Area · Corridor Area · InGameMarker
Library objects
Sim objects
RTC

Mission tools

MSFS Script Editor · BushTripInjector · BushMissionGen · MSFSLocalizer · SPB2XML · Little Navmap

Other

Example mission files
Porting FSX Missions to MSFS
Localisation
Click the links to access the topic pages (Default - Opens in same window).