FSXA Seperate Attitude Indicators with different functions

#1
one (hopefully last) issue on my Soloy project is driving me crazy.

I animated two Attitude Indicators (main is vacuum, backup is elec) and Turn Indicator with (A:ATTITUDE INDICATOR BANK DEGREES, degree). Only backup is caged with a flag.

What is working? All animations and the cage flag of backup.

Issues: if cage knop of backup is pushed - both Attitude Indicators (and Turn Indicator) are caged. Only Backup should be caged. Turn Indicator should have no parking modus...

There must be a way to seperate both attitude indicators (and turn indicator).

Main Attitude:

Code:
<Animation name="sphere_bank" guid="39970976-AF0A-47BE-BCB0-42471AECD7ED" type="Sim" typeParam2="sphere_bank" length="360" typeParam="AutoPlay" />
<PartInfo>
   <Name>sphere_bank</Name>
    <AnimLength>360</AnimLength>
      <Animation>
        <Parameter>
        <Code>(A:ATTITUDE INDICATOR BANK DEGREES, degree) dnor</Code>
        </Parameter>
     </Animation>
</PartInfo>

<Animation name="sphere_pitch" guid="F4D73A1B-C8E3-47E7-8164-2CC9C5579A29" type="Sim" typeParam2="sphere_pitch" length="120" typeParam="AutoPlay" />
<PartInfo>
  <Name>sphere_pitch</Name>
   <AnimLength>120</AnimLength>
     <Animation>
     <Parameter>
        <Code>(A:ATTITUDE INDICATOR PITCH DEGREES, degree) 60 + </Code>
     </Parameter>
    </Animation>
</PartInfo>

Backup Attitude:

Code:
<Animation name="sphere_back_bank" guid="f4d7f2e9-3fd4-46ee-be1e-a127be485d4f" type="Sim" typeParam2="sphere_back_bank" length="360" typeParam="AutoPlay" />
<PartInfo>
<Name>sphere_back_bank</Name>
<AnimLength>360</AnimLength>
  <Animation>
    <Parameter>
       <Code>(A:ATTITUDE CAGE,bool) 1 &lt; if{ (A:ATTITUDE INDICATOR BANK DEGREES:1, degree) dnor }  els{ 0 }</Code>
     </Parameter>
  </Animation>
</PartInfo>

<Animation name="sphere_back_pitch" guid="11a597a5-1e99-4b1e-a422-5df345704f8e" type="Sim" typeParam2="sphere_back_pitch" length="120" typeParam="AutoPlay" />
<PartInfo>
<Name>sphere_back_pitch</Name>
<AnimLength>120</AnimLength>
  <Animation>
    <Parameter>
      <Code>(A:ATTITUDE INDICATOR PITCH DEGREES:1, degree) 60 + </Code>
     </Parameter>
  </Animation>
</PartInfo>
And the Cage Switch + Cage flag:

Code:
<Animation name="knob_cage_attitude" guid="00843e95-4b80-4702-b100-14d1602694bc" type="Sim" typeParam2="knob_cage_attitude" length="20" typeParam="AutoPlay" />
<PartInfo>
<Name>knob_cage_attitude</Name>
<AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
      <Code>(L:cage, bool) 0 == (A:ATTITUDE CAGE, bool) 0 == and if{ (>K:ATTITUDE_CAGE_BUTTON) 1 (>L:cage,bool) } (A:ATTITUDE CAGE,bool) 20 * </Code>
      </Parameter>
      <Lag>200</Lag>
  </Animation>
<MouseRect>
<TooltipID>TOOLTIPTEXT_ATTITUDE_GYRO_CAGE</TooltipID>
<Cursor>Hand</Cursor>
<CallbackCode>(K:ATTITUDE_CAGE_BUTTON) ! (&gt;K:ATTITUDE_CAGE_BUTTON) 1 (&gt;L:Horflag,enum)</CallbackCode>
</MouseRect>
</PartInfo>

<Animation name="hor_flag_back" guid="e8a4b555-76cc-4970-9d69-e6cfd9dbb6c8" type="Sim" typeParam2="hor_flag_back" length="20" typeParam="AutoPlay" />
<PartInfo>
<Name>hor_flag_back</Name>
<AnimLength>20</AnimLength>
  <Animation>
    <Parameter>
       <Code>(L:Horflag,enum) 20 * </Code>
    </Parameter>
   </Animation>
</PartInfo>
And the Turn Indicator

Code:
<Animation name="turn_indicator" guid="1d713398-66df-4c9c-8d88-ea7fd0ffc306" type="Sim" typeParam2="turn_indicator" length="90" typeParam="AutoPlay" />
<PartInfo>
<Name>turn_indicator</Name>
<AnimLength>90</AnimLength>
  <Animation>
    <Parameter>
      <Sim>
        <Variable>ATTITUDE INDICATOR BANK DEGREES</Variable>
        <Units>degrees</Units>
        <Bias>45</Bias>
        <MinValue>0</MinValue>
        <MaxValue>90</MaxValue>
    </Sim>
   </Parameter>
</Animation>
</PartInfo>
My aircraft.cfg are

[attitude_indicators]
;/Type: 0=None, 1=Vacuum Gyro, 2=Electric Gyro
attitude_indicator.0 = 1
attitude_indicator.1 = 2

[turn_indicators]
turn_indicator.0 = 1

I have tried to work with indeces, but without success. Please give me a small light
...

Thomas
 
Last edited:
#2
some of the needed aircraft.cfg entries

