Mission Creation for MSFS: Difference between revisions
(Created page explaining the mission creation process for msfs) |
(Describe the process) |
||
| Line 36: | Line 36: | ||
== Process == | == Process == | ||
=== Come up with a basic storyline === | |||
The first step of creating a mission is coming up with a scenario and story. You can make a tutorial, emergency scenario, even a treasure hunt, but you will need to think of a mission progression. What is the start of the mission? What will you need to tell the player and what will they have to find out on their own? What are the possible ways to complete the mission? Are there branching paths? And of course, how will the mission end? Will the player receive a grade or reward? | |||
It can help to have a written structure. Think of it as a screenplay, and follow the same three-stage layout. | |||
The first section is your introduction. You need to get the player's interest, explain who they are and why they're there. You use the first bit to get everything set up so that when The Exciting Thing happens, they know why and what to do about it. | |||
In part two, The Exciting Thing happens. It doesn't matter what it is, but assuming you have some kind of event to which the player is supposed to react, this part details what happens. Once they've managed to cope with the situation and get it under control, they move on to... | |||
Part three, the conclusion. Having successfully dealt with the engine fire/squalling brats in the back seats/condor-strike, the player gets to reflect on what they've done and enjoy the feeling of success for a little while. You could always throw in a last-minute plot twist of course. | |||
Structuring like this gives you a tidy way of making your mission appear much more complex. You can easily provide different threads, or ways of achieving something, without too much extra effort. Let's say your Introduction sees the player getting from a bush strip to the head of a particular valley. You start with them following the river, simple enough. Later on, you could add the option to fly across the peaks and save time; as long as they reach the same head of the same valley, the rest of the mission isn't affected. If they've tried the mission before and failed, chances are they'll decide to try shortcuts anyway. Wouldn't it feel better if, having decided to cross the ridge instead of fly round, the mission reacts to that by saying "Hey, you're going over the ridge! A bit risky in this weather but the views will be stunning"? You can issue different Rewards, or maybe even alter how the next section plays out, depending on the path they took. | |||
In short, you can see your mission sections as leading up to choke-points, such as the head of the valley. If you have three sections, each with three different ways of achieving it, that's nine different ways of flying a single mission. | |||
=== Turn your story into a mission === | |||
Now comes the longest, and hopefully the most fun part; turning your idea into an immersive mission. | |||
First, you have to clearly define the flow of the mission. You may find it easier to have a big sheet of paper and draw the mission out in pencil before you start coding. That lets you work out how it fits together logically without having to worry about whether or not you've got the spelling right. | |||
For example, you know that after you take off you want to have some speech, and then there are three ways of getting from A to B, where the next section starts. OK, so that's three boxes to draw; 'Takeoff', 'Speech' and 'At point B'. The speech should happen 30 seconds after takeoff, so note that down next to the Speech box. Then you can draw three lines between 'Speech' and 'At Point B' to show the three paths, and the first thing to do on each path is disable the other two paths. | |||
Already you've got a decent map of what happens in what order, and translating from these into actual mission-system code will be easier. | |||
Read the list of possible [[MSFS_Mission_Script_-_Actions|Actions]] and [[MSFS_Mission_Script_-_Triggers|Triggers]], to find out what kinds of things you can check for and do. Try and spot a likely match for each of the boxes on your sheet of paper. | |||
To keep the example going, you might have a [[Property Trigger]] checking "Altitude AGL > 10" to test for takeoff. That would start a 30-second [[Timer Trigger]] using an [[Object Activation Action] which, in turn, would call a [[Dialog Action]] for your "Speech" box. You would need one Trigger per potential path; they might be set to detect altitude, or heading, or more likely that the player has entered an area. Each of those would need another [[Dialog Action]] (just to keep the player informed), an [[Object Activation Action]] to enable the Trigger that checks "At Point B" and another [[Object Activation Action]] to disable the other two paths. | |||
=== Create a mission project === | |||
You have to create a mission project with the MSFS devmode. You can enable the devmode in <code>General Settings>Developers</code>. | |||
To create a new mission project, click <code>[DevMode] > New project > Select location and name > select custom > Add a display title, package name, and select content type MISSION > Set the asset type to Mission and name it MissionName-Mission > create</code>. | |||
=== Decide on flight conditions === | === Decide on flight conditions === | ||
Next, you will have to configure the flight conditions. To start, you can create a [[flightplan (MSFS)|flight plan]] in the worldmap or with [[Little Navmap]]. This flight plan will be shown to the player when the mission starts, so it shouldn't spoil the unexpected parts of the flight (e.g., an emergency). | |||
Then you decide on the starting point of the mission (e.g., at the beginning of the flight or in the air somewhere along the route). | |||
==== [[Flight_file_(MSFS)|Create the flight file]] ==== | |||
Load the flightplan and select the desired starting location in the worldmap. Now choose the aircraft, livery, fuel, payload, and atc options. Then choose the time, weather preset, and the multiplayer and traffic settings. Load the flight. Set up the aircraft how you want it (lights, switches, autopilot, etc.). You can customize the weather and save it as a preset. Lastly, locate the plane exactly where you want it, with the correct speed and trim settings. Then click <code>ESC</code> to pause the game and then <code>SPACE</code> to save the flight as a <code>.FLT</code>. Move the flight file and flightplan to the mission project. | |||
You will need to [[Flight_file_(MSFS)#Creating_your_flight_file|manually edit the .FLT]] to choose the assistance preset, mission category, traffic, briefing and loading screen. | |||
===== Add pictures ===== | |||
Lastly, you will have to add pictures for the mission thumbnail, and the loading, briefing, and ending screens. The names for the loading an briefing pictures are defined in the [[Flight_file_(MSFS)#Creating_your_flight_file|.FLT file]]. The thumbnail will need to be named: <code>Activity_Widget.jpg</code> and the endscreen picture will need to be named: <code>rewardscreen.jpg</code>. | |||
==== [[Weather definitions (MSFS)|Define custom weather]] ==== | |||
You can customize the weather with the weather panel during flight. Save it as a new preset. You can find the .WPR file in <code>\AppData\Roaming\Microsoft Flight Simulator\Weather\Presets\</code>. Move it next to the .flt file and rename it to <code>Weather.WPR</code>. You can fine-tune the weather by editing the .WPR file in Notepad++. | |||
=== | === Set up a [[:Category:MSFS Mission Script|mission script]] === | ||
The [[:Category:MSFS Mission Script|mission script]] defines everything that happens after spawn. | |||
There are some basic parts to each mission that you will have to define first. | |||
==== [[MSFS_Mission_Script_-_Mission_objects#Defining_the_mission_type|Mission type]] ==== | |||
There are [[MSFS_Mission_Script_-_Mission_objects#List_of_Mission_Types|different mission types]] to choose from. You need to add one of them to your script, to enable the mission ending. The mission will end when all active objectives have been completed. Each objective in the mission is connected with a corresponding goal, the state of which can be <code>Pending, Completed, Failed,</code> and <code>Aborted</code>. If all active objectives are marked as completed, the mission will end in success. | |||
==== [[MSFS_Mission_Script_-_Flow_states|Flowstates]] ==== | |||
MSFS introduced [[MSFS_Mission_Script_-_Flow_states#Flow_states|flowstates]], which determine the flight state, and [[MSFS_Mission_Script_-_Flow_states#Flow_events|flowevents]], which control sim-level actions (e.g., pausing the sim, show startup info, disabling the ATC panel). | |||
You should add an intro with a [[MSFS_Mission_Script_-_Flow_states#FlowStateAction|FlowStateAction]]. | |||
=== Coding your mission === | === Coding your mission === | ||
Now you will turn your mission diagram from step 3 into a mission script. For this you can use the Devmode and the script editor. | |||
==== [[:Category:MSFS_Mission_Script#Building_blocks|Script Building Blocks]] ==== | |||
The script is mostly made up of a few building blocks: | |||
===== [[MSFS Mission Script - Triggers|Triggers]] & [[MSFS Mission Script - Actions|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. | |||
===== [[MSFS Mission Script - Mission objects|Mission objects]] ===== | |||
Mission elements define a range of things like mission type, goals, world traffic, camera, and thermals. | |||
===== [[MSFS Mission Script - Calculator|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. | |||
===== For a complete overview, see [[:Category:MSFS_Mission_Script#Building_blocks|MSFS Script]] ===== | |||
=== Compiling the mission === | |||
{{Template:Navbox-Mission-Creation-MSFS}} | {{Template:Navbox-Mission-Creation-MSFS}} | ||
Revision as of 08:54, 22 November 2021
| This page is a work-in-progress. Generic message - Please note some detail may possibly be missing or incorrect. |
| Applicable |
|---|
| MSFS |
| MS Flight |
| LM P3D5 |
| LM P3D4 |
| LM P3D3 |
| LM P3D2 |
| LM P3D |
| FS World |
| FSXSE |
| FSXA |
| FSX |
| FS2004 |
| FS2002 |
| XP11 |
| XP10 |
| XP9 |
Overview
Creating a mission is a complex task involving a diverse use of tools & skills. Getting your first mission going is likely to cause you some headaches.
Still here? Good. Once you do have that first one running, the sky's your limit. That basic set of rules and files that make up a mission are always the same so once you've got those sorted, it's just a case of coming up with an idea and writing it.
At it's simplest, a mission is just a scripted set of events that tell some kind of story. It may be dramatic - mountain rescue, failing aircraft, poor weather. It could just as easily be a simple flight from A to B with you pointing out areas of interest along the way, or a completely abstract challenge like finding out how many times you can touch-and-go in a 747 in five minutes.
Technically speaking, there are two main classes of 'things' in a mission; Actions and Triggers. An Action makes something happen, and a Trigger checks to see if something's happened and calls an Action if it has. By stringing together Actions and Triggers, you tell your story.
You'll also need to prepare the conditions of your flight; what will be the plane, time, location, route, and weather of your mission? Are there other planes flying around or parked on the airport? And how much assistance will you give the player?
Lastly, your mission will need sound files for the mission speech and some text and images for the briefing, loading, and ending screens.
Process
Come up with a basic storyline
The first step of creating a mission is coming up with a scenario and story. You can make a tutorial, emergency scenario, even a treasure hunt, but you will need to think of a mission progression. What is the start of the mission? What will you need to tell the player and what will they have to find out on their own? What are the possible ways to complete the mission? Are there branching paths? And of course, how will the mission end? Will the player receive a grade or reward?
It can help to have a written structure. Think of it as a screenplay, and follow the same three-stage layout.
The first section is your introduction. You need to get the player's interest, explain who they are and why they're there. You use the first bit to get everything set up so that when The Exciting Thing happens, they know why and what to do about it.
In part two, The Exciting Thing happens. It doesn't matter what it is, but assuming you have some kind of event to which the player is supposed to react, this part details what happens. Once they've managed to cope with the situation and get it under control, they move on to...
Part three, the conclusion. Having successfully dealt with the engine fire/squalling brats in the back seats/condor-strike, the player gets to reflect on what they've done and enjoy the feeling of success for a little while. You could always throw in a last-minute plot twist of course.
Structuring like this gives you a tidy way of making your mission appear much more complex. You can easily provide different threads, or ways of achieving something, without too much extra effort. Let's say your Introduction sees the player getting from a bush strip to the head of a particular valley. You start with them following the river, simple enough. Later on, you could add the option to fly across the peaks and save time; as long as they reach the same head of the same valley, the rest of the mission isn't affected. If they've tried the mission before and failed, chances are they'll decide to try shortcuts anyway. Wouldn't it feel better if, having decided to cross the ridge instead of fly round, the mission reacts to that by saying "Hey, you're going over the ridge! A bit risky in this weather but the views will be stunning"? You can issue different Rewards, or maybe even alter how the next section plays out, depending on the path they took.
In short, you can see your mission sections as leading up to choke-points, such as the head of the valley. If you have three sections, each with three different ways of achieving it, that's nine different ways of flying a single mission.
Turn your story into a mission
Now comes the longest, and hopefully the most fun part; turning your idea into an immersive mission.
First, you have to clearly define the flow of the mission. You may find it easier to have a big sheet of paper and draw the mission out in pencil before you start coding. That lets you work out how it fits together logically without having to worry about whether or not you've got the spelling right.
For example, you know that after you take off you want to have some speech, and then there are three ways of getting from A to B, where the next section starts. OK, so that's three boxes to draw; 'Takeoff', 'Speech' and 'At point B'. The speech should happen 30 seconds after takeoff, so note that down next to the Speech box. Then you can draw three lines between 'Speech' and 'At Point B' to show the three paths, and the first thing to do on each path is disable the other two paths.
Already you've got a decent map of what happens in what order, and translating from these into actual mission-system code will be easier.
Read the list of possible Actions and Triggers, to find out what kinds of things you can check for and do. Try and spot a likely match for each of the boxes on your sheet of paper.
To keep the example going, you might have a Property Trigger checking "Altitude AGL > 10" to test for takeoff. That would start a 30-second Timer Trigger using an [[Object Activation Action] which, in turn, would call a Dialog Action for your "Speech" box. You would need one Trigger per potential path; they might be set to detect altitude, or heading, or more likely that the player has entered an area. Each of those would need another Dialog Action (just to keep the player informed), an Object Activation Action to enable the Trigger that checks "At Point B" and another Object Activation Action to disable the other two paths.
Create a mission project
You have to create a mission project with the MSFS devmode. You can enable the devmode in General Settings>Developers.
To create a new mission project, click [DevMode] > New project > Select location and name > select custom > Add a display title, package name, and select content type MISSION > Set the asset type to Mission and name it MissionName-Mission > create.
Decide on flight conditions
Next, you will have to configure the flight conditions. To start, you can create a flight plan in the worldmap or with Little Navmap. This flight plan will be shown to the player when the mission starts, so it shouldn't spoil the unexpected parts of the flight (e.g., an emergency).
Then you decide on the starting point of the mission (e.g., at the beginning of the flight or in the air somewhere along the route).
Create the flight file
Load the flightplan and select the desired starting location in the worldmap. Now choose the aircraft, livery, fuel, payload, and atc options. Then choose the time, weather preset, and the multiplayer and traffic settings. Load the flight. Set up the aircraft how you want it (lights, switches, autopilot, etc.). You can customize the weather and save it as a preset. Lastly, locate the plane exactly where you want it, with the correct speed and trim settings. Then click ESC to pause the game and then SPACE to save the flight as a .FLT. Move the flight file and flightplan to the mission project.
You will need to manually edit the .FLT to choose the assistance preset, mission category, traffic, briefing and loading screen.
Add pictures
Lastly, you will have to add pictures for the mission thumbnail, and the loading, briefing, and ending screens. The names for the loading an briefing pictures are defined in the .FLT file. The thumbnail will need to be named: Activity_Widget.jpg and the endscreen picture will need to be named: rewardscreen.jpg.
Define custom weather
You can customize the weather with the weather panel during flight. Save it as a new preset. You can find the .WPR file in \AppData\Roaming\Microsoft Flight Simulator\Weather\Presets\. Move it next to the .flt file and rename it to Weather.WPR. You can fine-tune the weather by editing the .WPR file in Notepad++.
Set up a mission script
The mission script defines everything that happens after spawn.
There are some basic parts to each mission that you will have to define first.
Mission type
There are different mission types to choose from. You need to add one of them to your script, to enable the mission ending. The mission will end when all active objectives have been completed. Each objective in the mission is connected with a corresponding goal, the state of which can be Pending, Completed, Failed, and Aborted. If all active objectives are marked as completed, the mission will end in success.
Flowstates
MSFS introduced flowstates, which determine the flight state, and flowevents, which control sim-level actions (e.g., pausing the sim, show startup info, disabling the ATC panel).
You should add an intro with a FlowStateAction.
Coding your mission
Now you will turn your mission diagram from step 3 into a mission script. For this you can use the Devmode and the script editor.
Script Building Blocks
The script is mostly made up of a few building blocks:
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.
For a complete overview, see MSFS Script
Compiling the mission
- 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