Category:MSFS Mission Script

From FSDeveloper Wiki
Revision as of 13:04, 25 May 2024 by BASys (talk | contribs) (Replaced Applicable-FSVersion for MSFS with MSFS2020, added MSFS2024)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


The mission script defines everything that happens in your mission after spawn. The mission script uses .xml files and can be opened with the MSFS Script Editor. The SDK documentation here is still lacking currently.

Building blocks

The mission script is made up of different elements shown as nodes in the MSFS Script Editor.

There are a few alternative names for the building blocks. They can be called elements, nodes, or objects. These names can be used pretty much interchangeably.

Triggers & Actions

The basic parts of a mission script are triggers and actions. When a trigger ‘fires’, it can start different actions and activate other triggers. A bunch of these together makes up a basic mission.

Mission objects

Mission elements define a range of things like mission type, goals, world traffic, camera, and thermals.

Calculators

You can use calculators for more advanced logic in your mission. It can take in multiple variables and trigger different actions based on a logic. You can also use this to calculate a mission score and probably many more applications which you can explore.

Flowstates

Flowstates are the different parts of a mission or freeflight such as intro, approach, and parking. FlowstateEvents are special actions which control ‘meta’ or ‘sim-level’ actions such as enabling the VFR map, pausing the simulation, and changing the camera.

You can also add animated intros and and outros with flowstates, like the ones in bushtrips, landing challenges, and freeflight.

Events

Events are used to notify the user with popups such as flying tips. The event only has to be defined once, and then it can be triggered by the mission script.

Areas

Area elements are actually volumes that are placed in the world, except for InGameMarkers, which are POI markers you can easily place in the world.

LibraryObjects

SimObjects

Simobjects are objects that react to the world, usually with an AI (e.g. animals, fuel trucks, wind sockets, airplanes). They can be added in the mission with Containers and Flocks.

RTC

RTC's (Real Time Cinematics) take animation information from a glTF file and convert it into a cinematic camera event based on triggers.

FlightPlan

General Element Attributes

There are some general attributes of mission elements:

Name Required Description
InstanceId / GUID Yes All elements of the mission script need to have a unique GUID.
Id No Give every element an short, unique id that tells you what it is and does.
Description No A short description of what the element does.
Activated No Some elements can be active or inactive. If they are marked as 'activated' it means they are active from spawn. Elements can be activated and deactivated throughout the mission with an Object Activation Action. This can be used for instance to limit a trigger to only be 'hot' after it has been activated by something else in the mission.
VRDependency No Can be VROnly or NonVROnly. Only enables the element if the condition applies.

Edition

Edition are aides for developers such as the visual script editor and comments. If you save a script from the script editor, you will notice an additional file with _edition appended to it. That file contains the positions of the nodes in the script editor. In the script editor you can also add comments to clear up the workings of your script. Comments can be resized to contain nodes. The comment can be used to move all containing nodes, they can also have a title, text, and color.

Localisation

User-facing strings can be localized. This means they can easily be changed and translated without changing the mission script.

Other parts of a mission

Tools

There are official and unofficial tools that can help you with mission creation.


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).