Jump to content

FSUIPC Fuel Remaining


Recommended Posts

Excuse me if this has been asked, I used the search feature and couldn't anything. :)

Anyway... here is my question. I figured this would be an easy step, use one offset to get the fuel remaining right? Wrong. I then figured all I would have to do is add all the fuel levels up to get the total fuel remaining. Wrong again. After a deeper investigation it looks like the only offsets that are available are fuel level in %, and fuel capacity in US Gallons. I figure I just need to take the precent of fuel remaining from the capacity to give me the actual ammount remaining, but for the 7 different fuel tanks this seems like it could get ugly.

My question is: is there any easier way then the above? I just want to know before I spend all the time on calculating a single value. :D

Thanks Kindly,

Cameron Jones

Link to comment
Share on other sites

I figured this would be an easy step, use one offset to get the fuel remaining right?

No, it has never been like that. FS95, FS98, FS2000, FS2002, FS2004 ...

My question is: is there any easier way then the above? I just want to know before I spend all the time on calculating a single value.

No, that is certainly the way to do it. The information you see is the raw information from FS. There is a way inside FS to get the total fuel, but it involves calling a procedure which does exactly what you have to do.

You might think it would be best to have FS do all the work so you have less to do, but think again. FSUIPC has to maintain the values frequently, if not on every FS frame then at least every so many frames, otherwise things get noticeably jerky on external fuel gauges. It wouldn't be so bad if it only had to do this when an external program actually wanted to read it, but it cannot afford to be so lazy. The external program might be running on a Networked PC via WideFS. The WideFS system depends upon getting changes sent out automatically for any data each client has expressed an interest in. This is how WideFS manages to maintain the FS frame rate on every client PC.

So, it turns out that rather than force FSUIPC to calculate this for you, or possibly ask FS to calculate it for you, it is more efficient for the external application to do it. This allows the FS process to remain efficient and puts the extra work in a separate process, as and when it needs to do it.

I do hope that is clear. There are quite a few other instances like this.

BTW there are 11 possible tanks these days, not just 7 -- see the extra ones at offsets 1244-1260.

Regards,

Pete

Link to comment
Share on other sites

If you want to show fuel remaining in weight terms rather than capacity, the current pounds-per-gallon is available at 0AF4. I assume this changes with altitude -- as pressure changes the relationship between capacity and weight changes.

Now, in FS2002 there is a short cut to getting the remaining fuel weight. (I only just thought of this :) ). The total current loaded weight is available at 30C0 and the zero fuel weight (ZFW) is at 3BFC. Since FS2002 never allows any passenger or freight to be included (folks fiddle it using fuel I think), you can get the fuel weight as the difference.

At present this probably won't work on FS2004. I am not sure yet (I've not yet got that far), but I don't think the loaded weight and the ZFW are yet obtained. I might be wrong, it is worth a look, but I've a feeling they were amongst the things I didn't find in time for the FS2004 release and have left to find over the next few days or weeks or months or ....

Regards,

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.