• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Attitude indicator issues

euroastar350

Resource contributor
Messages
863
Country
us-delaware
Hi guys,

I'm having issues with my 2 attitude indicators and I'm hoping to solve the problem. My Bell 222 has 2 indicators, one primary and one standby indicator. Problem is, the standby unit is powered up with an overhead switch before it can uncaged....but at the same time, uncaging the standby unit will also affect the primary unit which doesn't have an cage button.

This is the code for the primary unit:
Code:
  <PartInfo>
    <Name>B222_attitude_bank_02</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:ATTITUDE INDICATOR BANK DEGREES, degrees) dnor }
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B222_attitude_pitch_02</Name>
    <AnimLength>52</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:ATTITUDE INDICATOR PITCH DEGREES, degrees) 26 min -26 max 26 + }
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>

This is the code for the standby unit:
Code:
  <PartInfo>
    <Name>B222_attitude_bank_01</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:ATTITUDE CAGE,bool) 1 &lt;
          if{ (A:ATTITUDE INDICATOR BANK DEGREES:2, degrees) dnor }
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B222_attitude_pitch_01</Name>
    <AnimLength>52</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:ATTITUDE CAGE,bool) 1 &lt;
          if{ (A:ATTITUDE INDICATOR PITCH DEGREES:2, degrees) 26 min -26 max 26 + }
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>

And these are the codes for the cage button and power switch:
Code:
<PartInfo>
    <Name>B222_knob_stby_att</Name>
    <AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>ATTITUDE CAGE</Variable>
          <Units>bool</Units>
          <Scale>20</Scale>
        </Sim>
        <Lag>100</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ATTITUDE_GYRO_CAGE</TooltipID>
      <Cursor>Hand</Cursor>
      <CallbackCode>
        (&gt;K:ATTITUDE_CAGE_BUTTON)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

<PartInfo>
    <Name>B222_switch_stbatt</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:B222_switch_stbatt, enum) 50 *
        </Code>
        <Lag>300</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Standby Attitude</TooltipText>
      <CallbackCode>
        1 (&gt;K:ATTITUDE_CAGE_BUTTON) (L:B222_switch_mastbatt, enum) 1 == if{ (L:B222_switch_stbatt, enum) ! (>L:B222_switch_stbatt, enum)
        1 (&gt;L:B222_switch_01, number)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

Any help is greatly appreciated
 
The old Sperry autopilot I did for my P-61 has an artificial horizon in it that needed to be independent like that. Here's what I came up with...

Code:
<PartInfo>
    <Name>Knob_Cage_AP_Attitude</Name>
        <AnimLength>20</AnimLength>
    <Animation>
        <Parameter>
            <Code>
                (L:Cage_AP_Attitude, bool) 20 *
            </Code>
            <Lag>40</Lag>
        </Parameter>
    </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Cage AP Attitude</TooltipText>
            <CallbackCode>
                (L:Cage_AP_Attitude, bool) ! (&gt;L:Cage_AP_Attitude, bool)
            </CallbackCode>
        </MouseRect>
</PartInfo>

<PartInfo>
       <Name>needle_ap_bank</Name>
       <AnimLength>360</AnimLength>
       <Animation>
           <Parameter>
              <Code>(L:Cage_AP_Attitude, bool) 0 &gt; if{ 180 } els{ (A:ATTITUDE INDICATOR BANK DEGREES, degree) 180 + }</Code>
                 <Lag>30</Lag>             
           </Parameter>
       </Animation>
    </PartInfo>

<PartInfo>
       <Name>needle_ap_pitch</Name>
       <AnimLength>60</AnimLength>
       <Animation>
           <Parameter>
              <Code>(L:Cage_AP_Attitude, bool) 0 &gt; if{ 30 } els{ (A:ATTITUDE INDICATOR PITCH DEGREES, degree) 30 + }</Code>
                 <Lag>15</Lag>             
           </Parameter>
       </Animation>
    </PartInfo>

When caged the needles get locked to the keyframe that corresponds to their neutral positions.
 
Ok so I modified my modeldef with the above code and the modeldef fails to load. All guid entries are correct and match the scripts. Here is the modified code:

Code:
<PartInfo>
    <Name>B222_attitude_bank_01</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:B222_knob_stby_att, enum) 0 &gt; if{ 180 } els{ (A:ATTITUDE INDICATOR BANK DEGREES, degree) 180 + }
        </Code>
        <Lag>30</Lag>            
      </Parameter>
    </Animation>
  </PartInfo>

