# Custom Templates The [default templates](default-templates/) can generally cover a high number of the most common interactions and instruments required inside of an aircraft, but they only cover instruments that are used in the official Microsoft Flight Simulator 2024 aircraft. This means that you may run into instruments that do not have a template that can be used "as is", and so will need a custom template. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} While custom templates can be defined directly inside of the model XML, it is generally advised to define them in one or more **separate** files, which are then included in your model XML. This helps your workflow by separating the implementation of the template from the data given to it. THis is generally easier to follow and implement as it allows you to switch between the files rather than having to navigate a single massive XML file. {{< /callout >}}     ### Create The File The creation of a custom template XML library file requires you to to have a root [``](../../../model-xml-properties/#CompileBehaviors) tag, and inside this there will usually be one or more [``](../../general-template-xml-properties/#Include) tags (which can be used to include the files defining the other templates that will be used). This means that the file contents will initially look something like this: ``` xml ```     ### Input Events Most complicated templates will include - and/or require - interactions. These are now best handled using **Input Events**, which are fully supported using the templates system. Generally, using one or more of the Base Templates is the preferred method for dealing with input, as it is often easier since they handle the complexity of creating an Input Event from scratch. However, it may be necessary to create your own at some point, so here we provide more details on what the base templates do, and also provide some context should you come across some code that is not using the Base Templates. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} There is already extensive information about Input Events in the documentation and we strongly recommend that you look it over before continuing - [Input Events](../../input-event-xml-properties/) {{< /callout >}}   The following three examples will all generate the same interaction and animation, so it is advised to use the **Base Template** method, as it is easier to implement and ensures that you have an Input Event properly set up.     #### Interaction Template Created From Scratch The first method for creating your own interactions is to start from zero and create the template completely by hand. This gives you full control over the behavior of your template, but will generally take longer to do than when using the other solutions listed here.   Below is an example of a custom template, created from scratch, that shows a generic input: ``` xml ``` Note that if you need to do something very specific with your Input Event, it is possible to implement a 100% custom Input Event rather than relying on the generic Input Event and generic template (used above). However it is generally not necessary or useful.     #### Interaction Template Using A Complex Template You can create your own interaction template with multiple, complex interactions by making use of some of the supplied templates listed here: [Generic Complex Templates](../../templateexplorer/asobo/generic/complex/index-page/). These templates will handle most of the logic that causes the interaction to behave like a Switch/Push button/Knob/etc... depending on which Complex template you use.   This example shows a custom template using the Complex template components: ``` xml ```     #### Interaction Template Using A Base Template Of all possible solutions to dealing with interactions, the best is almost always to use a **Base Template**, such as [`ASOBO_INSTRUMENT_Base_Template`](../../templateexplorer/asobo/common/instrument/#ASOBO_INSTRUMENT_Base_Template). Base template are templates that will automatically create the animation, interaction, input event *and* audio based on the parameters that are provided.   This example shows a custom template made using Base templates: ``` xml ```     ### Creating VFX Templates