ModSaveBackups

v1.2.0·Updated 2026-06-21

This Sailwind mod creates separate save files for your mod data and also handles making and loading backups.

About this mod Author’s original text

ModSaveBackups

Intended to be used mainly by modders as a dependency, but can also be used by players.

Incorporates the ModSave class from SailwindModdingHelper by App24 so now

this can be more thought of as ModSave with Backups.

Using this mod will allow you to create a save file for you Sailwind mod data separate from the main save file for the game.

This mod will also create backups of that mod save file when the game makes backups of the main save file. If you load a backup

save then the corresponding backup mod save file will be loaded.

Usage

Make a Serializable save container class to hold the data you wish to save:

[Serializable]

public class ExampleSaveContainer

{

public Dictionary exampleDict;

public bool exampleBool;

}

Then make a patch to save the data on save and a patch to load the data on load:

[HarmonyPatch(typeof(SaveLoadManager))]

private class SaveLoadManagerPatches

{

[HarmonyPostfix]

[HarmonyPatch("SaveModData")]

public static void DoSaveGamePatch()

{

var saveContainer = new ExampleSaveContainer();

saveContainer.exampleDict = MyModGameObject.instance.exampleDict.ToDictionary(

entry => entry.Key,

entry => entry.Value);

saveContainer.exampleBool = MyModGameObject.instance.exampleBool;

ModSave.Save(Plugin.instance.Info, saveContainer);

}

[HarmonyPostfix]

[HarmonyPatch("LoadModData")]

public static void LoadModDataPatch()

{

if (!ModSave.Load(Plugin.instance.Info, out ExampleSaveContainer saveContainer))

{

Plugin.logger.LogWarning("Save file loading failed. If this is the first time loading this save with this mod, this is normal.");

return;

}

if (saveContainer.portBadges!= null)

{

LoadDictionary(saveContainer.portBadges, PortsVisitedUI.instance.portBadges);

foreach (KeyValuePair item in saveContainer.exampleDict)

{

if (MyModGameObject.instance.exampleDict.ContainsKey(item.Key))

{

MyModGameObject.instance.exampleDict[item.Key] = item.Value;

continue;

}

Plugin.logger.LogWarning($"LoadData: {item.Key} not found in game");

}

}

if (saveContainer.exampleBool!= null)

MyModGameObject.instance.exampleBool = saveContainer.exampleBool

}

}

Requires

  • BepInEx 5.4.23

Installation

Place the ModSaveBackups.dll into the Sailwind/BepInEx/Plugins folder.

Consider supporting me 🤗

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
ModSaveBackups-1.2.0.zip
File size
126.3 KiB