[attitude_indicators]
attitude_indicator.0=1
attitude_indicator.1=1

[turn_indicators]
turn_indicator.0=1,1
turn_indicator.1=1,1

[altimeters]
altimeter.0=1
altimeter.1=1

[direction_indicators]
direction_indicator.0=2,0
direction_indicator.1=2,0

in your example code
Code:
for example
(A:ATTITUDE INDICATOR BANK DEGREES:1, degree) dnor
and
(A:ATTITUDE INDICATOR BANK DEGREES, degree) dnor
is the same thing you need


(A:ATTITUDE INDICATOR BANK DEGREES:1, degree) dnor
and
(A:ATTITUDE INDICATOR BANK DEGREES:2, degree) dnor
and for cadging you use something like this
Code:
  <PartInfo>
    <Name>knob_cage_altitude</Name>
    <AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>ATTITUDE CAGE:1</Variable>
          <Units>bool</Units>
          <Scale>20</Scale>
        </Sim>
        <Lag>100</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ATTITUDE_GYRO_CAGE</TooltipID>
      <Cursor>Hand</Cursor>
      <CallbackCode>
        1 (&gt;K:ATTITUDE_CAGE_BUTTON)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
ATTITUDE CAGE:1 or 2 will select which one gets caged
 
#3
I wouldn't use the built in cage command at all.. But Au-Mav's code may work for caging, I never tried it.

Cage switch & button -

Code:
<Animation name="knob_cage_attitude" guid="00843e95-4b80-4702-b100-14d1602694bc" type="Sim" typeParam2="knob_cage_attitude" length="20" typeParam="AutoPlay" />
<PartInfo>
<Name>knob_cage_attitude</Name>
<AnimLength>20</AnimLength>
<Animation>
<Parameter>
<Code>(L:Caged, bool) 20 *</Code>
</Parameter>
<Lag>200</Lag>
</Animation>
<MouseRect>
<TooltipID>TOOLTIPTEXT_ATTITUDE_GYRO_CAGE</TooltipID>
<Cursor>Hand</Cursor>
<CallbackCode>(L:Caged, bool) ! (>L:Caged, bool)</CallbackCode>
</MouseRect>
</PartInfo>

<Animation name="hor_flag_back" guid="e8a4b555-76cc-4970-9d69-e6cfd9dbb6c8" type="Sim" typeParam2="hor_flag_back" length="20" typeParam="AutoPlay" />
<PartInfo>
<Name>hor_flag_back</Name>
<AnimLength>20</AnimLength>
<Animation>
<Parameter>
<Code>(L:Caged, bool) 20 * </Code>
</Parameter>
</Animation>
</PartInfo>
Backup Gyro -

Code:
<Animation name="sphere_back_bank" guid="f4d7f2e9-3fd4-46ee-be1e-a127be485d4f" type="Sim" typeParam2="sphere_back_bank" length="360" typeParam="AutoPlay" />
<PartInfo>
<Name>sphere_back_bank</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>(L:Caged, bool) ! if{ (A:ATTITUDE INDICATOR BANK DEGREES:1, degree) dnor (>L:BU_ATT_BANK) } (L:BU_ATT_BANK)</Code>
</Parameter>
</Animation>
</PartInfo>

<Animation name="sphere_back_pitch" guid="11a597a5-1e99-4b1e-a422-5df345704f8e" type="Sim" typeParam2="sphere_back_pitch" length="120" typeParam="AutoPlay" />
<PartInfo>
<Name>sphere_back_pitch</Name>
<AnimLength>120</AnimLength>
<Animation>
<Parameter>
<Code>(L:Caged, bool) ! if{ (A:ATTITUDE INDICATOR PITCH DEGREES:1, degree) 60 + (>L:BU_ATT_PITCH) } (L:BU_ATT_PITCH) </Code>
</Parameter>
</Animation>
</PartInfo>
 
#4
The cage code works as it should (its default code ) why reinvent the wheel :)
the aircraft.cfg entries denotes what system each gauge uses....
just for clarification here is the code for teh 2nd cage knob ;)
Code:
  <PartInfo>
    <Name>rear_cage_altitude</Name>
    <AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>ATTITUDE CAGE:2</Variable>
          <Units>bool</Units>
          <Scale>20</Scale>
        </Sim>
        <Lag>100</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ATTITUDE_GYRO_CAGE</TooltipID>
      <Cursor>Hand</Cursor>
      <CallbackCode>
        2 (&gt;K:ATTITUDE_CAGE_BUTTON)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
#5
Because never tried it (caging), used all the other aircraft.cfg items before though. He did mention he tried indexing and it didn't work so I went "outside the box". You posted about the same time I did so just continued.
 
#6
Roman and Au-MaV - a big thank you for sharing the codes. I got both attitude indicators to work as they should. Great help.

Only turn_indicator plane should stay in all off config in a real horizontal manner. Not like this:



Thomas

.
 
#7
Hi
Not sure what your asking :) but if you want the bank 3d model to park horizontal..you will need to change the
els{ 0 } (assuming thats what your using ;) ) to reflect what the keyframe number is when horizontal
so say the center kf is 30 you would use els{ 30 }
 
#9
At least it was really easy. I found on FFDS an old threat (2007) of Chuck Jodry. Before I seached in SDK only for Turn Coordinator or Turn Indicator. Of course with no success.

Anyway. I changed only the variable ATTITUDE INDICATOR BANK DEGREES to PLANE BANK DEGREES. Thats all.

I asked for a small light - but got a powerful and bright light. Thank you here

Thomas
 
Last edited:
Top