Jump to content
The simFlight Network Forums

Fuel and Payload Variables


Recommended Posts

Hello fellow flight simmers!

First of all, I must say that I feel very bad for posting here, as what I'm about to ask is little bit unappropriate. The thing is that I'm currently tinkering around with a module for FS9 and I'm not using FSUIPC, still have to ask here, and I hope Peter doesn't shoot me for this, how the payload and fuel variables are accessible.

I know, I know, shame on me for not finding this out by myself, but I've tried and tested and disassembled and memorydumped and whatnotall for about two weeks and not come up with a solution. I'm fine reading those variables (aircraft_varget in gauges.h from the panels sdk is fine for that), but I seem to be unable or too stupid to find a way to write to those variables (there is no aircraft_varset). I do know how to use a panel callback, that's how I access the GPS info, but I didn't find any other callback than the GPS one yet (those would have a setProperty function).

Now, it seems that nobody knows about this, because nobody's is answering my posts (not on here), or tells me to use FSUIPC. I know, FSUIPC makes these things possible, but I'm hesitating to use it becuase I'd like my module to be standalone. Plus I'm a speed freak; I'd like to take the direct path and save some cpu cycles on the way.

And whatever I'm doing is released as freeware; I know there's no cost for freeware programs to use FSUIPC, but that's all a bypass that I want to save the users from taking.

Well, it seems this posting here is kind of my last resort on this topic, so I hope Peter can help me in some way - In return I can offer to help with the integration of the GPS Info in FSUIPC, as I think that's not yet included (Nearest airport/airspace scanning, access to the fs9 internal airport database, etc).

Thanks a lot for reading me,

Winti

Link to comment
Share on other sites

I hope Peter can help me in some way

The only way to discover this sort of thing is to hack into FS. You need a good debugger -- Soft Ice is good but a tad expensive, and a disassembler -- I use IDA. Start with the SIM1.DLL, that is where most things are done. It gets very complicated and very messy. The data is not in fixed global areas, but in private data owned by classes. The classes all seem to be derived from each other, meaning that there a pointers to pointers to pointers et cetera to follow through. And these are not static. Each time you load a flight or aircraft the class instances involved are destroyed (along with those data areas of course) and rebuilt. Worse, in FS2004 for the first time there are lots of separate ones for different subsystems and each of those only exists when it needs to -- Helos for instance have a completely different set to gliders.

This is really about all I can tell you. 90% of the code in FSUIPC is concerned with this sort of stuff, and developing it takes many months of solid 100 hour weeks for every new FS release. I'm sorry if the results seem inefficient to you, but the FSUIPC code itself is relatively sleek, especially compared with the contortions that the use of C++ seem to be inducing in the innards of FS itself.

Ah, it all used to be so easy in FS4!

In return I can offer to help with the integration of the GPS Info in FSUIPC, as I think that's not yet included (Nearest airport/airspace scanning, access to the fs9 internal airport database, etc).

That's kind, but isn't that available through the GPS_export DLL provided by Microsoft? I don't really want to duplicate stuff. Thanks anyway.

Regards,

Pete

Link to comment
Share on other sites

Geez, I guess that means more disassembling and pointer following for me. If only they'd publish an interface for sim1.dll like they did for panels.dll in the panels sdk.

That's kind, but isn't that available through the GPS_export DLL provided by Microsoft? I don't really want to duplicate stuff. Thanks anyway.

Nope, the gps_export.dll just gives you access to the most basic features, not even nearest airport information. I've got a header file to access all the good stuff up at http://www.winterstiger.at/christoph/stuff/gpsprop.h

A little bit of help is included in there... Check it out, you'll see if you can use it :)

Greetings,

Winti

Link to comment
Share on other sites

Check it out, you'll see if you can use it :)

Thanks. It does look interesting, but it isn't something I want to get into at present. I seem to have too much on as it is, and I'd like to actually get some time to fly before the work for the next version of FS has to be started! :wink:

And, sorry but I don't tend to use procedural interfaces except where I have no choice, as they tend to be too inefficient for WideServer servicing of clients -- it has to maintain a list of data being read by each client and scan it frequently enough looking for changes to keep those clients going at roughly FS frame rates. If I had to make gauge type calls for each then it would never get done in the time available.

BTW, another way to find stuff like fuel would be to trace through from the "OKaying" of changes in the fuel dialogue to see what happens to it -- i.e. how it gets written. It may be quicker to do it this way for specific items like that. I needed almost everything in the engine and fuel departments, so I had no choice but ot do it the hard way.

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