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

FS2004 fuel dumping

Messages
11
Country
italy
Hi guys,

I'm studing the xml tutorials, by this site, to create a gauge for fuel dumping, but unfortunately it don't work. I don't see nothing in my panel. Can you tell me why?

This is the xml code:
Code:
<Gauge Name="fuel_dumping" Version="1.0">
  <Image Name="fuel_dumping_off.bmp">
  <Mouse>
    <Cursor Type="Hand"/>
    <Click Kind="LeftSingle+RightSingle"> (M:Event)'LeftSingle'
      <elements>
        <Image Name="fuel_dumping_on.bmp">
      </elements>
      (M:Event)'RightSingle'
      <elements>
        <Image Name="fuel_dumping_off.bmp">
      </elements>
    </Click>
  </Mouse>
</Gauge>

And this is the panel.cfg code:
Code:
[Window03]
Background_color=0,0,0
size_mm=1530,1200
window_size_ratio=1.00
position=1
visible=0
ident=OVERHEAD_PANEL
zorder=6[

gauge00=A343CFM_feelThere!Overhead, 0,0,1530,1200
gauge01=fuel_dumping!fuel_dumping,  10,10,49,36/code]

Regards.
Daniele Di Bernardo
 
The only commands that actually do something in FS are K: "Events". All your code does is swap a bitmap from off to on clicking the left and right buttons. And if you would check the Panels SDK, you will find that there is no K: command for fuel dumping, and thus that is not possible using pure XML code.

Doug Dawson has a fuel dumping gauge that can be used to dump fuel in XML gauges; get it at his web site:

http://www.douglassdawson.ca/

You set custom L: variables and his gauge does the rest.

Hope this helps,
 
Hi Tom,

This is my first code to create a xml gauge, and for this reason I would proceed step by step. As first phase i Would create a gauge where i can turn on/off a bitmap. When I understud how i can make it, the second phase will be to add the code to reduce the fuel.

So, in order to turn off/onn, cna you confirm that i must change only the following sections?


<Gauge Name="fuel_dumping" Version="1.0">
<Image Name="fuel_dumping_off.bmp">
<Mouse>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle"> (K:Event)'LeftSingle'
<elements>
<Image Name="fuel_dumping_on.bmp">
</elements>
(K:Event)'RightSingle'
<elements>
<Image Name="fuel_dumping_off.bmp">
</elements>
</Click>
</Mouse>
</Gauge>


Regards.
Daniele
 
Hi,

I am only an amateur at this coding trick but I think you need something like the following to achieve your aim:

Code:
<Gauge Name="fuel_dumping" Version="1.0">
<Element>
    <Select>
        <Value> (L:FuelDumping, bool) </Value>
        <Case Value="0"><Image Name="fuel_dumping_off.bmp"/></Case>
        <Case Value="1"><Image Name="fuel_dumping_on.bmp" /></Case>
    </Select>
</Element>

<Mouse>

<Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle">
        (M:Event) 'LeftSingle' scmp 0 ==
            if{ "Turn on Fuel Dump" Command Whatever that is going to be
                1 (&gt;L:FuelDumping, bool) }
          
        (M:Event) 'RightSingle' scmp 0 ==
            if{ "Turn off Fuel Dump" Command Whatever that is going to be
                0 (&gt;L:FuelDumping, bool) }
</Click>

</Mouse>

</Gauge>

The top Element bit does the display of the button or handle depending on a flag; the Mouse bit actually controls the dumping and sets the flag to control the display.

I think...

There may well be errors in the code which is untested, and there are probably a dozen other better ways to achieve your aim.

But anyway, there you go...


Walter
 
Daniele,

it looks like you are attempting to overlay your own Fuel Dump gauge on top of the already-existing FeelThere Overhead gauge.

I am not too sure if that is going to ever work - I have never tried it.

Maybe you should try something like this to see your own gauge showing up (if it does!)

It should be below the Overhead.

Code:
[Window03]
Background_color=0,0,0
size_mm=1530,1240
window_size_ratio=1.00
position=1
visible=0
ident=OVERHEAD_PANEL
zorder=6

gauge00=A343CFM_feelThere!Overhead, 0,0,1530,1200
gauge01=fuel_dumping!fuel_dumping,  0,1202 ,49,36



Walter
 
Hi Walter I tried but nothing i don't see nothing in the overhead panel.

About that:
Daniele,

it looks like you are attempting to overlay your own Fuel Dump gauge on top of the already-existing FeelThere Overhead gauge.

I am not too sure if that is going to ever work - I have never tried it.

For your information I used a gauge to handle the doors using a xml gauge, and it work. So I think that We can add a new xml code over the feelthere overhead.

Code:
[Window03]
Background_color=0,0,0
size_mm=1600,1200
window_size_ratio=1.00 
position=0
visible=0
ident=OVERHEAD_PANEL
zorder=6

gauge00=A320CFM_feelThere!Overhead, 0,0
gauge01=DoorControl!Version2,  1404,960,50,80

Regards.
Daniele
 
The easiest way to fault-find is to start simple and work your way forward, as you have said you are trying.

