• 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.

P3D v4 Help needed please with 3D Elevator Trim Indicator Gauge

Messages
180
Country
unitedkingdom
Help needed please with a 3D Elevator Trim indicator gauge.

The gauge has a +/- range of 8 degrees. I have been trying the code below, but have not seen any needle movement in sim yet.

XML:
<Animation name="P111A_ElevatorTrim"                      guid="cd9272df-5fae-4c6c-a857-346a18e7a4d2" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="P111A_ElevatorTrim" />
    <PartInfo>
    <Name>P111A_ElevatorTrim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (A:ELEVATOR TRIM POSITION, degrees) 1 * 8 max -8 min </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ELEVATOR_TRIM_DEGREES</TooltipID>
    </MouseRect>
  </PartInfo>

EOEnk3.jpg


TryqUZ.jpg
 

Heretic

Resource contributor
Messages
6,830
Country
germany
"8 max -8 min" should be "-8 max 8 min". Don't ask me why; this is just the way FSX' XML Parser works.
 
Messages
1,053
Country
australia
Between A and B which is the larger (for max) or smaller (for min) and pass that on. For example: 2 8 max , 8 is the larger so 8 is the result. 2 -8 min, -8 is the smaller so -8 is the result.

Every time I use max min I have to think about it this way because it is very counter-intuitive to how you read it.

Your other problem is even if you correct your code it will be returning values between -8 and 8. The minimum value (keyframe) you can use is 0. You cannot have negative keyframes so you need some sort of offset to get the range of values into the positive. This depends on how you have animated the part and where you have set the keyframes. For something like this I would usually add 100 to the result and then animated between keyframes 92 and 108. Most beginners would probably set -8 degrees to keyframe 0, and 8 degrees to keyframe 16 in which case you should add 8 to offset the results.
 
Messages
180
Country
unitedkingdom
I have the elevator trim gauge working nicely using the code below and it starts at the 12 o'clock position with the needle moving clockwise and anticlockwise as trim is adjusted.

However, I can't seem to get the aileron and rudder trim working. I am using (A:AILERON TRIM POSITION, degrees) and (A:RUDDER TRIM POSITION, degrees)

Should I be using different variables for the aileron and rudder trim?

XML:
 <Animation name="P111A_ElevatorTrim"                      guid="cd9272df-5fae-4c6c-a857-346a18e7a4d2" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="P111A_ElevatorTrim" />
    <PartInfo>
    <Name>P111A_ElevatorTrim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (A:ELEVATOR TRIM POSITION, degrees) 10 * 50 + </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ELEVATOR_TRIM_DEGREES</TooltipID>
    </MouseRect>
  </PartInfo>
 
Messages
440
Country
us-wisconsin
One of those quirky MS things I am imagining.
When the elevator uses "position" one would think it would be the same for both the rudder & ailerons.
Doesn't seems so.
Maybe try :

(A:RUDDER TRIM PCT, percent) -or-
(A:RUDDER TRIM, degrees)

-and-

(A:AILERON TRIM PCT, percent) -or-
(A:AILERON TRIM, degrees)

The SDK can be your friend - http://www.prepar3d.com/SDKv4/sdk/references/variables/simulation_variables.html

Roman
 
Messages
180
Country
unitedkingdom
Thank you Roman.
I used (A:RUDDER TRIM, degrees) and (A:AILERON TRIM, degrees) and made a left and right aileron trim indicator so with a negative bias so that the needles did not just mirror each other.

XML:
  <Animation name="P111A_AileronTrim"                      guid="839a52f5-5de1-47a1-c2b9-7d566cde8fe0" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="P111A_AileronTrim" />
    <PartInfo>
    <Name>P111A_AileronTrim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (A:AILERON TRIM, degrees) 10 * 50 + </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_AILERON_TRIM_DEGREES</TooltipID>
    </MouseRect>
  </PartInfo>
 
  <Animation name="P111A_AileronTrimL"                      guid="c2fc501d-2779-49c1-b5d7-1a43fbacf0ba" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="P111A_AileronTrimL" />
    <PartInfo>
    <Name>P111A_AileronTrimL</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (A:AILERON TRIM, degrees) - 10 * 50 + </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_AILERON_TRIM_DEGREES</TooltipID>
    </MouseRect>
  </PartInfo>
 
   <Animation name="P111A_RudderTrim"                      guid="16e7e7fa-f9a9-470f-ba04-b3d3a39552d5" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="P111A_RudderTrim" />
    <PartInfo>
    <Name>P111A_RudderTrim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (A:RUDDER TRIM, degrees) 10 * 50 + </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_RUDDER_TRIM_DEGREES</TooltipID>
    </MouseRect>
  </PartInfo>

xoaY7e.jpg
 
Top