# Using Model Behaviors This section explains how to use the **Model Behavior** system and the **Input Events** to connect the nodes and animations that have been created by artists so that the plane reacts correctly to the various user inputs. This is done by building **XML** files that describe the different properties of each instrument. Using this system enables you to create templates that can be used to reduce greatly the amount of duplicated code and build up a library of functions that can be reused as you build more planes.   Before continuing, it is worth noting that using and creating Model Behaviors is a big task and requires a certain amount of work. As such, we strongly suggest that you revise the following pages of the main documentation to get a greater understanding of the information given in this section: - [Reverse Polish Notation](../../../../programming-apis/reverse-polish-notation/) - [Model Behaviors](../model-behaviors/) - [Input Events](../input-event-xml-properties/)   The rest of this page gives some general information about the basics of the model behavior system, after which you should progress and read through the following pages: - [Model Behaviors Component Overview](model-behaviors-component-overview/) - [Model Behaviors Parameters](model-behaviors-parameters/) - [Model Behaviors Inputs](model-behaviors-inputs/)     ### Setup In the section on the [Model CFG and Aircraft XML](../../simobject-model-files-setup/), you should have created some XML files that are meant to contain the **Model Behavior** code. In most cases, you will have created one file for the *interior* of the plane and one for the *exterior*. Their names should correspond to the names that are defined inside of the [`model.cfg`](../../model.cfg/) file next to the parameters `interior` (for the interior) and `exterior` (for the exterior, which can also be `normal`).   While the standard structure would be to have both XML files inside of the model folder along with the `model.cfg` file, it is possible for them to be located elsewhere. This can be useful for variations, where the variation has exactly the same nodes and animations and doesn't require it's own XML file. Basically this lets you use the base aircraft XML file rather than having to write a custom one each time. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} The XML files that you have created can be opened with any text editor, though text editors that are designed for coding such as Notepad++ or Visual Studio are advised. {{< /callout >}}   It is very important to note that there have been a great number of model behavior templates created for the default aircraft available in Microsoft Flight Simulator 2024. These templates can be used for your own aircraft, and we strongly recommend that whenever you want to implement an instrument or behavior, it is advised to search through the templates folder for anything that may be appropriate. This task is made simpler by using the SDK documentation, where all the templates are listed and can be explored: - [Model Behavior Template Explorer](../templateexplorer/template-explorer/)   As an Example, if you go to that page and then search "Anim", you will see highlighted a number of templates that can be of use to you, and these can be used to setup different animations without having to reinvent the wheel: {{< image-center src="images/5_Content_Config/Models/behaviours/behaviour_1_setup.png" alt="Example Image Of The Different Templates Using The Search Function" >}}     ### File Structure The model XML files are standard XML files which should contain a single [``](../../model-xml-properties/#ModelInfo) element at their root. That element will contain a [``](../../model-xml-properties/#LODS) sub-element that is used by the artists to setup when LODs should change, and a [``](../../model-xml-properties/#CompileBehaviors) sub-element which will contain all the model behavior implementation. Note that if you have issues with the compiled XML then you may instead use the [``](../../model-xml-properties/#Behaviors) element here instead (but *not* the [``](../../model-xml-properties/#ModelBehaviors) element, this is specific to additional XML as explained in the [Additional XML Files](using-model-behaviours/#additional-files) section, below).   Once you have setup these initial elements, you can then move on and add in any [``](../general-template-xml-properties/#Include) and [``](../general-template-xml-properties/#Macro) elements that you need, inside of the `` top element. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} If you wish to use the more modern and comprehensive [EX1 Templates](../templateexplorer/asobo-ex1/index-page/) then the <CompileBehaviors> *version* **must be set to 2**. {{< /callout >}}   [``](../general-template-xml-properties/#Include) will be used to include any additional files containing the [`