<PartInfo>
    <Name>B222_attitude_pitch_01</Name>
    <AnimLength>52</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:B222_knob_stby_att, enum) 0 &gt; if{ 26 } els{ (A:ATTITUDE INDICATOR PITCH DEGREES, degree) 26 + }
        </Code>
        <Lag>15</Lag>            
      </Parameter>
    </Animation>
  </PartInfo>

<PartInfo>
    <Name>B222_knob_stby_att</Name>
    <AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:B222_knob_stby_att, enum) 20 *
        </Code>
        <Lag>40</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Standby Attitude Cage</TooltipText>
      <CallbackCode>
        (L:B222_switch_stbatt, enum) 1 == if{ (L:B222_knob_stby_att, enum) ! (&gt;L:B222_knob_stby_att, enum)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

I can also send my modeldef via PM for further checking. Thanks for any input
 
That's odd as I took it straight from my working file. Can you show me the GUID part?
 
Here you go Robert

Code:
<Animation name="B222_attitude_bank_01" guid="63cec0f0-5dac-4967-91c5-5aa074aa7ed7" length="360" type="Sim" typeParam2="B222_attitude_bank_01" typeParam="AutoPlay" />
        <Animation name="B222_attitude_pitch_01" guid="9cb1a3b7-bc60-403d-bcb3-05e9723c3a29" length="52" type="Sim" typeParam2="B222_attitude_pitch_01" typeParam="AutoPlay" />
 
Forgot to include that one

Code:
<Animation name="B222_knob_stby_att" guid="44dc49fe-7c28-4640-9d54-d086e331211a" length="20" type="Sim" typeParam2="B222_knob_stby_att" typeParam="AutoPlay" />
 
First thing I note is you changed the units on the variables. Are you using the enumerator unit properly? I'm a bit brain-dead right now after working a midnight-noon shift that I don't normally do :confused:

Try basic troubleshooting. Add just the knob part, see if it loads, then work in the others individually. At least you might narrow it down to a single part.
 
Last edited:
Remove the .........length="20"
from your guid entry.
You do not need this section of the guid entry if your always writing custom code that includes the animation length.
 
I have most of my switches using the enumerator unit and function as should, not sure why this would cause the modeldef not to load. I will look into the issue to see where the problem lies.
 
Most of the default guids have this entry because the code below does not supply animation length. Most developers write without the guid entry and only add the animation length in the main code. So this might not fix your issue but you never know since it is an error to write 2 animation lengths.
 
Ok an update. I have removed the code supplied by Robert and the problem still happens. Funny thing is that before I added Robert's code into my modeldef, it would load just fine. Now even without those codes, it won't load whatsoever. Here is a screenshot of the error I keep getting.
MaxError.jpg
 
George, it might be time to take you up on that offer to look at your modeldef file...
 
You know what. Out of all places, there is one place I completely overlooked and it's one of my visibility scripts. Apparently, I forgot to add the "</Name>" to one of the scripts, causing it not to load:censored: Working 6 days, 10-12 each day does really take a toll on me that sometimes I forget what I am doing when I am modeling:eek:
 
Been there and done that more than once. Most of the other regulars here have that tee shirt as well. :laughing:
It looks like you are back at it. Good job figuring it out!
 
Everything is back to normal, but 2 things.

1.) The primary unit is still affected by the cage knob, even though the cage knob shouldn't affect it at all.

2.) The bank and pitch indicators are rotating upside down instead of their correct positions.

Any ideas on how to get these 2 issues sorted?
 
Always make backups right inside the same folder, i usually name them by the month and year...
Because your going to misplace some text in the future as it happens to everyone...:idea:
 
Robert, everything reapplied, etc. Will keep looking into it

Mark, always do backups just in case
 
Back
Top