TheMorningStar-Repo_Old_Mod_Rescue icon

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 crashes.

Last updated 3 hours ago
Total downloads 14
Total rating 0 
Categories Mods Misc AI Generated
Dependency string TheMorningStar-Repo_Old_Mod_Rescue-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
Zehs-REPOLib-4.2.0 icon
Zehs-REPOLib

Library for adding content to R.E.P.O.

Preferred version: 4.2.0

README

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

  1. Install BepInEx.
  2. Put RepoOldModRescue.dll and level_module_map.txt together in BepInEx/plugins/. Both files are needed. Requires REPOLib.
  3. 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 - <Level> - <TYPE> - <TIER> - <n>, are still in memory through the bundle's preload table. The shipped level_module_map.txt 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<Level>. 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 constructor.

Prefix on Map.AddDoor. Returns early when the door prefab argument is null, which Dirt Finder passes.

A once-per-run diagnostic postfix on EnemyDirector.Start logs the three difficulty pools, which shows whether a rescued enemy landed in a spawnable pool.

Enemy and valuable rescue only works when the old mod's Awake got far enough to load its bundle before crashing. If it died earlier there is nothing in memory to rescue. There is no config.