Old Enemy Mod Fix

版本 v1.0.0·更新於 2026-07-12

Makes old enemy mods spawn again when they install fine but never appear. Rewires the empty spawn list old-SDK enemy bundles load under REPOLib 4.x, so the enemy spawns at its normal rates.

模組介紹 作者原文

Old Enemy Mod Fix

Makes old enemy mods spawn again when they install fine but never appear.

What it does

Enemy bundles built against an older REPOLib SDK load their spawn-object list empty under REPOLib 4.x. REPOLib sees an enemy with nothing to spawn, logs "no spawn objects found", and skips it. There is no crash, the enemy just never shows up. The prefab and setup are still in the bundle. This pulls them back out and rewires them right before registration, and the enemy spawns at its normal rates.

Installation

  • Install BepInEx.
  • Put OldEnemyModFix.dll in BepInEx/plugins. Requires REPOLib.
  • Install it next to the affected enemy mods. It contains no enemy content.

Confirmed working with

  • Rudeus-Vacuum_Enemy
  • souurdough-SpinosaurusIsCalling

Other old-SDK enemy mods with the same "no spawn objects found" log line should also work.

For developers - detailed breakdown

GUID: themorningstar.oldenemymodfix

One Harmony patch, a prefix on REPOLib.Modules.Enemies.RegisterEnemy(EnemyContent).

An old-SDK.repobundle contains an EnemyContent whose serialized _setup and _spawnObjects fields do not map to REPOLib 4.x's field layout, so both deserialize empty. The enemy prefab, a GameObject carrying an EnemyParent, and the EnemySetup ScriptableObject both still load, because the bundle's preload table pulls them into memory even though they are not top-level assets.

The prefix:

  • Skips healthy content where Setup is non-null and SpawnObjects is non-empty, so new-SDK mods are never touched.
  • Builds a haystack from the content's name and bundle name, for example "Vacuum Content" or "Enemy - Spinosaurus1", normalized to lowercase with spaces, dashes, and underscores stripped.
  • Finds the prefab with Resources.FindObjectsOfTypeAll(), taking the one whose normalized enemyName is the longest token of at least three characters contained in the haystack. Longest match stops a short name from taking the wrong slot.
  • Finds the matching EnemySetup by the same token, preferring one that already has spawn entries.
  • Writes both into the private backing fields by reflection.

RegisterEnemy then does the rest: it registers the prefab as a network prefab and rebuilds enemySetup.spawnObjects, so the bundle's stale PrefabRefs are never read.

Identification is by name token. If the enemy's name appears nowhere in the content or bundle name, it logs a warning and skips rather than guess. It only helps mods whose plugin ran and handed REPOLib the content. A mod whose own Awake crashed before registering anything is Repo Old Mod Rescue's job.

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPackZehs-REPOLib

檔案與校驗

檔案名稱
Old_Enemy_Mod_Fix-1.0.0.zip
檔案大小
14.4 KiB