# Important Templates When working with [Model Behaviors](../../model-behaviors/), there are a great number of templates that you can use within the different components and input events associated with an aircraft or a SimObject. However, there are some that are considerably more important and more useful than others, due to them being designed for use in a looser, more generic way than the others which may have very specific uses. On this page you can find a brief outline of what we consider to be the most important and useful of these "generic" templates along with the required parameters for each.     ### Interaction Templates The following templates are incredibly useful when creating cockpit interactions, whether it's for a button or knob or some kind of lever or even the flight controls themselves.   This first set of templates are used primarily for cockpit panel interactions and can be found in the following file: - [..\(Asobo_EX1\)Common\(Shared\)Utils\(Interaction\)Interaction\_Templates.xml](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/)   {{< table-wrapper >}} | Template Name | Description | |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------| | [`ASOBO_CT_Simple_Interaction_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Simple_Interaction_Template) | An interaction without animation | | [`ASOBO_CT_Button_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Button_Template) | A button interaction | | [`ASOBO_CT_Switch_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Switch_Template) | A switch interaction | | [`ASOBO_CT_Lever_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Lever_Template) | A lever interaction | | [`ASOBO_CT_Knob_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Knob_Template) | A switch like interaction with a rotation animation | | [`ASOBO_CT_Knob_Finite_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Knob_Finite_Template) | A knob interaction with a min and max rotation | | [`ASOBO_CT_Knob_Infinite_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Knob_Infinite_Template) | A knob interaction without any bounds for the rotation | | [`ASOBO_CT_Joystick_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Joystick_Template) | A joystick interaction (for instance a two-axis trim controller on a yoke or a joystick that controls an avionics device) | {{< /table-wrapper >}}   This second set of templates are used for cockpit flight control interactions and can be found in the following file: - [..\(Asobo_EX1\)Common\(Interior\)Templates\\Handling.xml](../../templateexplorer/asobo-ex1/common/interior/templates/handling/)   {{< table-wrapper >}} | Template Name | Description | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------| | [`ASOBO_IT_HANDLING_Single_Yoke_Template` \[`ASOBO_IT_HANDLING_Stick_Template`, `ASOBO_IT_HANDLING_Single_Stick_Template`\]](../../TemplateExplorer/Asobo_EX1/Common/Interior/Templates/Handling.html#ASOBO_IT_HANDLING_Single_Yoke_Template) | A yoke or control stick animation | | [`ASOBO_IT_HANDLING_Double_Yoke_Template` \[`ASOBO_IT_HANDLING_Double_Stick_Template`\]](../../TemplateExplorer/Asobo_EX1/Common/Interior/Templates/Handling.html#ASOBO_IT_HANDLING_Double_Yoke_Template) | A yoke or control stick animation for dual cockpit | | [`ASOBO_IT_HANDLING_Single_Rudder_Pedals_Template` \[`ASOBO_IT_HANDLING_Rudder_Pedals_Template`\]](../../TemplateExplorer/Asobo_EX1/Common/Interior/Templates/Handling.html#ASOBO_IT_HANDLING_Single_Rudder_Pedals_Template) | Rudder animation for independent rudder pedals | | [`ASOBO_IT_HANDLING_Double_Helicraft_Rudder_Pedals_Template`](../../templateexplorer/asobo-ex1/common/interior/templates/handling/#ASOBO_IT_HANDLING_Double_Helicraft_Rudder_Pedals_Template) | Rudder animation for helicopters with dual cockpit | {{< /table-wrapper >}}   For more information on these templates, the parameters they have in common, and how they are used, please see the following page: - [Creating Cockpit Interactions](../interactions/creating-cockpit-interactions/)     ### Emissive Materials Templates The tables below outline the templates that are available to control various aspects of the emissive materials that will be used by your instruments and lights (both interior and exterior).   The first group can be found in the following file: - [..\(Asobo_EX1\)Generic\(Shared\)Templates\\Material.xml](../../templateexplorer/asobo-ex1/generic/shared/templates/material/)  
Template NameDescription
ASOBO_GT_Emissive_Template

