IMPORTANT TEMPLATES

When working with 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:

 

Template Name Description
ASOBO_CT_Simple_Interaction_Template An interaction without animation
ASOBO_CT_Button_Template A button interaction
ASOBO_CT_Switch_Template A switch interaction
ASOBO_CT_Lever_Template A lever interaction
ASOBO_CT_Knob_Template A switch like interaction with a rotation animation
ASOBO_CT_Knob_Finite_Template A knob interaction with a min and max rotation
ASOBO_CT_Knob_Infinite_Template A knob interaction without any bounds for the rotation
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)

 

This second set of templates are used for cockpit flight control interactions and can be found in the following file:

 

Template Name Description
ASOBO_IT_HANDLING_Single_Yoke_Template [ASOBO_IT_HANDLING_Stick_Template, ASOBO_IT_HANDLING_Single_Stick_Template] A yoke or control stick animation
ASOBO_IT_HANDLING_Double_Yoke_Template [ASOBO_IT_HANDLING_Double_Stick_Template] A yoke or control stick animation for dual cockpit
ASOBO_IT_HANDLING_Single_Rudder_Pedals_Template [ASOBO_IT_HANDLING_Rudder_Pedals_Template] Rudder animation for independent rudder pedals
ASOBO_IT_HANDLING_Double_Helicraft_Rudder_Pedals_Template Rudder animation for helicopters with dual cockpit

 

For more information on these templates, the parameters they have in common, and how they are used, please see the following page:

 

 

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:

 

Template Name Description
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_Template Calls 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:

 

Template Name Description
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.

 

The following templates can be found in the file:

 

Template Name Description
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_Template Calls 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:

 

Template Name Description
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:

 

Template Name Description
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_Template Calls 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:

 

Template Name Description
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>