P3D v4 Help Needed with Drum Type Fuel Detotalizer Please.

I have a 3D fuel detotalizer gauge in my Boulton Paul P.111A project with four drums from thousands to units and while the drum turns in Blender, I don't see any movement in sim.

I have tried using the standard animation tag drum_fuelq_total_thousands but still see no movement.

My P.111A project has two fuel tanks of 55 Gallons each.

Could it be that the sim is not reading both tanks?

XML:
<Animation name="P111drum_fuelq_total_hundreds"             guid="43013e58-797d-4b5d-2683-1735d7201316"     length="360" type="Sim" typeParam2="P111drum_fuelq_total_hundreds" typeParam="AutoPlay" />
   <PartInfo>
    <Name>P111drum_fuelq_total_hundreds</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:drum_fuelq_total_hundreds, number)
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
 
Last edited:
How and where do you define and set your L variable? It won't work by just giving it a name and unit. And is there really a "standard animation" labeled "drum_fuelq..." in the default 4.5 modeldef?
 
Last edited:

n4gix

Resource contributor
All "default variables" begin with A:
L: variables are custom and must somewhere defined with a formula of some sort.
 

tgibson

Resource contributor
To elaborate - if you do not set the value of an L: variable in some way, FS sets the value to 0 and leaves it that way.
 
I have only worked with the default variable gauges with A so for and the L: variables are new to me.

I did see the code below in the forum, which was origionaly for pounds and not gallons, but could not get this to work either.

I attempted to provide the L:variable in the gauge code further below.

XML:
   <Animation name="MU2B_FUEL_BURN100"                      guid="e54e5fa2-2f55-489c-a2b8-873676cc6a21" type="Sim" typeParam="AutoPlay"  length="100" typeParam2="MU2B_FUEL_BURN100" />
  <PartInfo>
    <Name>MU2B_FUEL_BURN1000</Name>
    <AnimLength>10</AnimLength>
    <Animation>
        <Parameter>
            <Code>
            (L:FUEL_USED,GALLONS) 10000 % 1000 / flr
            </Code>
        </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>MU2B_FUEL_BURN100</Name>
    <AnimLength>10</AnimLength>
    <Animation>
        <Parameter>
            <Code>
            (L:FUEL_USED,GALLONS) 1000 % 100 / flr
            </Code>
        </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>MU2B_FUEL_BURN10</Name>
    <AnimLength>10</AnimLength>
    <Animation>
        <Parameter>
            <Code>
            (L:FUEL_USED,GALLONS) 100 % 10 / flr
            </Code>
        </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>MU2B_FUEL_BURN1</Name>
    <AnimLength>10</AnimLength>
    <Animation>
        <Parameter>
            <Code>
            (L:FUEL_USED,GALLONS) 10 % near
            </Code>
        </Parameter>
    </Animation>
  </PartInfo>
I made an XML document with the code below and added it to my panel folder and also added the line to the Panel config VCockpit

XML:
<Gauge Name="FuelTotaliser" Version="1.0">


    <!-- ================= FUEL USED ====================== -->
<Element>
   <Select>
     <Value>
<!-- RESET-->
    (L:FUEL_LOCK,bool) 0 == if{ 0 (>L:FUEL_CALC,bool) }


<!-- FUEL ON BOARD-->
    (L:FUEL_CALC,bool) 1 ==
    if{ (A:FUEL TOTAL QUANTITY WEIGHT,GALLONS) (>L:FuelOnBoard,GALLONS) }

<!-- CURRENT FUEL ON BOARD-->
    (L:FUEL_CALC,bool) 0 ==
    if{ (L:FuelOnBoard,GALLONS) (>L:TotalFuelOnBoard,GALLONS) }

<!-- CALCULATE FUEL USED-->
    (L:SHOW_FUEL,bool) 0 ==
    if{ 0 (>L:FUEL_USED,GALLONS) }
    (L:SHOW_FUEL,bool) 1 ==
    if{ (L:TotalFuelOnBoard,GALLONS) (A:FUEL TOTAL QUANTITY WEIGHT,GALLONS) - (>L:FUEL_USED,GALLONS) }
     </Value>
   </Select>
</Element>

</Gauge>
 
Your (A:FUEL TOTAL QUANTITY WEIGHT,GALLONS) variable is wrong, you are using the wrong units which should be either pounds or kilos, it should be (A:FUEL TOTAL QUANTITY, Gallon or Litre) if you are measuring the volume as opposed to the weight.
 