Base emissive template, creates an emissive material using the following parameters:

  1. EMISSIVE_CODE RPN snippet resulting in a float value which will be used by the material and mutliplied with the emissive texture (if there is one) to drive the emissive.

or

  1. EMISSIVE_SIMVAR ID of the simvar to use to drive the emissive.
  2. EMISSIVE_SIMVAR_UNITS Units to read the simvar in.
  3. EMISSIVE_SIMVAR_SCALE Scale applied to the final simvar value.
  4. EMISSIVE_SIMVAR_BIAS Bias applied to the simvar final value.
ASOBO_GT_Component_Emissive_TemplateCalls the ASOBO_GT_Emissive_Template and creates a component for it with the specified NODE_ID.
  The second group can be found in the following file: - [..\(Asobo_EX1\)Common\(Shared\)Utils\(Emissives\)Emissive\_Templates.xml](../../templateexplorer/asobo-ex1/common/shared/utils/emissives/emissive-templates/)  
Template NameDescription
ASOBO_IT_Power_Dependant_Emissive_Template

Calls the ASOBO_GT_Emissive_Template and creates a component for it with the specified NODE_ID.

Adds a default EMISSIVE_TEST_NO_FAILURE_CODE dependent on either a CIRCUIT_ID or the SimVar CIRCUIT GENERAL PANEL ON, if no circuit was specified.

ASOBO_IT_Screen_Brightness_Template

Calls the ASOBO_IT_Power_Dependant_Emissive_Template and creates an EMISSIVE_CODE based on given minimum and maximum acceptable brightness (MIN_SCREEN_BRIGHTNESS [0.1], MAX_SCREEN_BRIGHTNESS [1.0]).

The emissive factor has to be specified in the parameter EMISSIVE_CODE (as a percent).

The Emissive code can be provided using the <parametersfn> specified in the parameter GET_EMISSIVE, eg:

<GET_EMISSIVE>ASOBO_Pump_Low_Pressure_Emissive_Parameters</GET_EMISSIVE>
ASOBO_IT_Emissive_Brightness_Template

Takes an EMISSIVE_CODE and uses it as a factor to drive the emissive material brightness.

The emissive code can be provided using the <parametersfn> specified in the parameter GET_EMISSIVE.

<GET_EMISSIVE>ASOBO_Pump_Low_Pressure_Emissive_Parameters</GET_EMISSIVE>
ASOBO_IT_Ambient_Update_Template

Takes an AMBIENT_FACTOR and a POTENTIOMETER_ID (the one your ambient light is configured with). If the ambient light is tied to the state of something else you can use TEST_NO_FAILURE to automatically turn off the light when this condition isn't met.

The refresh rate of the AMBIENT_FACTOR is 10 times per second by default. To change that default you can set the parameter UPDATE_PER_SECOND.

The ambient light factor can be provided using the <parametersfn> specified in the parameter GET_AMBIENT.

    ### Visibility Templates The tables below outline the templates that are available to control the visibility of components. It should be noted that when using the visibility templates on a **skinned mesh** the Node ID that you use should be the *root node* of the part.   The following templates can be found in the file: - [..\(Asobo_EX1\)Generic\(Shared\)Templates\\Visibility.xml](../../templateexplorer/asobo-ex1/generic/shared/templates/visibility/)  
Template NameDescription
ASOBO_GT_Visibility_Template

Base visibility template, creates a visibility component using the following parameters:

  1. VISIBILITY_CODE RPN snippet resulting in a float value which will hide [0] or show [!0] the associated component.

or

  1. VISIBILITY_SIMVAR ID of the simvar to use to drive the visibility.
  2. VISIBILITY_SIMVAR_UNITS Units to read the simvar in.
  3. VISIBILITY_SIMVAR_SCALE Scale applied to the final simvar value.
  4. VISIBILITY_SIMVAR_BIAS Bias applied to the simvar final value.
