Jump to content

Saving & Loading for Current Gamesave & Other Q's


Recommended Posts

Hi guys!

I'm trying to save values, say a float, within the current game save only. I'm aware of how to save mod settings but I've looked online and used the forums search tools and have come across nothing. The value is not assigned to any part and exists only in the SpaceCenter. So I'm not sure if I can use the persistence file. How do I go about doing this?

Other quick questions:

  1. How can I get the current level of a building? 
  2. Is there anywhere (like documentation) where I can find information like this in the future, or do I just have to learn it all?
  3. Is there any way to get the time since game start without timewarps (IE the real-world time for how long the current savefile has been running)

Huge thanks in advance!

Link to comment
Share on other sites

For saving to/loading from the save file use a scenario module. A simple example would be KSC Switcher which loads and saves a single value using this code.

  1. Current level of building: I've never tried but a quick look in VS object browser suggests ScenarioUpgradeableFacilities.Instance.GetFacilityLevel(BuildingName)
  2. I generally look at existing mods that I think might be doing something similar or manipulating objects I need. Also object browser and intellisense in Visual Studio
  3. Not from the save file but the mod TotalTime keeps track of this.
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...