Jump to content

[Plugin - 0.23.5] Persistent file backup generator - V0.3.1


Recommended Posts

Updated to better handle quick-load plugins.

This simple plugin generates a variable number of backup persistent files in your savegame folder. The number of backups can be altered with the included Settings.cfg file.

Version 0.3: Should now be working with any plugin that bypasses the main menu and loads directly into the space center or an active vessel (really this time).

Version 0.3.1: Compiled against .net 3.5, ModStatistics should no spam debug log errors

To restore a backup just rename the original persistent file, then rename the desired backup from "persistent Backup 3" to "persistent" (without "" and using the # from the desired backup) and it should now load with the working file.

This is intended to serve as a protection against persistent file corruption or from having your vessels wiped out by missing parts. It is not intended to be used for save scumming (reloading a save file over and over to get something perfect). Backup save files are only generated when a file is first loaded from the mainmenu.

Source is available in the download and on GitHub.

License under the 2-clause BSD: BSD License

Edited by DMagic
Version 0.3.1
Link to comment
Share on other sites

  • 2 weeks later...

I updated this. It now directly copies the existing persistent.sfs file into a backup file instead of using the SaveGame method. This seems to accomplish the same thing, but now it works with plugins that bypass the main menu.

Link to comment
Share on other sites

I updated this. It now directly copies the existing persistent.sfs file into a backup file instead of using the SaveGame method. This seems to accomplish the same thing, but now it works with plugins that bypass the main menu.

Is it possible to get this to write outside the Saves directory, via config maybe? Just imagining it outputing to a Dropbox folder.

Link to comment
Share on other sites

Is it possible to get this to write outside the Saves directory, via config maybe? Just imagining it outputing to a Dropbox folder.

It should be easily possible, but it is against Squad's addon rules to write or alter files outside of the KSP directory: http://forum.kerbalspaceprogram.com/threads/7529-Plugin-Posting-Rules-And-Official-Documentation. Even exposing such an option through the Settings.cfg file would probably be a bad idea.

Changing it yourself wouldn't be too much trouble. You just need to replace the second "activeDirectory" line with the full path of your desired destination, then recompile it.

File.Copy(Path.Combine(activeDirectory, "persistent.sfs"), Path.Combine(activeDirectory, replaceBackup), true);

Link to comment
Share on other sites

It should be easily possible, but it is against Squad's addon rules to write or alter files outside of the KSP directory: http://forum.kerbalspaceprogram.com/threads/7529-Plugin-Posting-Rules-And-Official-Documentation. Even exposing such an option through the Settings.cfg file would probably be a bad idea.

Changing it yourself wouldn't be too much trouble. You just need to replace the second "activeDirectory" line with the full path of your desired destination, then recompile it.

File.Copy(Path.Combine(activeDirectory, "persistent.sfs"), Path.Combine(activeDirectory, replaceBackup), true);

Hmm. What's their policy on online connections? I know a few mods do a simple GET to check for updates and such; is it permitted to *send* also?

Link to comment
Share on other sites

Hmm. What's their policy on online connections? I know a few mods do a simple GET to check for updates and such; is it permitted to *send* also?

I'm not really sure what the policy is. The rules post that I linked to says that you have to somehow notify players that you are accessing anything online, but they don't say anything about actually sending data.

Any plans to implement restoring to these saves in-game? I'd love, when I held F9, for a menu to come up asking which save to restore from.

I'm actually trying specifically to avoid that. I don't really like the idea of save scumming and I don't want to encourage it (I know that there are lots of legitimate uses for multiple saves, too). There are a few mods out there that do basically that. I found this one: http://forum.kerbalspaceprogram.com/threads/51901-0-23-Multiple-Saves-DA-v016, but I think I've seen others somewhere too.

Link to comment
Share on other sites

I'm actually trying specifically to avoid that. I don't really like the idea of save scumming and I don't want to encourage it (I know that there are lots of legitimate uses for multiple saves, too). There are a few mods out there that do basically that. I found this one: http://forum.kerbalspaceprogram.com/threads/51901-0-23-Multiple-Saves-DA-v016, but I think I've seen others somewhere too.

You call it save scumming, I call it running simulations :) But I understand the reasoning.

Link to comment
Share on other sites

  • 2 months later...

I've been ignored over in the Module Manager thread so maybe you can do something. MM is triggering this plugin when it does its backup, so that all of my persistence file backups become the current persistence file. If I want my backups, I need to get them out of the backup folder MM created.

Link to comment
Share on other sites

You should complain more vigorously in the MM thread. I opened up an issue on the MM GitHub page.

MM isn't triggering this plugin, it's simply overwriting every .sfs file in the save folder when certain circumstances trigger it. The original files should all still exist in a newly created backup folder. Nevertheless this should not happen. If MM wants to overwrite the persistent.sfs file and generate a new backup file that's fine, but it should never overwrite every .sfs file in the save folder, including the quicksave.sfs file.

Link to comment
Share on other sites

  • 3 years later...

Tested, still working in v1.3.1 :) Just wanted to bump this because I still find it better than the stock backup and don't want it to be forgotten as an out of date mod when it isn't!

(could use a re-upload tho @DMagic in case anyone else is interested in using it... :P)

Edited by Drew Kerman
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...