Repo Old Mod Rescue
Revives older mods whose content loads but never registers. Registers enemies, valuables, and levels that current REPOLib skipped, restarts the BlackBox truck monitor, and guards two Xepos-Mutators cr
模組介紹 作者原文
Repo Old Mod Rescue
Revives older mods whose content loads but never registers.
What it does
Older mods often call REPOLib methods that no longer exist. Their startup loads the asset bundle, then crashes before registering anything, so the content sits in memory unused and the mod does nothing in game. This finds that content during REPOLib's registration pass and registers it with the current API. It also restarts the BlackBox truck monitor, which crashes on startup, and fixes two Xepos-Mutators crashes, one of which freezes level loading.
Installation
- Install BepInEx.
- Put RepoOldModRescue.dll in BepInEx/plugins. Requires REPOLib. (level_module_map.txt is embedded in the DLL; the loose file is not needed.)
- Keep the broken mods installed. This contains none of their content and only makes them register.
Confirmed working with
- PaintedThornStudios-MCZombieMod: MC Zombie and Rotten Flesh spawn again
- RoemisTeam-BlackBox: truck damage monitor works again
- AriIcedT-SisyphusStaircaseLevel, Rosayy-Echohold, Rosayy-Woodland_Mansion, MelanieMelicious-Melanie_REPO_Levels: rooms loaded empty, now relinked
- Xepos-Mutators: fixes the Less Is More infinite load and the Dirt Finder door errors
For developers - detailed breakdown
GUID: themorningstar.repooldmodrescue
Six patches, one per failure.
Prefix on Enemies.RegisterEnemies. This is REPOLib's enemy drain, which runs once after every plugin loads. The prefix scans every loaded AssetBundle for EnemySetup assets that have a non-empty spawnObjects list but are missing from Enemies.RegisteredEnemies and Enemies.AllEnemies. For each one it finds the prefab, a GameObject with an EnemyParent, taking the first in the same bundle or matching by normalized name token in memory. It builds an EnemyContent by reflecting onto the private _setup and _spawnObjects fields, then calls Enemies.RegisterEnemy so the orphan registers with the drain that is about to run.
Prefix on Valuables.RegisterInitialValuables. Scans loaded bundles for GameObjects carrying a ValuableObject whose Valuables/{name} network prefab is not registered, and registers them with Valuables.RegisterValuable. (It also skips enderpearl because my attempts at fixing that mod went really poorly, maybe another time lol.)
Prefix on Levels.RegisterLevel(LevelContent). Old-SDK level bundles deserialize their module lists empty, so the game later does list[0] on an empty StartRooms and the load never finishes. The room prefabs, named Module - - - -, are still in memory through the bundle's preload table. The level_module_map.txt (embedded in the DLL) maps levelName|fieldName|moduleName, baked from each level's real Level ScriptableObject, and the prefix repopulates the private lists by reflection before RegisterLevel reads them. A level with no map entry gets a warning and no relink.
Postfix on RunManager.Awake, one shot. This restarts BlackBox. Its Awake dies at a dead-API NetworkPrefabs.RegisterNetworkPrefab call before it registers anything. The postfix replays that Awake with the current API: it sets the Instance, loads DamageCanvasMultiplayer and DamageCanvasMultiplayerShop from the bundle, registers both as network prefabs, then applies 12 of its 14 Harmony patch classes. The other two, RunManagerPatch and SemiFuncPatch, reference RunManager.levelShop, whose type changed from Level to List. Applying them breaks every level change, so they are skipped and a LevelGenerator.Start postfix calls the stat tracker's resetRunStats instead, which is the only thing those two classes did that still matters.
Prefix on ValuableObject.DollarValueSetLogic. Gives any valuable with no durabilityPreset a cached real one before the method and Less Is More's postfix run. The mutator reads durabilityPreset.fragility with no null check, so a valuable with no preset throws an NRE that stops the spawn coroutine and hangs the level. The mutator's own type cannot be patched, because touching it at load time crashes its static construc
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: