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

How to Add Fuel using XML Command?

Messages
10,088
Country
us-arizona
Hey all,

ADD_FUEL_QUANTITY Adds fuel to the aircraft, 25% of capacity by default. 0 – 65535 (max fuel) can be passed.

How exactly do you use ADD_FUEL_QUANTITY ? Do you just present the command in a string and it installs fuel into 'ALL' tanks? If you have 2 tanks, does it automatically place it in all of them, adding 25% to the entire system?

Also, by what I see here, it states 0 - 65535 (index) setting so that 'max fuel' can be passed... I take it that means that if I put in (>K:ADD_FUEL_QUANTITY,enum) 6553, that would add 10% to my tanks? If 65535 is 100% fuel quantity, then 6553 would be 10%. (not modulo... mind you... )

Many thanks for clearing this up for me, anyone that might know the secret to this.


old bill of the gray haired people...
 
Messages
917
Country
indonesia
I use SimConnect to manipulated fuel system, build own system, with XMLtool you can do same in XML ( I think)
 
Messages
1,564
Country
thailand
If I remember correctly, in FSX, the minimum amount of fuel added using ADD_FUEL_QUANTITY is 25%. If that is correct, then any value less than 65535 / 4 will result in a 25% quantity addition to every tank.

But, 65535 / 2 will result in 50% addition, and so forth. That's 50% of fuel tank capacity.

The XML syntax is

65535 2 / (>K:ADD_FUEL_QUANTITY)

There are several fuel experts in this forum that I'm sure will add to this and correct me if I'm wrong.

Bob
 

DragonflightDesign

Resource contributor
Messages
1,096
Country
northernireland
Bob's right - that forever annoyed me in FSX. Being ignorant of XML, if it's possible to interface with SimConnect then Kalong's suggestion is by far the best way to go.
 

tgibson

Resource contributor
Messages
11,343
Country
us-california
And while Doug's gauge is called a fuel dump gauge, you can add fuel by using negative numbers. It also has the nice ability to control the flow rate.
 
Messages
10,088
Country
us-arizona
Hey guys,

I am trying to get this system to drop in fuel every 10 minutes. I am doing a test run to see if I can do 10% at 1 minute in a loop while this system is active. So far no joy.

Here is one variant.

Code:
// QUANTUM RECHARGE SYSTEM /////////////////////////////////////////////////////////////////////////////////////////////////

// BEGIN QUANTUM POWER RECHARGE SYSTEM ////////////////////////////////////////////////////////

// STARTUP AND SET TO ZERO
      (A:Avionics Master Switch,bool)
      (A:Electrical Master Battery,bool) and
      (L:QUANTUM SYSTEM LH,bool) 0 == and
            if{ 0 (>L:QUANTUM SYSTEM LH Time,minute) }

// START TIMER
      (A:Avionics Master Switch,bool)
      (A:Electrical Master Battery,bool) and
      (L:QUANTUM SYSTEM LH,bool) 1 == and
    if{ (L:QUANTUM SYSTEM LH Time,minute) ++ (>L:QUANTUM SYSTEM LH Time,minute) }

// STOP TIMER AT CERTAIN POINT
    <Element>
       <Select>
        <Value>
                            (L:QUANTUM SYSTEM LH Time,minute) 1 > if{ 0 (>L:QUANTUM SYSTEM LH Time,minute) }
        </Value>
       </Select>
    </Element>

// Reset Wakeup when timer is turned off
    <Element>
       <Select>
        <Value>
                            (L:QUANTUM SYSTEM LH,bool) 0 ==
        (L:QUANTUM SYSTEM LH Time,minute) 0 ! and
                                  if{ 0 (>L:QUANTUM SYSTEM LH Time,minute) }
        </Value>
       </Select>
    </Element>

// RECHARGE POINT
    <Element>
       <Select>
        <Value>
        (L:QUANTUM SYSTEM LH Time,minute) 1 == and
                                  if{ 6553 (>A:ADD_FUEL_QUANTITY) }
        </Value>
       </Select>
    </Element>

// END QUANTUM POWER RECHARGE SYSTEM


I have tried
6553 (>A:ADD_FUEL_QUANTITY)
6553 (>A:ADD_FUEL_QUANTITY,percent)
(>A:ADD_FUEL_QUANTITY)
1 (>A:ADD_FUEL_QUANTITY,gallon)

6553 is 10% of 65535 (full amount of fuel, which you can transfer to the tanks).

Also, shouldnt you have a target tank to go to or does this go to the entire system? I am guessing its the entire fuel system (all tanks) as it doesnt say anything in the gauge code Docs on this otherwise except or adding the fuel.

It could also be my horrible looking timer code that is causing this to not work... :(

Any clues as to how to get this baby working? Should I be using something other then minute? I want this to fire off every 10 minutes, dropping 10% of fuel in each time per quantum generator, (2 generators, basically APU's).

Bill
 
Messages
10,088
Country
us-arizona
Also, this is supposed to loop when (L: QUANTUM SYSTEM LH,bool) 1 == is active.. Does this appear to do that? I am hoping it just loops. It does for my random popup cards system.

When I get this working at each 1 minute interval, I'll change all settings of 1 > to 10 minutes ( 10 > )
 
Messages
10,088
Country
us-arizona
You know... I was also thinking... What if I also put the timer code starter into the on/off button in the Mouse section? Wouldnt that really simplify things?
 
Messages
1,564
Country
thailand
I have tried
6553 (>A:ADD_FUEL_QUANTITY)
6553 (>A:ADD_FUEL_QUANTITY,percent)
(>A:ADD_FUEL_QUANTITY)
1 (>A:ADD_FUEL_QUANTITY,gallon)

6553 is 10% of 65535 (full amount of fuel, which you can transfer to the tanks).

Bill, Bill, Bill ...

Have you forgotten that you use >K: for Events and that you can't write to A:Vars?? You should also re-read #3 above. Why are you trying to use ADD_FUEL_QUANTITY with a value less than 25% ?

C'mon, Bill. Knock it off for the night and start fresh tomorrow.

Bob
 
Messages
10,088
Country
us-arizona
I was able to get some other code working last night. Grateful for that.

Thanks Bob for the heads up. Cant believe I did that. Its been a very rough week. Just getting some work done has been a real miracle.

Now to get this baby working. I tried some other things which didnt work, but getting the K: correction helped tons.

Bob, you state above to use a division of the main figure, such as 65535 / 2 (>K:ADD_FUEL_QUANTITY). Have you ever done used that string before? You know it works?

Just for clarification, 6553 (>K:ADD_FUEL_QUANTITY) should (should) work, right? Or should I put in percent, or gallon, or gallons? In the SDK, it states; Adds fuel to the aircraft, 25% of capacity by default. 0 – 65535 (max fuel) can be passed. My thoughts are, this is 'percent'. Or 'index' Such as.... (>K:ADD_FUEL_QUANTITY,percent) or (>K:ADD_FUEL_QUANTITY,index)...

Remember, I am a poly bender... My gauge work is weak... :(
 
Messages
440
Country
us-wisconsin
Make a click spot just for testing. Empty the tanks then click, adjusting the sent value as required for a desired tank fill.
<Click>32363 (>K:ADD_FUEL_QUANTITY)</Click>
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
My thoughts are, this is 'percent'. Or 'index' Such as.... (>K:ADD_FUEL_QUANTITY,percent) or (>K:ADD_FUEL_QUANTITY,index)...
K:Events do not support units.
The range that may be passed to the (>K:ADD_FUEL_QUANTITY) event goes from 0 min to 65535 max

To add 5% to the fuel system send
65535 .05 * (>K:ADD_FUEL_QUANTITY)
or
3276.75 (>K:ADD_FUEL_QUANTITY)
Either way will work, but I think the first is more clear because the second number is the actual percentage desired. Let the computer do the math! :rotfl:
 
Messages
10,088
Country
us-arizona
God bless you guys for your input. Very grateful. Thanks Bill. Thanks Roman. Thats a great way to test it to see that its working.

Off to test this.
 
Messages
10,088
Country
us-arizona
Very odd results!

When I put in this;
0.1 (>K:ADD_FUEL_QUANTITY,percent)
0.1 (>K:ADD_FUEL_QUANTITY,gallons)
1111 (>K:ADD_FUEL_QUANTITY)
65535 .05 * (>K:ADD_FUEL_QUANTITY)
50 (>K:ADD_FUEL_QUANTITY)
(and a few other variations)

I always get this;
10% (start out... )
35% (first click)
60% (second click)
85% (third click)
100% (fourth click)

Always the same. When I put in 65535 as the fuel amount, it tops off at 100% nicely.

So.... It is locked in, (hard locked or hard coded) at a minimum of 25% intervals. I believe I remember Doug talking about this.

Well, now I know. Cant do 10%. I'll have to make this work. I am so good at finding limitations in FS...
 
Top