Saving Mod Data & Mod Configuration
Per-Run Save Data (NpcSaveStore)
PlayerStore.Instance.ModData() provides a Dictionary<string, string> persisted inside the active save file. NpcSaveStore wraps this dictionary with a "cnpcf_" prefix and an in-memory fallback dictionary MemoryFallback when accessed from the Main Menu:
csharp
NpcFrameworkSdk.SetSaveInt("v_stage", 1);
int stage = NpcFrameworkSdk.GetSaveInt("v_stage", 0);
int totalDeals = NpcFrameworkSdk.AddSaveInt("v_deals", 1, 0);When the player toggles "Reset Current Save NPC Storyline Progress" in the Mod Config window, NpcSaveStore.ResetAllFrameworkKeys() removes all "cnpcf_" keys from the current save's ModData() dictionary.
Mod Configuration (ModConfig)
CustomNPCFrameworkMod defines two sections via ModConfig.For("CustomNPCFramework"):
- General & Spawn Settings:
language: Auto (follow game locale), Simplified Chinese, or English;enabled: master switch for daily automatic spawning;spawn_rate_percent: slider (25% .. 300%) scalingSpawnChancePercentacross all add-on packs.
- Developer Debug Panel:
debug_summon_id: dynamic dropdown listing auto-storyline dispatchers (v,billy) and all registered NPC IDs;debug_reset_save: one-click toggle to reset storyline progress for the active save.