Jump to content
The simFlight Network Forums

Recommended Posts

Posted

FS9.1 on XP x64

Autosave 1.501

FSUIPC 3.99

Hi,

I use Autosave to make regular saves - it works very well. Recently, after a request on the FSDeveloper forums, Doug Dawson made a modified version of his dsd_xml_config.gau for saving XML LVars which would save all the variables when the situation was saved... This appears to not work with autosave, only 'user initiated' saves and normal exit of FS. Is this expected behaviour? ie. Is the autosave operation sufficiently different to the user initiated save that the gauge would not see it??

Cheers,

Geoff

Posted

I use Autosave to make regular saves - it works very well. Recently, after a request on the FSDeveloper forums, Doug Dawson made a modified version of his dsd_xml_config.gau for saving XML LVars which would save all the variables when the situation was saved... This appears to not work with autosave, only 'user initiated' saves and normal exit of FS. Is this expected behaviour? ie. Is the autosave operation sufficiently different to the user initiated save that the gauge would not see it??

No, it isn't any different from pressing ";" and entering a name. AutoSave calls exactly the same routine in FS to make it happen, supplying its own generated filename. This has always worked too with other add-ons which save their own data, like the PMDG aircraft and also Wilco and PSS I think. I don't know how Doug's code differs. Maybe he only takes note of the Flight-Save dialogue command, which will of course be a different command and context. Did you check if it saved when using the ';' key?

Regards

Pete

Posted

No, it isn't any different from pressing ";" and entering a name. AutoSave calls exactly the same routine in FS to make it happen, supplying its own generated filename. This has always worked too with other add-ons which save their own data, like the PMDG aircraft and also Wilco and PSS I think. I don't know how Doug's code differs. Maybe he only takes note of the Flight-Save dialogue command, which will of course be a different command and context. Did you check if it saved when using the ';' key?

Regards

Pete

I see. Well, there is certainly some difference as far as the gauge is concerned. I have checked and confirmed that the config ini files timestamp (and content) are updated when I exit the sim or save the situation using the ; key. The timestamp etc does not change when autosave saves a file - and I have checked, of course, that the situation is really being saved.

Oh well, I'll report this back to Doug on FSDeveloper and perhaps he can see a way around it...

Cheers,

Geoff

Posted

No, it isn't any different from pressing ";" and entering a name. AutoSave calls exactly the same routine in FS to make it happen, supplying its own generated filename. This has always worked too with other add-ons which save their own data, like the PMDG aircraft and also Wilco and PSS I think. I don't know how Doug's code differs. Maybe he only takes note of the Flight-Save dialogue command, which will of course be a different command and context. Did you check if it saved when using the ';' key?

Regards

Pete

The gauge is in fact watching for the SITUATION_SAVE control. I wasn't aware of any other way to achieve this.

Doug

Posted

The gauge is in fact watching for the SITUATION_SAVE control. I wasn't aware of any other way to achieve this.

Ah. I can't use that for an automatic save because it would just prompt for a name. I call the FS API directly. I think those aircraft which save their own files at the same time must hook that too.

Regards

Pete

Posted

...I call the FS API directly. I think those aircraft which save their own files at the same time must hook that too...

Is that something that can be done from a C programmed gauge? My experience is limited to writing things in XML so I really don't know what would be involved... Unfortunate though, if it is not possible to save the variables upon autosave.

Geoff

Posted

Is that something that can be done from a C programmed gauge? My experience is limited to writing things in XML so I really don't know what would be involved... Unfortunate though, if it is not possible to save the variables upon autosave.

Yes, it can be done in C. I doubt that it can be done in XML.

Gauges written in C are merely DLLs like FSUIPC with a different name which serves to indicate that instead of loading and staying loaded they are loaded as required according to the panel. Naturally this can present a problem when hooking into a function in FS because if the gauge then unloads the hook will cause an FS crash. I've not written gauges myself, but it would be okay to undo the hook if the gauge is guaranteed to be called before being removed. If that cannot be guaranteed then it would not be advisable to insert hooks.

Another way to implement it in C (or most other languages except XML) is to use FSUIPC. Offset 0400 contains the filename of the last flight (or situation) saved, as an ASCII string with a zero terminator and the counter at 3BD2 is incremented when this has changed. This technique is used by some, especially external programs of course, like Radar Contact, so they can also save their state.

Regards

Pete

Posted

Yes, it can be done in C. I doubt that it can be done in XML.

Gauges written in C are merely DLLs like FSUIPC with a different name which serves to indicate that instead of loading and staying loaded they are loaded as required according to the panel. Naturally this can present a problem when hooking into a function in FS because if the gauge then unloads the hook will cause an FS crash. I've not written gauges myself, but it would be okay to undo the hook if the gauge is guaranteed to be called before being removed. If that cannot be guaranteed then it would not be advisable to insert hooks.

Another way to implement it in C (or most other languages except XML) is to use FSUIPC. Offset 0400 contains the filename of the last flight (or situation) saved, as an ASCII string with a zero terminator and the counter at 3BD2 is incremented when this has changed. This technique is used by some, especially external programs of course, like Radar Contact, so they can also save their state.

Regards

Pete

Thanks very much for the clarification. It is certainly beyond my current ability to do any of that but hopefully Doug can see a way to implement something and has time to try it. The other possibility would be a timed function, then it would be independent of Autosave but the saved FS state and panel state should never then be more than a few minutes apart... For not my 'low tech' solution will be to make a normal ";" save at top of climb so that the panel variables are saved in an "airborne" state!

Cheers,

Geoff

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.