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

Fast and little help with a gauge

Messages
201
Hello everybody!
I need a small help with my XML gauge.
I simply would like to create a .bmp sequence with 20 bitmaps, let's say at 30 frames per seconds, and when the next one loads, previous one unloads.
It should not be that hard, i know i need a counter but i got no clue where to start.

Any help is greatly appreciated!!
Thanks!
 
FS9/FSX gauge code runs at 18 updates/second maximum.

You need a timer, an L: var and visibility code for your bitmaps.

I'm too lazy to look up the proper formatting at the moment, but a bitmap cycling systrem would look something like this:

Code:
<Update>
(L:Bitmap Timer, number) ++ 20 % (>L:Bitmap Timer, number)
</Update>

<Element>
<Visibility>(L:Bitmap Timer, number) 0 ==</Visibility>
<Image "Name=yourfirstbitmap.bmp"></Image>
</Element>

<Element>
<Visibility>(L:Bitmap Timer, number) 1 ==</Visibility>
<Image "Name=yoursecondbitmap.bmp"></Image>
</Element>

<Element>
<Visibility>(L:Bitmap Timer, number) 2 ==</Visibility>
<Image "Name=yourthirdbitmap.bmp"></Image>
</Element>

The timer variable will increase by 1 every 1/18th of a second and will reset to 0 at a value of 20 after taking modulo.
The rest is just assigning a bitmap to each value of the timer variable.
 
i've managed to make it works, thanks.
last question, is it possible to assigna variable in the "case value" value, and a variable in the image url?
I mean:

<Case Value=VARIABLE X>
<Image Name=VARIABLE Y ></Image>
</Case>

what would be the correct syntax, if it would be ever possible?
thanks!
 
An alternate way without all the elements. No, not available via the bmp path rather available by case value.

Code:
   <Element>
      <Select>
         <Value>(L:Fuel Sel,enum)</Value>
        <Case Value="0">
            <Image Name="fuel_knob.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="fuel_knobI.bmp"/>
         </Case>
         <Case Value="2">
            <Image Name="fuel_knobII.bmp"/>
         </Case>
         <Case Value="3">
            <Image Name="fuel_knobIII.bmp"/>
         </Case>
         <Case Value="4">
            <Image Name="fuel_knobIV.bmp"/>
         </Case>
         <Case Value="5">
            <Image Name="fuel_knobV.bmp"/>
         </Case>
         <Case Value="6">
            <Image Name="fuel_knobVI.bmp"/>
         </Case>
         <Case Value="7">
            <Image Name="fuel_knobVII.bmp"/>
         </Case>
      </Select>
   </Element>
 
Last edited:
thanks Roman!
indeed that was the code i worte. but if i will have 100+ bitmaps, it will be a nightmare...
i am afraid is the only way.
 
You *might* be able to do this with a macro? If you named your images image1.bmp, image2.bmp and then used a macro with image@1.bmp in it (and started that macro in an incrementing loop) it may send different image names to the gauge. But macros have some limitations and this might be one of them?
 
Hi,

hardly elegant ....

but intriguing, and eye-catching too, I believe: :-)


