MSFS Mission Script - Actions: Difference between revisions
m (→Action related to Mission objects: Fixed links) |
m (Replaced Applicable-FSVersion for MSFS with MSFS2020, added MSFS2024) |
||
| (12 intermediate revisions by one other user not shown) | |||
| Line 4: | Line 4: | ||
{{Infobox-Applicable-FSVersion | {{Infobox-Applicable-FSVersion | ||
| | | MSFS2024 = unknown | ||
| MSFS2020 = true | |||
| FSXI = false | | FSXI = false | ||
| P3D5 = false | | P3D5 = false | ||
| Line 21: | Line 22: | ||
| XP9 = false | | XP9 = false | ||
}} | }} | ||
Actions are mission functions that perform various tasks, such as activating objects, executing code, controlling timers, playing sounds, triggering events, and shaping the flow of the mission. | |||
{{:Transclusion_MSFS_Mission_Script}} | |||
== Action queue == | |||
All actions are fired in the order they’re listed in the ObjectReferenceList of the trigger that fired. This is important, because Dialog actions take time to play and will delay any actions that follow them. If a delay is set on a Dialog action, then the next action in the queue will be delayed by that amount. You can arrange the order in which actions in a given queue fire by changing the order manually in the .xml. | All actions are fired in the order they’re listed in the ObjectReferenceList of the trigger that fired. This is important, because Dialog actions take time to play and will delay any actions that follow them. If a delay is set on a Dialog action, then the next action in the queue will be delayed by that amount. You can arrange the order in which actions in a given queue fire by changing the order manually in the .xml. | ||
== Common actions == | |||
[[Object Activation Action|ObjectActivationAction]], [[Dialog Action|DialogAction]], [[Change Assistance Item Action|ChangeAssistanceItemAction]], [[Failure Action|FailureAction]], [[Adjust Payload Action|AdjustPayloadAction]], [[Refill Action|RefillAction]], [[MSFS_Mission_Script_-_Flow_states#FlowStateAction|FlowStateAction]]. | |||
== General attributes == | == General attributes == | ||
Actions have a few general attributes: | Actions have a few general attributes: | ||
=== Immediate === | === Immediate === | ||
'''False:''' This action will wait for prior action in the action queue to complete. The order is determined by the order the actions are listed in the trigger. This can be changed by manually editing the order in the '''Actions''' section of the element in the mission .xml.<br> | |||
'''True:''' This action will ignore the action queue and start immediately. | |||
'''False:''' This action will wait for | |||
=== BreakOnExecute === | === BreakOnExecute === | ||
Official description: "Code break if action is executed". Not sure what that means | Official description: "Code break if action is executed". Not sure what that means | ||
=== TargetPlayer === | === TargetPlayer === | ||
The target player refers to the target of an action in a multiplayer mission. Action Target can be the GUID of a particular player or team, or you can use one of the specially defined guids to refer to relative targets: | The target player refers to the target of an action in a multiplayer mission. Action Target can be the GUID of a particular player or team, or you can use one of the specially defined guids to refer to relative targets: | ||
| Line 51: | Line 56: | ||
|} | |} | ||
== | == Mission logic == | ||
==== [[Object Activation Action|ObjectActivationAction]] ==== | ==== [[Object Activation Action|ObjectActivationAction]] ==== | ||
Very useful action to (de)activate objects such as triggers and InGameMarkers. | Very useful action to (de)activate objects such as triggers and InGameMarkers. | ||
==== [[Random_Action|RandomAction]] ==== | |||
Randomly executes one action from a list. First, the action has a probability that any action is executed at all. If it does execute, it randomly chooses one action that will execute. | |||
==== | ==== ExecuteRPNAction ==== | ||
Execute RPN code. | |||
==== SkipAction ==== | |||
==== | Skip an action. | ||
==== StopObjectActionQueueAction ==== | |||
Stop action queues of referenced objects | |||
==== | ==== ExecuteListAction ==== | ||
Execute a list of action | |||
==== | ==== WaitAction ==== | ||
Action that does nothing... for a predefined time. You can use this to delay the next items in an actionQeue. | |||
==== | |||
== Actions related to a trigger == | == Actions related to a trigger == | ||
==== [[Count Action|CountAction]] ==== | ==== [[Count Action|CountAction]] ==== | ||
Changes the count of a [[Counter_Trigger|CounterTrigger]] | Changes the count of a [[Counter_Trigger|CounterTrigger]] | ||
==== [[Reset Timer Action|ResetTimerAction]] ==== | ==== [[Reset Timer Action|ResetTimerAction]] ==== | ||
Reset the timer to the StartTime. | |||
==== [[Timer Adjust Action|TimerAdjustAction]] ==== | ==== [[Timer Adjust Action|TimerAdjustAction]] ==== | ||
Adjusts the time of a [[Timer Trigger|TimerTrigger]] up or down. | |||
== Action related to [[MSFS Mission Script - Mission objects|Mission objects]] == | == Action related to [[MSFS Mission Script - Mission objects|Mission objects]] == | ||
==== [[(Sub)Goal_Resolution_Action|GoalResolutionAction & SubGoalResolutionAction]] ==== | ==== [[(Sub)Goal_Resolution_Action|GoalResolutionAction & SubGoalResolutionAction]] ==== | ||
Changes the state of a [[MSFS_Mission_Script_-_Mission_objects#Goals|(sub)goal]]. | Changes the state of a [[MSFS_Mission_Script_-_Mission_objects#Goals|(sub)goal]]. | ||
==== GrantRewardAction ==== | ==== [[Grant Reward Action|GrantRewardAction]] ==== | ||
Untested. | Untested. | ||
==== PointOfInterestActivationAction ==== | ==== [[Point Of Interest Activation Action|PointOfInterestActivationAction]] ==== | ||
(De)activates a [[point of interest]] | (De)activates a [[point of interest]] | ||
==== POIChangeModelAction ==== | |||
Unknown. | |||
== Sound == | |||
==== [[Dialog Action|DialogAction]] ==== | |||
Plays dialog for the copilot and atc. It can use sound files or text-to-speech (TTS). The dialogAction can also show subtitles. | |||
==== InstructorDialogAction ==== | |||
Same as a DialogAction, but allows for a male and female voice, depending on the player's selected instructor in the settings. | |||
==== OneShotSoundAction ==== | |||
Plays specified sound file. Doesn't seem to work in MSFS. | |||
==== PlayListAction ==== | |||
Plays through a list of sound files. Doesn't seem to work in MSFS. | |||
==== PlaySoundAction ==== | |||
Play a sound in 3D space. Uses a WWise event. | |||
==== StopSoundAction ==== | |||
Stop a sound. | |||
==== SoundEffectAction ==== | |||
Sets sound effects. Doesn't seem to work in MSFS. | |||
==== RTPCAction ==== | |||
Send a WWise RTPC. | |||
== Player/Aircraft == | |||
==== [[Change Assistance Item Action|ChangeAssistanceItemAction]] ==== | |||
Changes specific assistance items throughout the mission. | |||
==== [[Failure Action|FailureAction]] ==== | |||
Fail a system (e.g., fuel pump, gear, altimeter, radios). | |||
==== [[Adjust Payload Action|AdjustPayloadAction]] ==== | |||
Set or adjust the weight on a payload station (weight of pilot, passengers, baggage, etc). | |||
==== [[Refill Action|RefillAction]] ==== | |||
Add or subtract percent of a substance (e.g., fuel). | |||
==== ChangeObjectTypeAction ==== | |||
Change an object to a different type. | |||
==== [[Request Teleport Action|RequestTeleportAction]] ==== | |||
Request a teleport. | |||
==== RequestTeleportCameraAction ==== | |||
Teleport current camera to a position given in a CFG file (e.g, close instrument view, wide cockpit view, gear view). | |||
==== SkipTimeAction ==== | |||
Very cool action allowing you to speed up or skip time without affecting the simulation. It will speed up cloud movement and the day-night cycle, but keep the planes, other vehicles, and animations at the normal speed. | |||
== Action related to AI / Simobjects == | == Action related to AI / Simobjects == | ||
==== | ==== [[AI Take Controls Action|AITakeControlsAction]] ==== | ||
Changes control of the users' plane between user and AI. | Changes control of the users' plane between user and AI. | ||
==== SendMessageToAIAction ==== | ==== [[Send Message To AI Action|SendMessageToAIAction]] ==== | ||
Currently useless for missions. See [https://docs.flightsimulator.com/html/Content_Configuration/Environment/Living_World/Airport_Services/Service_And_IdleWorker_Script_Definitions.htm?rhhlterm=sendmessagetoaiaction#h2 documentation]. | Currently useless for missions. See [https://docs.flightsimulator.com/html/Content_Configuration/Environment/Living_World/Airport_Services/Service_And_IdleWorker_Script_Definitions.htm?rhhlterm=sendmessagetoaiaction#h2 documentation]. | ||
==== [[Activate Waypoints Action|ActivateWaypointsAction]] ==== | |||
Send waypoints to a [[Simobject]] for the AI to follow. | |||
==== WaypointsFromAnotherWaypointAction ==== | |||
Get waypoint list for another ActivateWaypointsAction. | |||
==== PlayFlightRecordingAction ==== | |||
Plays back recording for the [[MSFS_Mission_Script_-_Sim_Objects#AirplanePlaybackAI|AirplanePlaybackAI]]. | |||
== | ==== SpawnAction ==== | ||
==== | |||
== [[MSFS_Mission_Script_-_Flow_states|Flowstate]] == | |||
==== FlowEventAction ==== | |||
==== FlowStateAction ==== | |||
==== TimerTriggerFlowStateAction ==== | |||
==== TransitionAction ==== | |||
==== ToggleVisibilityAction ==== | |||
== [[MSFS_Mission_Script_-_Events|Event]] == | |||
==== EventTriggerActivationAction ==== | |||
==== EventTriggerAction ==== | |||
==== EventAction ==== | |||
== Animation / effects / RTC == | |||
==== [[Fade To Color Action|FadeToColorAction]] ==== | |||
Fades a color over the whole viewport. Useful for teleports and testing. | |||
==== AttachEffectAction ==== | ==== AttachEffectAction ==== | ||
Attach a visual effect to an object (e.g., plane, simobject). | |||
==== PlayAnimationAction ==== | ==== PlayAnimationAction ==== | ||
Play an animation. | |||
==== PlayBlendTreeStateAction ==== | ==== PlayBlendTreeStateAction ==== | ||
==== | Play a blend tree state. | ||
==== | ==== RTCLocationsPreloadAction ==== | ||
== Replay == | |||
==== RecordReplayAction ==== | |||
Record a new replay and store in file. | |||
==== PlayReplayAction ==== | ==== PlayReplayAction ==== | ||
Play a replay file. | |||
==== PlayGhostAction ==== | |||
Play a ghost replay. | |||
== Race == | |||
==== DisqualifyPlayerAction ==== | |||
Disqualify a player. | |||
==== RaceCourseActivateAction ==== | |||
Enable race course progress for all players. | |||
==== RaceClockStartAction ==== | ==== RaceClockStartAction ==== | ||
==== | Start the global race timer for all players. | ||
==== | ==== TimePenaltyAction ==== | ||
==== | Give a player a time penalty/bonus. | ||
==== BackOnTrackAction ==== | |||
When a crash occurs in a race course, the crash is 'not allowed' and the player is teleported to the pylon before his crash. | |||
== Other == | |||
==== FocusInstrumentAction ==== | |||
Focus the camera on a specific instrument. You can highlight the instrument as well (blue glow). | |||
==== RumbleAction ==== | ==== RumbleAction ==== | ||
==== | Controller rumble effect. | ||
==== CustomAction ==== | |||
==== | Create a custom action that uses an external program connected with simconnect. | ||
==== ChangeMarkerTemplateAction ==== | |||
Change marker template. | |||
==== ChangeRopeLinkAction ==== | ==== ChangeRopeLinkAction ==== | ||
Change link on ropes. | |||
==== ChangeNodeAction ==== | |||
Change node property (e.g. hide the yoke). | |||
==== AttachDroppablePayloadAction ==== | |||
Attach a droppable payload. | |||
==== AgentMessageAction ==== | |||
Send or reveive a message from an agent (ATC?). | |||
==== MissionScoreToLeaderboardAction ==== | |||
Try to send mission score to leaderboard. Not (yet) supported for unofficial missions. | |||
==== ShowLogbookAction ==== | |||
Show the logbook. | |||
==== FilterInputKeyAction ==== | |||
Change input key processing (e.g. turn of the input key for the elevator). | |||
{{Template:Navbox-Mission-Creation-MSFS}} | {{Template:Navbox-Mission-Creation-MSFS}} | ||
Latest revision as of 12:28, 25 May 2024
| This page is a work-in-progress. Generic message - Please note some detail may possibly be missing or incorrect. |
| Applicable |
|---|
| MSFS2024 |
| MSFS2020 |
| MS Flight |
| LM P3D5 |
| LM P3D4 |
| LM P3D3 |
| LM P3D2 |
| LM P3D |
| FS World |
| FSXSE |
| FSXA |
| FSX |
| FS2004 |
| FS2002 |
| XP11 |
| XP10 |
| XP9 |
Actions are mission functions that perform various tasks, such as activating objects, executing code, controlling timers, playing sounds, triggering events, and shaping the flow of the mission. See MSFS Mission Script for general information about creating a mission script.
Action queue
All actions are fired in the order they’re listed in the ObjectReferenceList of the trigger that fired. This is important, because Dialog actions take time to play and will delay any actions that follow them. If a delay is set on a Dialog action, then the next action in the queue will be delayed by that amount. You can arrange the order in which actions in a given queue fire by changing the order manually in the .xml.
Common actions
ObjectActivationAction, DialogAction, ChangeAssistanceItemAction, FailureAction, AdjustPayloadAction, RefillAction, FlowStateAction.
General attributes
Actions have a few general attributes:
Immediate
False: This action will wait for prior action in the action queue to complete. The order is determined by the order the actions are listed in the trigger. This can be changed by manually editing the order in the Actions section of the element in the mission .xml.
True: This action will ignore the action queue and start immediately.
BreakOnExecute
Official description: "Code break if action is executed". Not sure what that means
TargetPlayer
The target player refers to the target of an action in a multiplayer mission. Action Target can be the GUID of a particular player or team, or you can use one of the specially defined guids to refer to relative targets:
| Local User | {8B7615FA-BBBF-4baa-B959-5EF4F59BB575} |
| All Players | {D09ADD85-4CA8-4be9-939C-4544BA259DA2} |
| Trigger | {9A82F89B-F271-4285-AE90-1F733945D975} |
| All Players Except Trigger | {D2764AC8-FBB3-4b9b-9721-3C3EA0CB402B} |
Mission logic
ObjectActivationAction
Very useful action to (de)activate objects such as triggers and InGameMarkers.
RandomAction
Randomly executes one action from a list. First, the action has a probability that any action is executed at all. If it does execute, it randomly chooses one action that will execute.
ExecuteRPNAction
Execute RPN code.
SkipAction
Skip an action.
StopObjectActionQueueAction
Stop action queues of referenced objects
ExecuteListAction
Execute a list of action
WaitAction
Action that does nothing... for a predefined time. You can use this to delay the next items in an actionQeue.
CountAction
Changes the count of a CounterTrigger
ResetTimerAction
Reset the timer to the StartTime.
TimerAdjustAction
Adjusts the time of a TimerTrigger up or down.
GoalResolutionAction & SubGoalResolutionAction
Changes the state of a (sub)goal.
GrantRewardAction
Untested.
PointOfInterestActivationAction
(De)activates a point of interest
POIChangeModelAction
Unknown.
Sound
DialogAction
Plays dialog for the copilot and atc. It can use sound files or text-to-speech (TTS). The dialogAction can also show subtitles.
InstructorDialogAction
Same as a DialogAction, but allows for a male and female voice, depending on the player's selected instructor in the settings.
OneShotSoundAction
Plays specified sound file. Doesn't seem to work in MSFS.
PlayListAction
Plays through a list of sound files. Doesn't seem to work in MSFS.
PlaySoundAction
Play a sound in 3D space. Uses a WWise event.
StopSoundAction
Stop a sound.
SoundEffectAction
Sets sound effects. Doesn't seem to work in MSFS.
RTPCAction
Send a WWise RTPC.
Player/Aircraft
ChangeAssistanceItemAction
Changes specific assistance items throughout the mission.
FailureAction
Fail a system (e.g., fuel pump, gear, altimeter, radios).
AdjustPayloadAction
Set or adjust the weight on a payload station (weight of pilot, passengers, baggage, etc).
RefillAction
Add or subtract percent of a substance (e.g., fuel).
ChangeObjectTypeAction
Change an object to a different type.
RequestTeleportAction
Request a teleport.
RequestTeleportCameraAction
Teleport current camera to a position given in a CFG file (e.g, close instrument view, wide cockpit view, gear view).
SkipTimeAction
Very cool action allowing you to speed up or skip time without affecting the simulation. It will speed up cloud movement and the day-night cycle, but keep the planes, other vehicles, and animations at the normal speed.
AITakeControlsAction
Changes control of the users' plane between user and AI.
SendMessageToAIAction
Currently useless for missions. See documentation.
ActivateWaypointsAction
Send waypoints to a Simobject for the AI to follow.
WaypointsFromAnotherWaypointAction
Get waypoint list for another ActivateWaypointsAction.
PlayFlightRecordingAction
Plays back recording for the AirplanePlaybackAI.
SpawnAction
Flowstate
FlowEventAction
FlowStateAction
TimerTriggerFlowStateAction
TransitionAction
ToggleVisibilityAction
Event
EventTriggerActivationAction
EventTriggerAction
EventAction
Animation / effects / RTC
FadeToColorAction
Fades a color over the whole viewport. Useful for teleports and testing.
AttachEffectAction
Attach a visual effect to an object (e.g., plane, simobject).
PlayAnimationAction
Play an animation.
PlayBlendTreeStateAction
Play a blend tree state.
RTCLocationsPreloadAction
Replay
RecordReplayAction
Record a new replay and store in file.
PlayReplayAction
Play a replay file.
PlayGhostAction
Play a ghost replay.
Race
DisqualifyPlayerAction
Disqualify a player.
RaceCourseActivateAction
Enable race course progress for all players.
RaceClockStartAction
Start the global race timer for all players.
TimePenaltyAction
Give a player a time penalty/bonus.
BackOnTrackAction
When a crash occurs in a race course, the crash is 'not allowed' and the player is teleported to the pylon before his crash.
Other
FocusInstrumentAction
Focus the camera on a specific instrument. You can highlight the instrument as well (blue glow).
RumbleAction
Controller rumble effect.
CustomAction
Create a custom action that uses an external program connected with simconnect.
ChangeMarkerTemplateAction
Change marker template.
ChangeRopeLinkAction
Change link on ropes.
ChangeNodeAction
Change node property (e.g. hide the yoke).
AttachDroppablePayloadAction
Attach a droppable payload.
AgentMessageAction
Send or reveive a message from an agent (ATC?).
MissionScoreToLeaderboardAction
Try to send mission score to leaderboard. Not (yet) supported for unofficial missions.
ShowLogbookAction
Show the logbook.
FilterInputKeyAction
Change input key processing (e.g. turn of the input key for the elevator).
- Flightplan
- Weather definitions
- Flight file
- Mission script
- Triggers
- Actions
- ObjectActivationAction · DialogAction · AdjustPayloadAction · ChangeAssistanceItemAction · FadeToColorAction · RandomAction · RequestTeleportAction · CountAction · ResetTimerAction · TimerAdjustAction · GoalResolutionAction & SubGoalResolutionAction · GrantRewardAction · PointOfInterestActivationAction · ActivateWaypointsAction · AITakeControlsAction · SendMessageToAIAction
- Mission objects
- Calculator
- Flow states
- Events
- Areas
- Library objects
- Sim objects
- RTC