Enemy Test Spawner

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

Spawn any registered enemy on a hotkey, for testing. Pick an enemy from a REPOConfig dropdown and press the key to make it appear in front of you. Off by default; host or singleplayer only.

模組介紹 作者原文

Enemy Test Spawner

Spawns any enemy on a hotkey, for testing. Off by default.

What it does

Pick any registered enemy from a dropdown in REPOConfig. The list fills itself from every enemy in the game, vanilla and modded. Press the spawn key, default Insert, and the enemy appears in front of you, default 3 metres, facing you. Config applies live with no relaunch. It works for the host or in singleplayer. It is meant for testing rare or difficulty-gated enemies and checking whether an enemy mod works at all.

Installation

  • Install BepInEx.
  • Put EnemyTestSpawner.dll in BepInEx/plugins. Requires REPOLib.
  • It does nothing until Enabled is set to true in REPOConfig.

Config

| Setting | Default | What it does |

|---|---|---|

| Enabled | false | Master switch. Inert until true. |

| SpawnKey | Insert | Hotkey that spawns the chosen enemy. Any KeyCode name, such as F2 or Keypad0. |

| Enemy | dropdown | Which enemy to spawn. |

| SpawnDistance | 3 | Metres in front of you it appears. |

For developers - detailed breakdown

GUID: themorningstar.enemytestspawner

The dropdown comes from a Harmony postfix on REPOLib.Modules.Enemies.RegisterEnemies. It binds the Enemy config entry after REPOLib finishes registering, using an AcceptableValueList built from Enemies.AllEnemies and Enemies.RegisteredEnemies, which REPOConfig renders as a cycle selector. If the hook fails or the list is empty, it binds a plain text field and matches input as a substring.

The spawn path runs in Update into Spawn, reading all config live:

  • Enum.TryParse on SpawnKey, falling back to Insert on a typo.
  • Gate on SemiFunc.IsMasterClientOrSingleplayer(). Clients get a log line, not a spawn.
  • Look up the EnemySetup in EnemyDirector.instance's enemiesDifficulty1/2/3 pools by exact name, then substring. No match logs every available enemy name.
  • Spawn every prefab in setup.spawnObjects at player + forward * SpawnDistance + 0.5 up, rotated to face you. Multiplayer goes through PhotonNetwork.InstantiateRoomObject, singleplayer through a plain Instantiate.

After spawning it logs a two-pass component dump at 0.3s and 2.5s: every Enemy* and PhotonView component with its enabled and active state, plus a count of missing-script components. When a modded enemy spawns but stands still, the dump shows which AI component is disabled or missing.

It searches the difficulty pools, not the registration list. An enemy that registered but never landed in a pool is not found, and the available-enemy log line then shows what is actually spawnable. It spawns the enemy raw. The director does not know it exists, so there is no vanilla pacing around it.

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

BepInEx-BepInExPackZehs-REPOLib

檔案與校驗

檔案名稱
Enemy_Test_Spawner-1.0.0.zip
檔案大小
17.2 KiB