ASOBO_GT_Component_Visibility_TemplateCalls the ASOBO_GT_Visibility_Template and creates a component for it with the specified NODE_ID.
  The following template can also be very useful, and it's found in the following file: - [..\(Asobo_EX1\)Common\(Shared\)Utils\(Visibility\)Visibility\_Templates.xml](../../templateexplorer/asobo-ex1/common/shared/utils/visibility/visibility-templates/)  
Template NameDescription
ASOBO_CT_Swapable_Mesh_Template

Makes two interchangeable visibility components using the provided GET_VISIBILITY_CODE processor outputing an IS_VISIBLE RPN snippet. The default preprocessor is ASOBO_Bool_Visibility_Parameters, eg:

<UseTemplate Name="ASOBO_CT_Swapable_Mesh_Template">
    <IS_VISIBLE>(L:XMLVAR_Pitot_Damage_Visible, Bool)</IS_VISIBLE>
    <MESH_VISIBLE_WHEN_TRUE>MY_DAMAGED_LOOKING_PITOT</MESH_VISIBLE_WHEN_TRUE>
    <MESH_VISIBLE_WHEN_FALSE>MY_NORMAL_LOOKING_PITOT</MESH_VISIBLE_WHEN_FALSE>
</UseTemplate>
    ### Animation Templates The tables below outline some of the most useful templates that are available to control animations.   The following templates can be found in the file: - [..\(Asobo_EX1\)Generic\(Shared\)Templates\\Animation.xml](../../templateexplorer/asobo-ex1/generic/shared/templates/animation/)  
Template NameDescription
ASOBO_GT_Anim_Template

Base visibility template, creates a visibility component using the following parameters:

  1. ANIM_CODE RPN snippet resulting in a float value which will drive the animation. By default an animation goes from 0 to 100. See the Cockpit Animations Overview for more information on what's expected from an animation.

or

  1. ANIM_SIMVAR ID of the simvar to use to drive the animation.
  2. ANIM_SIMVAR_UNITS Units to read the simvar in.
  3. ANIM_SIMVAR_SCALE Scale applied to the final simvar value.
  4. ANIM_SIMVAR_BIAS Bias applied to the simvar final value.
ASOBO_GT_Component_Anim_TemplateCalls the ASOBO_GT_Anim_Template and creates a component for it with the specified NODE_ID.
  The following template can also be very useful, and it's found in the following file: - [..\(Asobo_EX1\)Common\(Shared\)Utils\(Animations\)Animation\_Templates.xml](../../templateexplorer/asobo-ex1/common/shared/utils/animations/animation-templates/)  
Template NameDescription
ASOBO_IT_Gauge_Template

Configures a gauge animation using the following parameters:

  1. GAUGE_VALUE Value driving the gauge needle.
  2. GAUGE_MIN Minimum displayable value.
  3. GAUGE_MAX Maximum displayable value

The gauge value can be provided using the <parametersfn> specified in the parameter GET_GAUGE_VALUE, eg:

<!-- A compass animation -->
<UseTemplate Name="ASOBO_IT_Gauge_Template">
    <ANIM_NAME>OVHD_COMPASS_1</ANIM_NAME>
    <GAUGE_VALUE>(A:MAGNETIC COMPASS, Degrees)</GAUGE_VALUE>
    <GAUGE_MIN>0</GAUGE_MIN>
    <GAUGE_MAX>360</GAUGE_MAX>
    <ANIM_WRAP>True</ANIM_WRAP>
    <ANIM_LAG>100</ANIM_LAG>
</UseTemplate>
<!-- A fuel temperature animation -->
<UseTemplate Name="ASOBO_IT_Gauge_Template">
    <ANIM_NAME>OVHD_FUEL_NEEDLE_FUEL_TEMP_1</ANIM_NAME>
    <GAUGE_VALUE>@Get_Fuel_Temperature_Celsius</GAUGE_VALUE>
    <GAUGE_MIN>-55</GAUGE_MIN>
    <GAUGE_MAX>55</GAUGE_MAX>
    <ANIM_LAG>100</ANIM_LAG>
</UseTemplate>