# Building An Aircraft Package This page is to help explain how to setup a package to test an aircraft that is in the process of being developed, and is included as part of the [Aircraft Creation Workflow](aircraft-creation-workflow/). The package you build using this short tutorial won't be perfect, as none of the animations will work, the LODs will probably be wrong, and the aircraft will *not* fly like it's supposed to... however these issues can't be resolved without being able to test the package in the simulation, so here we give instructions on how to go ahead and build the package so it can be worked on in [The SimObject Editor](../../../devmode/editors/simobject-editor/the-simobject-editor/).   Note this page assumes that you have created a project using the **modular aircraft template**, have [exported all the models](../../../models-and-textures/modeling/aircraft/model-exporting/), and have setup the [minimum CFG and XML](../../../content-configuration/models/simobject-model-files-setup/) files required.     ### Project Editor The first thing you have to do is run Microsoft Flight Simulator 2024, and then - when you are on the main menu for the simulation - you need to open the **Project Editor**. This is done from the [Editors](../../../devmode/menus/editors/) menu. In the Project Editor, go to the **Project** menu and select *Open Project* then browse to the folder where you saved the base template files earlier and select the project XML file. The Project Editor will now look like this: {{< image-center src="images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_1_project.png" alt="The Project Editor Window" >}} You can now *right click* on the aircraft asset group and select **Open In Editor** to start editing the aircraft in [The SimObject Editor](../../../devmode/editors/simobject-editor/the-simobject-editor/) and get it ready to fly.     ### Attachments At this point you *could* build the package and start a free flight, but there will be no aircraft visible as it hasn't been configured yet, and so the very first thing that is required is to set up the SimAttachments with the different aircraft parts that you exported. This is done from a *preset* which you can add in the editor, or - if you're using the modular aircraft package template - you can simply select the "default" preset for now (it can be renamed later if needed). In the preset you should go to the [Attached Objects](../../../content-configuration/cfg-files/attached_objects.cfg/) tab, as this is where we will be connecting all the parts of the model: {{< image-center src="images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_4_attachments.png" alt="Attached Objects CFG In The SimObject Editor" >}}   For each part of your aircraft you will need to define a SimAttachment here. This is done by clicking on the {{< button "+" />}} button and then editing the fields for each attachment. Initially you will need to supply the following for each of the parts:   - [attachment\_root](../../../content-configuration/cfg-files/attached_objects.cfg/#attachment_root) - This is the relative path to the model folder for the part. It follows this format (and will need to be added manually, as the {{< button "..." />}} button is only used for [Included Attachments](../../../content-configuration/modular-simobjects/simattachments/included-attachments/included-attachments/)): SimObjects\(Airplanes\)<Aircraft>\(attachments\)<Company>\\<PartName>\\   - [attachment\_file](../../../content-configuration/cfg-files/attached_objects.cfg/#attachment_file) - This defines the model XML file that is to be used for the attachment. Once you've set the *root* path, you can click the {{< button "..." />}} button here to select the XML file you need. It follows this format: model\\<PartName>.xml   - [attach\_to\_model](../../../content-configuration/cfg-files/attached_objects.cfg/#attach_to_model) - This sets whether the part is being attached to the *exterior* or *interior* model (the interior and exterior models are defined by the [model.cfg](../../../content-configuration/models/model.cfg/) for the helper node attach-point, as explained here: [SimObject Model XML and CFG Setup](../../../content-configuration/models/simobject-model-files-setup/)).   - [attach\_to\_model\_minsize](../../../content-configuration/cfg-files/attached_objects.cfg/#attach_to_model_minsize) - For the main aircraft parts, this should be set to 0, otherwise it can normally be left at the default value.   - [attach\_to\_node](../../../content-configuration/cfg-files/attached_objects.cfg/#attach_to_node) - This is an *optional* parameter that can be used to supply a node to attach the part to.   - [alias](../../../content-configuration/cfg-files/attached_objects.cfg/#alias) - This is a string which should be unique for each part and can be used to identify the part by name, rather than as a SimAttachment index.     ### Build And Test Having set up the attachments, you can actually build the package and test it in the simulation. To build the package, you simply need to click on the `Build All In Project` button at the top of the Project Editor window: {{< image-center src="images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_2_build.png" alt="The Build Package Button" >}}   Once the package has been built (Microsoft Flight Simulator 2024 may be unresponsive for a few seconds while this happens) you should be able to go into the hangar and select it: ![The New Aircraft In The Hangar](images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_3_ui.png)**NOTE**: If you don't see the aircraft in the hangar, or the package has an issue building, then see the section on [Troubleshooting](#troubleshoot) below.   If you select the aircraft and then start a free flight, the aircraft should be visible in the simulation - with all it's parts - and can actually be flown, although the flight model will be terrible since it hasn't been defined yet and will be running on default values which are unlikely to be appropriate. However, all this can now be setup in [The SimObject Editor](../../../devmode/editors/simobject-editor/the-simobject-editor/) since the aircraft is finally in the simulation. {{< image-center src="images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_5_testing.png" alt="Testing The Aircraft In The Simulation" >}}     ### Initial Debugging At this point in the process, you should take some time to debug the *model* using the available tools, paying particular attention to the LODs, and the model statistics. For LODs you can find information on how to debug them correctly from the following page: - [Debugging LODs](../../../models-and-textures/modeling/lods/debugging-lods/)   For the model in general, you should be using [The SimObject Statistics Profiler](../../../devmode/menus/tools_info/simobject-statistics/) window to ensure that it is within the recommended limits given in the section on [Aircraft Modeling General Principles](../../../models-and-textures/modeling/aircraft/aircraft-modeling-general-principles/). Note that you'll not be able to debug anything other than the models themselves at this point, but it's important that you get them correct and optimised before continuing to edit anything else with the aircraft.     ### Troubleshooting If the aircraft does not show up in the simulation, then you need to go through a few steps to find out what's gone wrong and fix it. The first thing to do is enable the [The Console](../../../devmode/menus/debug_info/the-console/) and set it to **Builder** only, clearing the output: {{< image-center src="images/7_Samples_Tutorials/Tutorials/Creating_An_Aircraft/Package_Building/build_6_console.png" alt="Setting Up The Console" >}}   After clearing the output you would then go back and build the package again, and this time you can analyse the console output to see if there are any obvious errors listed. The most common issues you'll face at this point are usually related to misnamed paths for the glTF or texture files, so make sure that the [names given in the CFG and XML files](../../../content-configuration/models/simobject-model-files-setup/) match the actual file names. You might also have to check the way that you have exported the glTF files and textures, and revise the instructions given for [Model Exporting](../../../models-and-textures/modeling/aircraft/model-exporting/).   The other main thing to check is that the paths within the project have been set up correctly. This should only be a problem is you have **not** used the aircraft template, in which case you should check that the SImObject path is correct. As an example, this will *not* permit the simulation to recognise the aircraft: ``` codeblock ROOT\\PackageSources\SimObjects\SimObject\\ ```   This is because the Project Editor can't know what *type* of SimObject you are defining, and as such we will need to change the `SimObjectType` folder to be instead be called `Airplanes`. So it should be: ``` codeblock ROOT\\PackageSources\SimObjects\Airplanes\\ ```   This is an important issue to be aware of, since when this error exists, it will **not** be reported in the Console and the package will *appear* to build without issues. If you are in doubt about the naming and paths, you can either create a new test project and use one of the templates supplied with the [package creation wizard](../../../devmode/editors/project-editor/the-project-editor/#AddingPackage), or check the [DA62](../../samples/simobjects-aircraft/da62/) sample project.