Jump to content

Saving module data to persistent.sfs


Recommended Posts

I have a class which doesn't inherit PartModule, is it possible to save its variables to persistent? Basically, the class in question keeps progress variables, and it would be really preferable to save these to persistent. If its not possible, is it possible to pick up the name of the game, and create a file based on that game name?

Failing this, I guess I'll just have to save the vars to a global save, which I don't want to, if I can at all help it.

Link to comment
Share on other sites

KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder + "/file.ext"

That's a path to file.ext inside your current save folder. For obvious reasons, you should only save here when you have a save loaded, not at the main menu.

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