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

3D Fuel Flow Needle

Messages
44
Country
us-newyork
I'm trying to develop a 3D fuel flow needle for our project using the code below. The gauge reads from 0 - 60 gph with 10 gph increments. The part animates but jumps immediately from 0 - 60 when the engine starts at idle. Any ideas on what I might do to reanimate it? many thanks


<PartInfo>
<Name>needle_fuel_flow</Name>
<AnimLength>60</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>RECIP ENG FUEL FLOW:1</Variable>
<Units>gallons per hour</Units>
<Scale>0.1</Scale>
<MinValue>0</MinValue>
<MaxValue>60</MaxValue>
</Sim>
</Parameter>
</Animation>
</PartInfo>
 
Add a <Lag> entry. Smaller lag number = slower movement

Code:
       </Sim>
       <Lag>20</Lag>
   </Parameter>
 
That worked in slowing the movement but reveals a deeper problem. At idle the gauge should read 1 - 2 gph and as the throttle advances so does the fuel flow rate. The way it is currently the needle moves all the way to 60 at idle albeit slower and smoother than before.
 
That worked in slowing the movement but reveals a deeper problem. At idle the gauge should read 1 - 2 gph and as the throttle advances so does the fuel flow rate. The way it is currently the needle moves all the way to 60 at idle albeit slower and smoother than before.

Why not use this: <Scale>0.1</Scale> to calibrate your gauge properly?

Instead of using the variable, put in a fixed number such as 2 and then tweak the <Scale>x</Scale> so that the needle points to 2's index?

It's also sometimes useful to have a "test gauge" on which you can display the "raw values" of variables just as a way to validate your assumptions:

Code:
  <Element>
    <Position X="113" Y="62"/>
    <FormattedText X="300" Y="35" Font="Glass Gauge" FontSize="10" LineSpacing="0" Adjust="Left" Color="White" Bright="Yes">
      <String>Fuel Flow = %((A:RECIP ENG FUEL FLOW:1,gallons per hour))%!3.2f!%</String>
    </FormattedText>
  </Element>
 
Why not use this: <Scale>0.1</Scale> to calibrate your gauge properly?

Instead of using the variable, put in a fixed number such as 2 and then tweak the <Scale>x</Scale> so that the needle points to 2's index?

It's also sometimes useful to have a "test gauge" on which you can display the "raw values" of variables just as a way to validate your assumptions:

Code:
  <Element>
    <Position X="113" Y="62"/>
    <FormattedText X="300" Y="35" Font="Glass Gauge" FontSize="10" LineSpacing="0" Adjust="Left" Color="White" Bright="Yes">
      <String>Fuel Flow = %((A:RECIP ENG FUEL FLOW:1,gallons per hour))%!3.2f!%</String>
    </FormattedText>
  </Element>

That worked! Having a reference to work on to calibrate the gauge was/is an invaluable tool and have since used that method to "dial in" others in the project. Here is a working fuel flow gauge range 0 - 60 gph and the face used. Thanks Bill!

<Animation name="Needle_Fuel_Flow" guid="09b5740e-0261-45c7-a40f-20cd13aedf18" length="120" type="Sim"

typeParam2="Needle_Fuel_Flow" typeParam="AutoPlay" />

<PartInfo>
<Name>needle_fuel_flow</Name>
<AnimLength>120</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>RECIP ENG FUEL FLOW:1</Variable>
<Units>gallons per hour</Units>
<Scale>0.00265</Scale>
<MinValue>0</MinValue>
<MaxValue>60</MaxValue>
</Sim>
<Lag>20</Lag>
</Parameter>
</Animation>
</PartInfo>

fuel_flow_gauge_zps6c275649.jpg
 
Last edited:
Great! Note that this form of control will only work properly with an absolutely linear scale.

For a non-linear scale, you'd need to keyframe animate each major index value, then use a slightly different <Code> for the animation.

Code:
<Code>
     (A:RECIP ENG FUEL FLOW:1,gallons per hour) 60 min 0 max 0.5 *
</Code>
 
Back
Top