Code:
 <Element>
   <Position X="120" Y="43"/>
     <Select>
       <Value>(L:YourVar,number)</Value>
        <Case Value="1"><Image Name="YourImage001.bmp"/"></Case>
        <Case Value="2"><Image Name="YourImage002.bmp"/"></Case>
        <Case Value="3"><Image Name="YourImage003.bmp"/"></Case>
        <Case Value="4"><Image Name="YourImage004.bmp"/"></Case>
        <Case Value="5"><Image Name="YourImage005.bmp"/"></Case>
        <Case Value="6"><Image Name="YourImage006.bmp"/"></Case>
        <Case Value="7"><Image Name="YourImage007.bmp"/"></Case>
        <Case Value="8"><Image Name="YourImage008.bmp"/"></Case>
        <Case Value="9"><Image Name="YourImage009.bmp"/"></Case>
        <Case Value="10"><Image Name="YourImage010.bmp"/"></Case>
        <Case Value="11"><Image Name="YourImage011.bmp"/"></Case>
        <Case Value="12"><Image Name="YourImage012.bmp"/"></Case>
        <Case Value="13"><Image Name="YourImage013.bmp"/"></Case>
        <Case Value="14"><Image Name="YourImage014.bmp"/"></Case>
        <Case Value="15"><Image Name="YourImage015.bmp"/"></Case>
        <Case Value="16"><Image Name="YourImage016.bmp"/"></Case>
        <Case Value="17"><Image Name="YourImage017.bmp"/"></Case>
        <Case Value="18"><Image Name="YourImage018.bmp"/"></Case>
        <Case Value="19"><Image Name="YourImage019.bmp"/"></Case>
        <Case Value="20"><Image Name="YourImage020.bmp"/"></Case>
        <Case Value="21"><Image Name="YourImage021.bmp"/"></Case>
        <Case Value="22"><Image Name="YourImage022.bmp"/"></Case>
        <Case Value="23"><Image Name="YourImage023.bmp"/"></Case>
        <Case Value="24"><Image Name="YourImage024.bmp"/"></Case>
        <Case Value="25"><Image Name="YourImage025.bmp"/"></Case>
        <Case Value="26"><Image Name="YourImage026.bmp"/"></Case>
        <Case Value="27"><Image Name="YourImage027.bmp"/"></Case>
        <Case Value="28"><Image Name="YourImage028.bmp"/"></Case>
        <Case Value="29"><Image Name="YourImage029.bmp"/"></Case>
        <Case Value="30"><Image Name="YourImage030.bmp"/"></Case>
        <Case Value="31"><Image Name="YourImage031.bmp"/"></Case>
        <Case Value="32"><Image Name="YourImage032.bmp"/"></Case>
        <Case Value="33"><Image Name="YourImage033.bmp"/"></Case>
        <Case Value="34"><Image Name="YourImage034.bmp"/"></Case>
        <Case Value="35"><Image Name="YourImage035.bmp"/"></Case>
        <Case Value="36"><Image Name="YourImage036.bmp"/"></Case>
        <Case Value="37"><Image Name="YourImage037.bmp"/"></Case>
        <Case Value="38"><Image Name="YourImage038.bmp"/"></Case>
        <Case Value="39"><Image Name="YourImage039.bmp"/"></Case>
        <Case Value="40"><Image Name="YourImage040.bmp"/"></Case>
        <Case Value="41"><Image Name="YourImage041.bmp"/"></Case>
        <Case Value="42"><Image Name="YourImage042.bmp"/"></Case>
        <Case Value="43"><Image Name="YourImage043.bmp"/"></Case>
        <Case Value="44"><Image Name="YourImage044.bmp"/"></Case>
        <Case Value="45"><Image Name="YourImage045.bmp"/"></Case>
        <Case Value="46"><Image Name="YourImage046.bmp"/"></Case>
        <Case Value="47"><Image Name="YourImage047.bmp"/"></Case>
        <Case Value="48"><Image Name="YourImage048.bmp"/"></Case>
        <Case Value="49"><Image Name="YourImage049.bmp"/"></Case>
        <Case Value="50"><Image Name="YourImage050.bmp"/"></Case>
        <Case Value="51"><Image Name="YourImage051.bmp"/"></Case>
        <Case Value="52"><Image Name="YourImage052.bmp"/"></Case>
        <Case Value="53"><Image Name="YourImage053.bmp"/"></Case>
        <Case Value="54"><Image Name="YourImage054.bmp"/"></Case>
        <Case Value="55"><Image Name="YourImage055.bmp"/"></Case>
        <Case Value="56"><Image Name="YourImage056.bmp"/"></Case>
        <Case Value="57"><Image Name="YourImage057.bmp"/"></Case>
        <Case Value="58"><Image Name="YourImage058.bmp"/"></Case>
        <Case Value="59"><Image Name="YourImage059.bmp"/"></Case>
        <Case Value="60"><Image Name="YourImage060.bmp"/"></Case>
        <Case Value="61"><Image Name="YourImage061.bmp"/"></Case>
        <Case Value="62"><Image Name="YourImage062.bmp"/"></Case>
        <Case Value="63"><Image Name="YourImage063.bmp"/"></Case>
        <Case Value="64"><Image Name="YourImage064.bmp"/"></Case>
        <Case Value="65"><Image Name="YourImage065.bmp"/"></Case>
        <Case Value="66"><Image Name="YourImage066.bmp"/"></Case>
        <Case Value="67"><Image Name="YourImage067.bmp"/"></Case>
        <Case Value="68"><Image Name="YourImage068.bmp"/"></Case>
        <Case Value="69"><Image Name="YourImage069.bmp"/"></Case>
        <Case Value="70"><Image Name="YourImage070.bmp"/"></Case>
        <Case Value="71"><Image Name="YourImage071.bmp"/"></Case>
        <Case Value="72"><Image Name="YourImage072.bmp"/"></Case>
        <Case Value="73"><Image Name="YourImage073.bmp"/"></Case>
        <Case Value="74"><Image Name="YourImage074.bmp"/"></Case>
        <Case Value="75"><Image Name="YourImage075.bmp"/"></Case>
        <Case Value="76"><Image Name="YourImage076.bmp"/"></Case>
        <Case Value="77"><Image Name="YourImage077.bmp"/"></Case>
        <Case Value="78"><Image Name="YourImage078.bmp"/"></Case>
        <Case Value="79"><Image Name="YourImage079.bmp"/"></Case>
        <Case Value="80"><Image Name="YourImage080.bmp"/"></Case>
        <Case Value="81"><Image Name="YourImage081.bmp"/"></Case>
        <Case Value="82"><Image Name="YourImage082.bmp"/"></Case>
        <Case Value="83"><Image Name="YourImage083.bmp"/"></Case>
        <Case Value="84"><Image Name="YourImage084.bmp"/"></Case>
        <Case Value="85"><Image Name="YourImage085.bmp"/"></Case>
        <Case Value="86"><Image Name="YourImage086.bmp"/"></Case>
        <Case Value="87"><Image Name="YourImage087.bmp"/"></Case>
        <Case Value="88"><Image Name="YourImage088.bmp"/"></Case>
        <Case Value="89"><Image Name="YourImage089.bmp"/"></Case>
        <Case Value="90"><Image Name="YourImage090.bmp"/"></Case>
        <Case Value="91"><Image Name="YourImage091.bmp"/"></Case>
        <Case Value="92"><Image Name="YourImage092.bmp"/"></Case>
        <Case Value="93"><Image Name="YourImage093.bmp"/"></Case>
        <Case Value="94"><Image Name="YourImage094.bmp"/"></Case>
        <Case Value="95"><Image Name="YourImage095.bmp"/"></Case>
        <Case Value="96"><Image Name="YourImage096.bmp"/"></Case>
        <Case Value="97"><Image Name="YourImage097.bmp"/"></Case>
        <Case Value="98"><Image Name="YourImage098.bmp"/"></Case>
        <Case Value="99"><Image Name="YourImage099.bmp"/"></Case>
        <Case Value="100"><Image Name="YourImage100.bmp"/"></Case>
         </Case>
      </Select>
   </Element>

