Jump to content
The simFlight Network Forums
Sign in to follow this  
ark1320

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

 

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

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