This is a bit of a wildgoose chase. I think I see three potential faults in your approach: 1) wrong unit in the A:var, as pointed out by PaulJC, above, 2) in your panel xml gauge as qtd above your variables L:FUEL_CALC and FUEL_SHOW never reach the value 1, and therefore the whole code never gets to do anything, and 3) (most importantly), the various drum_fuelq animations from the SDK's modeldef cannot be used as is because they are "created by Virtuali for FA-18" (run a search in the modeldef to see that line), so in all likelihod are controlled by a gauge in that airplane's panel. Edit: same goes for the code for the MU2 plane, also qtd by you. I don't have either of those planes, so can't say how they set their Lvars. If you do have them, search the code for setting the Lvars, and take it from there. If they do it via a button or switch, things become still more complicated (a case for MCX). There must be easier ways to achieve what looks like rather a trivial task, though.
 
Last edited:

Heretic

Resource contributor
I have only worked with the default variable gauges with A so for and the L: variables are new to me.

I did see the code below in the forum, which was origionaly for pounds and not gallons, but could not get this to work either.

I attempted to provide the L:variable in the gauge code further below.

XML:
...
The ESP/FSX SDK documentation has this simvar, which might be the easiest solution:

Code:
(A:GENERAL ENG FUEL USED SINCE START, pounds)
Its format in the simvar list is a bit weird though as it should feature an engine index, i.e. "(A:GENERAL ENG FUEL USED SINCE START:1, pounds)".

Worth a try though.
 

DragonflightDesign

Resource contributor
Its format in the simvar list is a bit weird though as it should feature an engine index, i.e. "(A:GENERAL ENG FUEL USED SINCE START:1, pounds)".
There's a few documentation errors like that. Actually, there's a lot of documentation errors like that, mostly inherited from the FSX SDK. I've had an on-going PM with Fr. Bill to get as many corrected as I can find. If this turns out to be another one (it will! :)), I'll put that on the report list too.
 

Heretic

Resource contributor
There's a few documentation errors like that. Actually, there's a lot of documentation errors like that, mostly inherited from the FSX SDK. I've had an on-going PM with Fr. Bill to get as many corrected as I can find. If this turns out to be another one (it will! :)), I'll put that on the report list too.
I hope the bleed air simvar is also on there.
 

DragonflightDesign

Resource contributor
I hope the bleed air simvar is also on there.
Which'uns that? I've been concentrating on big radials so I haven't tripped over that one. Found two:

TURB ENG BLEED AIR:index
BLEED AIR SOURCE CONTROL:enum

Shouldn't take long to hook up a jet and take a reading.
 
I have used (A:FUEL TANK LEFT MAIN QUANTITY, Gallons) for three drums and then used different degrees of rotation for the keyframes for each drum for units, tens and hundreds. It does count down from my total of 230 gallons to zero, but the fuel quantity gauges do not start to move until the fuel quantity gets below 70%.

Anyone got any ideas of how I can force movement to begin at 99%?
 
Here is the code for the drum wheels:

XML:
 <Animation name="needle_fuel_P111A100"             guid="43013e58-797d-4b5d-2683-1735d7201316"     length="100" type="Sim" typeParam2="needle_fuel_P111A100" typeParam="AutoPlay" />
   <PartInfo>
    <Name>needle_fuel_P111A100</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:FUEL TANK LEFT MAIN QUANTITY, Gallons) </Code>
      </Parameter>
    </Animation>
  </PartInfo>
The left and right dial type fuel quantity gauges are using the standard SDK modeldef code:

XML:
<PartInfo>
    <Name>needle_fuel_l</Name>
    <AnimLength>92</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:FUEL TANK LEFT MAIN QUANTITY, Gallons)</Code>
      </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>needle_fuel_r</Name>
    <AnimLength>92</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:FUEL TANK RIGHT MAIN QUANTITY, Gallons)</Code>
      </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>visible_arch</Name>
    <Visibility>
      <Parameter>
        <Code>

 
Make your own code, reassign the needles and reanimate using 115 keyframes. Keyframe stops at 0, 10, 50, 100 & 115.
The keyframes at: 0 thru 10 & 100 thru 115 are non-linear compared to the rest of the gauge markings.
Make one similar for the right tank.

XML:
 <Animation name="needle_fuel_P111A100"             guid="43013e58-797d-4b5d-2683-1735d7201316"     length="115" type="Sim" typeParam2="needle_fuel_P111A100" typeParam="AutoPlay" />
   <PartInfo>
    <Name>needle_fuel_P111A100</Name>
    <AnimLength>115</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:FUEL TANK LEFT MAIN QUANTITY, Gallons)</Code>
      </Parameter>
    </Animation>
  </PartInfo>
 
Top