Jump to content
The simFlight Network Forums

Saving and Reading Offsets to/from a File


Recommended Posts

At the end of a flight I'd like to use a Lua script to save a small number of offset values (fuel tank quantities) to be read and loaded at the next sim session.

As far as I can tell there are no special facilities for this in the FSUIPC lua library, so I assume I will need to learn how to use standard Lua io methods for reading and writing files.

If anyone has any recommendations on how best to proceed or where to look for good examples, that would be most appreciated.

Thanks,

Al

 

Link to comment
Share on other sites

1 hour ago, ark1320 said:

At the end of a flight I'd like to use a Lua script to save a small number of offset values (fuel tank quantities) to be read and loaded at the next sim session.

As far as I can tell there are no special facilities for this in the FSUIPC lua library, so I assume I will need to learn how to use standard Lua io methods for reading and writing files.

The "FSUIPC Lua library" is a collection of ADDED functions relating to its job of interfacing to the simulator. All the standard Lua libraries are also incorporated. Those functions are obviusly not re-documented in the supplied FSUIPC documents because they are better explained in the original texts and freely accessible directly on the Lua website, to which a reference is shown prominently.

1 hour ago, ark1320 said:

If anyone has any recommendations on how best to proceed or where to look for good examples, that would be most appreciated.

Look in the Lua Examples ZIP file in your FSUIPC Documents subfolder. Proably the one which springs to mind most obviously is the "record to CSV" example, which both reads offsets and writes to a file. Reading files and writing to offsets is just as easy.

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.