Don't understand the logic of template

Hi all, I’m trying to do the animation of my altimeter gauge. in a free
aircraft I have found that instrucion : 27.9 31.6 28.2 31.3
INSTRUMENT_Altimeter_Highlight_1 INSTRUMENT_Knob_Altimeter_Visual_1 now I have
to animate in blender in order: 100 ft needle 1000 ft needle 10000 tf needle
rotary knob barometric rotating scale but how I have to match these animations
with few instructions lines of this template. I don’t understand wich names I
have to use in blender for each animation, I don’t understand if I have to use
other anim xml instruction as following :
guid=“a3e143eb-86e0-455b-a6fc-b8364e1598a1” length=“100” type=“Sim”
typeParam2=“needle_vsi” typeParam=“AutoPlay” /> needle_vsi 100 (A:Vertical speed, m/s) 3 * 50 + these part of code I used for vertical speed animation.
I need someone could explain me how to clear my mind . Help. Thanks…

Top tip: an altimeter is sufficiently simple that it’s worth making an effort
to use the generic ASOBO_GT_Anim template to move the needles. You can either
learn that, or you can learn how to dive into the Asobo Official packages
source code structure to study the 2000 lines of XML that each of those pre-
defined templates expand into. There is no documentation for what the node or
animation names that Asobo hard-coded into their templates, or what the
parameters in a given template might be called to allow you to tailor the
behaviour of the template. Of course once you get a particular template
“working” you will have a great sense of achievement and move on the the next
thing, but once you get some of the more generic templates “working” you will
find many of the function-specific Asobo templates don’t really add much at
all except to contain a great deal of plane-specific logic related to the
aircraft Asobo has provided. If it’s any help at all, here’s the behaviours
XML for the altimeter in one of my freeware aircraft (AS33 glider). I’m using
“Z:” variables to animate the needles (you won’t need to, use A:INDICATED
ALTITUDE instead) because in my case the 0…100 animation values are actually
provided by html/js code behind the scenes so my gauges have one-click support
to toggle from imperial to metric. For the ANIM_CODE to work using INDICATED
ALTITUDE, e.g. for the 100-frame needle that does a complete sweep every 1000
feet, you’d use

(A:INDICATED ALTITUDE, feet) 1000 % 10 /

i.e. get alt in feet, find the remainder after dividing by 1000, then divide
that by 10 will give you a 0…100 animation value for a needle. So to be
truthful you do need to learn the generic template (easy) but also how to put
simple formulas into the ANIM_CODE sections (basic is quite easy, but RPN can
get more complicated if you want more complex behavior). It’s easy to test
your animation by just putting a number at the end of your ANIM_CODE, such as
66, and checking that forces the needle to move where you’d expect. A more
elite method is to end your ANIM_CODE as below to copy the anim value into an
L: var and use the SDK Windows - Behaviours - LocalVariables to give you real-
time reading of that value (put XXXX as that window “Filter” value):

(A:INDICATED ALTITUDE, feet) 1000 % 10 / d (>L:XXXX)

                (Z:B21_ALTIMETER_NEEDLE_1, number)

                (Z:B21_ALTIMETER_NEEDLE_2, number)

                (Z:B21_ALTIMETER_NEEDLE_3, number)


(A:KOHLSMAN SETTING MB, millibars) 20 % 5 *


                    1 (>K:KOHLSMAN_DEC) 1 (>K:KOHLSMAN_DEC) 1 (>K:KOHLSMAN_DEC)

                    1 (>K:KOHLSMAN_INC) 1 (>K:KOHLSMAN_INC) 1 (>K:KOHLSMAN_INC)

                1 (>K:BAROMETRIC)
BARO %((A:KOHLSMAN SETTING MB:1, Millibars))%!4.0f!

Note the animations need an animation name, not a node, but the INTERACTIONS
(i.e. this Kohlsman knob) needs the node name to register the mouse input.
Component ID’s can be anything unique in your file, Node and Animation id’s
just have to match whatever you put in the model. Possibly the main benefit
from the old “Animation” method is that MSFS generates the GUID’s so you don’t
need to bother with those at all. To be clear, Asobo’s templates are mostly to
mangle your template reference and parameter settings back into the original
FSX Animation / PartInfo / MouseArea XML.

Hi B21, as first , thanks for your reply. I still don’t understand well the
templates. just as example I have done the animation of my altimeter , it’s
works and I have used this template ( as I wrote before ) :







BUT … this template works for me only because I have found this
information from an old document for FSX where are written the names to use
for Blender anim… but for example I have not found any documentations for
these names as you told.

the names are… Instrument_Altimeter_100_1 Instrument_Needle_Altimeter_100_1
Instrument_Altimeter_1000_1 Instrument_Needle_Altimeter_1000_1
Instrument_Altimeter_10000_1 Instrument_Needle_Altimeter_10000_1 that’s works
for me but I’m still in confusion. but how do you have learned about how to
use the template Asobo GT ANIM ? nowI try to understand the code you wrote.

The documentation Asobo is providing is becoming richer every day The Template
Explorer will guide you through template understanding
If you search the Asobo_Instrument_Altimeter_Template, The template reference
to another template: Asobo_Instrument_Altimeter_SubTemplate That is piggy
tailed to this one for the needles:
ASOBO_INSTRUMENT_Needle_Altimeter_SubTemplate In the template, you get the
naming for all the parts within the Anim_name and part_id tags Is that easy?
No. But remember that the goal of Asobo is to provide the tools to create A
LOT of assest, making those templates can simplify the Dev work, you only need
to understand the template themselves INSTRUMENT_Needle_Altimeter_#FEET##SUFFIX_ID# INSTRUMENT_Needle_Altimeter_#FEET##SUFFIX_ID# INSTRUMENT_Needle_Altimeter 0 feet (A:INDICATED ALTITUDE:#BARO_ID#, #UNITS#) 0 >= if{ (A:INDICATED ALTITUDE:#BARO_ID#, #UNITS#) #FEET# 10 / / 100 % } els{ (A:INDICATED ALTITUDE:#BARO_ID#, #UNITS#) #FEET# 10 / / 100 % 100 + }