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

Fuel Graphics using Case; Question

Messages
10,163
Country
us-arizona
Hey guys,

I have a unique issue going on.

I am making a fuel gauge that uses graphics depicting a fuel cell in various 'amounts' of filled, such as half filled, 5/8 filled, etc.

I am using (A:FUEL TANK RIGHT MAIN QUANTITY,percent) but it doesnt work. If I use 'gallon' (which the SDK points to it requiring), then I get it working when it is in 'separated script blocks' (Element/Visible for each one, 27 total for all three tanks). But, the system will not accept decimals. So, there is a conflict when at gallon meet points, where one that shares 5 gallons, to the next that uses range 5 7 (5 to 7 gallons rng) that too will show the lower (bottom of the two in the scripts stack), thus a full tank denotes 7/8 tank.

So, I wanted to organize it into a nice 'case' block script. But, I cannot figure out how to code the function. I tried using percent again, and used min 0 max 8 near, I tried gallons in the case values, each, (I just wanted to see if it would work, didnt.. ), and a few other ways.

Anyone have an idea as to how to get this baby to function? I know, percent will not work with min 0 max 8. It is in the middle of various changes. It was just at gallon with min 0 max 26.

Code:
   <Element>
      <Position X="1164" Y="390"/>
      <Select>
         <Value>(A:FUEL TANK RIGHT MAIN QUANTITY,percent) min 0 max 8</Value>
         <Case Value="0">
               <Image Name="BatteryEmpty.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="1">
               <Image Name="Battery125.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="2">
               <Image Name="Battery250.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="3">
               <Image Name="Battery375.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="4">
               <Image Name="Battery500.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="5">
               <Image Name="Battery625.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="6">
               <Image Name="Battery750.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="7">
               <Image Name="Battery875.bmp" ImageSizes="163,56" />
         </Case>
         <Case Value="8">
               <Image Name="BatteryFull.bmp" ImageSizes="163,56" />
         </Case>
      </Select>
   </Element>
 
Bill,

I think you want fuel level, rather than fuel quantity. That one works with percentages.

Also, clear out some of your old PM's. I can't respond to your latest because your inbox is full...

Doug
 
Hey Doug,

Old emails deleted.



I do not know if a fuel lever can do this, as I need to depict 'fuel quantity'. What I am showing is a fuel tank and how full it is.


Bill
 
Give this one a try:
(A:FUEL TANK RIGHT MAIN LEVEL, percent)

Doug
 
Works Brilliant!

I dropped that 'case' effort and just went with Elements instead. Alot of writing and code, but it works nicely.
 
Back
Top