Closed soarqin closed 9 months ago
This was done specifically so you can apply your saved data to the world. What are you trying to achieve?
For a simple example:
I would like to use mod saved options in my patch to GameData.Import()
, the Postfix patch is too late to get the mod data so that I cannot use DSPModSave to manage my saved options.
What kind of data are you storing? Because by the sound of it, simple ConfigFile is all you need.
Also you didn't say WHAT you wanted to achieve. Your last message is too vague on your overaching goals.
What kind of data are you storing? Because by the sound of it, simple ConfigFile is all you need.
hmmm, in my mod UniverseGenTweaks
I want to save universe generation options in game saves, which may differ across new-games, so that they cannot be saved in ConfigFile.
These options are used in UniverseGen.CreateGalaxy()
, which is called during GameData.Import()
, so I need to know these options before gamesave is fully loaded
Hm. I see. I will think about this.
Your request has been implemented in v1.2.0.
Place ModSaveSettings
attribute on your plugin class like so:
[ModSaveSettings(LoadOrder = LoadOrder.Preload)]
https://github.com/kremnev8/DSP-Mods/blob/719e9ed7c0a117395be5f71c71549293a6e0e3d7/Mods/DSPModSave/src/DSPModSave/Patches.cs#L98-L100 Currently there is only Postfix patch for
LoadCurrentGame
.I have a mod which is required to use saved options in patched codes during loading saves, so that the Postfix patch is too late in this situation.