Universal Save System

版本 v1.0.0·更新於 2024-05-21

Persistent data storage backend for ULTRAKILL mods.

模組介紹 作者原文

Universal Save System

A persistant data storage system using JSON to store and retrieve data from a file easily and intuitively.

Supports individuals and arrays of types string, int, float, and bool.

Can store global data, which can be accessed by any mod using the correct key, or private data, which is further keyed to the name of the mod calling the functions (or, more specifically, the executing assembly).

Usage

To use the Universal Save System, simply reference the.dll as a dependency and make sure to include it in BepInEx/plugins.

Use ULTRAKIT.UniversalSaveSystem.SaveData.SetPersistent(string key, object value, bool global) to save data.

Use ULTRAKIT.UniversalSaveSystem.SaveData.TryGetPersistent(string key, bool global, out object value) to retrieve data. Make sure to cast the out value to the correct type!

Alternatively, use ULTRAKIT.UniversalSaveSystem.SaveData.GetPersistent(string key, bool global) to retrieve and return data directly, but throws an exception if the data is missing.

Example

using ULTRAKIT.UniversalSaveSystem;

string firstString = "This will be stored in a json file.";

SaveData.SetPersistent("example_data", firstString, true);

SaveData.TryGetPersistent("example_data", true, out object value);

string secondString = (string)value; / OR / string secondString = value as string;

// Alternatively

string thirdString = SaveData.GetPersistent("example_data", true);

Closing Notes

SaveData's functions are equipped with intellisense documentation, so just hover over the function in your IDE to see all about it!

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

檔案與校驗

檔案名稱
Universal_Save_System-1.0.0.zip
檔案大小
92.5 KiB