I wonder what those 100 images could possible be? :-)

Walter
 
You *might* be able to do this with a macro? If you named your images image1.bmp, image2.bmp and then used a macro with image@1.bmp in it (and started that macro in an incrementing loop) it may send different image names to the gauge. But macros have some limitations and this might be one of them?

That is not possible.
However, if the images are all the same size and format, would be possible to combine them all in a single .bmp, and then use a <Shift> command LVar controlled to position the proper one depending on the LVar value.
This method has the advantage of using less system resources (1 bmp instead of 20 or a hundred ), but might not be suitable for complex images.
I've used it a lot in one of my old XML projects.

Tom
 
I'm using <Shift> in a simple weather radar and it works quite well for that scenario.
When creating the bitmap, however, attention should be paid that the start and the end of the image show the same raindrop configuration, to avoid producing an ugly visual break when the loop is starting over.



I wonder what those 100 images could possible be? :)

I suppose it's rain.
 
@ heretic: Correct :)
@ walter: it looks exactly like that XD
@ taguilo: yep, but 100 bmp 1024*512 combined in one is barely illegal :D
 
I still want to know how Heretic knew it was to be rain ;)

Twenty bitmaps cycled at a fairly high frequency in a 2D gauge sounds a lot like the rain system in FS9, which uses 32 bitmaps at a high frequency.
I can't think of any other obvious use for 20+ bitmaps. Fogging doesn't require high frequency, wing condensation is not possible because external models do not support 2D gauges and programming a PFD loading bar with that many bitmaps is way too inefficient.
 
Thanks Heretic.

Wow! And now I know why I won't be designing a rainy day feature for myself!

Walter
 
...wing condensation is not possible because external models do not support 2D gauges.
They don't? Since when? I could have sworn that I've projected 2d gauges on external models in FSX and P3D both. :scratchch
 
They don't? Since when? I could have sworn that I've projected 2d gauges on external models in FSX and P3D both. :scratchch

That would very honestly be news to me.

They can't be interacted though, can they?
 
That would very honestly be news to me.

They can't be interacted though, can they?
They are only interactive in P3Dv2.5 or later, otherwise not at all.

Several years ago I 'projected' a set of hydraulic gauges in an open-able inspection hatch on the exterior of a model as an experiment. We decided though not to bother with it in the release, because at the time the "door" command it required to be open-able would be better used for the starboard baggage doors.
 
Back
Top