Therefore I would recommend that you create the simplest of gauges, one which does nothing but exist, and see does it show up for you.

Try:

Code:
<Gauge Name="fuel_dumping" Version="1.0">
<Image Name="fuel_dumping_off.bmp"/>
</Gauge>

This should simply display your Off image where you want the gauge to be.

Then work forward from there.

You may have tried this before...

Walter
 
Nothing don't work. In this case I think that is an error of cab file.

You can download the cab file from this link.

Regards.
Daniele
 
I tried it and of course it didn't show.

It would have been better to try the On image - it shows...

Walter
 
Works fine for me.... see top left.



I took the files out of your cab and just put them in a folder - it makes them easier to edit - should have the exact same effect.

I also took the full gauge text as I showed up above and it works - goes on and off - left mouse click on and right mouse click off.

Walter
 
I tried to put the files into folder "fuel_dumping", but nothing, it's don't work With A340 feelthere. I confirm that with C182 it work.

Daniele
 

Attachments

  • 1.jpg
    1.jpg
    101.9 KB · Views: 480
  • 2.jpg
    2.jpg
    462.3 KB · Views: 517
Daniele,

Just to boost your confidence at gauge-making...

Comment out the overhead gauge in your FeelThere Window03

//gauge00=A343CFM_feelThere!Overhead, 0,0,1530,1200

and leave the fuel dump gauge there.

Prove to yourself that your gauge would have worked anyway!:)

Walter
 
A. You cannot have both a CAB and a folder. Delete one.
B. We never compile to CAB until we are done (most developers that is). Keeping a folder instead of a gauge enables you to quickly access your vairous XML's and bitmaps without having to constantly compile, recompile.
C. Experiment with a basic, running gauge, like Walter is stating, to make sure it shows up.
D. Try to always post code into the Insert / Code section so it shows up stacked. It makes it easier on us older folks to read your code.

Now..... I am posting a code for you to try;
Includes;
* Master Battery XML switch
* Texture 'on'
* Texture 'off'

That 'will' work in the folder if in the right place and correctly in the panel config entry.


This is the code for the switch;


Code:
<Gauge Name="Battery Switch" Version="1.0">
    <Element>
        <Select>
            <Value>(A:Electrical master battery,bool)</Value>
            <Case Value="0">
                <Image Name="Switch_Master_Bat_Off.bmp" />
            </Case>
            <Case Value="1">
                <Image Name="Switch_Master_Bat_On.bmp" />
            </Case>
        </Select>
    </Element>
    <Mouse>
        <Help ID="HELPID_GAUGE_BATTERY_SWITCH" />
        <Cursor Type="Hand" />
        <Click Event="TOGGLE_MASTER_BATTERY" />
    </Mouse>
</Gauge>

To get it 'readable' like this (stacked like that) you use the 'insert' button in the post controls, and find 'code' and click that and 'paste' your code in there and it will show up stacked. Its easier for code readers then to read what you have and diagnose issues.


Next, on that code I have posted above, it will show that the off is '0' and on is '1'. The textures show this.

So, you could create a L:var (custom animation) and show it as (L:my custom animation,bool) 0 == (will show as off) and then (L:my custom animation,bool) 1 == (will show as on). You must have a space between 1 and == and the ) points or it will not work.

Example of two way to enter this;

Code:
<Gauge Name="My Cool Switch" Version="1.0">
    <Element>
        <Select>
            <Value>(L:my custom animation,bool)</Value>
            <Case Value="0">
                <Image Name="Switch_Master_Bat_Off.bmp" />
            </Case>
            <Case Value="1">
                <Image Name="Switch_Master_Bat_On.bmp" />
            </Case>
        </Select>
    </Element>
    <Mouse>
      <Area Left="0" Right="104" Top="0" Bottom="78">
         <TooltipText>My Really Cool Animation</TooltipText>
            <Cursor Type="Hand"/>
        <Click Kind="LeftSingle">
           (L:my custom animation, bool) ! (>L:my custom animation, bool)
                </Click>
         </Area>

    </Mouse>
</Gauge>

The custom animation string (L:my custom animation, bool) ! (>L:my custom animation, bool) will turn on and off, and starts out at zero (off) when you boot into a flight.


Hope that helps. :)
 

Attachments

Last edited:
Also, for coding, you use 'system commands' with a K: (keyboard command). L:vars (custom animations) never use K:, it will not work. Only for 'system' commands. With L:vars, you use > or &gt; in front of the L:xxxxx to 'fire it up'.

Example, if you want to turn something on and off,

Code:
<Click Kind="LeftSingle">
      (L:my custom animation, bool) ! (>L:my custom animation, bool)
</Click>

or

Code:
<Click Kind="LeftSingle">
      1 (&gt;L:my custom animation, bool)
</Click>

The above will only turn on...
 
You can learn so much from stock codes. The Beechcraft twin, decompile the CAB and save that into a 'Gauges folder' on your main hard drive and keep that for notes and templates. Keep text notes on gauge making in there. All in one spot.
 
Hi,

You can have a CAB file and the folder together if you like in FS9. In my experience the files in the folder will be read before the CAB file. But I agree it could be confusing, and thus I avoid it.
 
Back
Top