ItemSpawner REPOLib42 Compat
Spawn any item or valuable from an in-game window. A rewritten, working replacement for ItemSpawner_Fixed, updated for REPOLib 4.2.
模組介紹 作者原文
ItemSpawner REPOLib 4.2 Compatibility
A rewritten, working replacement for Spoopylocal's original ItemSpawner mod
( which broke
after the game updated and REPOLib moved past its pre-3.0 API
(RegisteredValuables, etc.).
Target:
- R.E.P.O. 0.4.4.x
- REPOLib 4.2.0
- BepInEx 5.x
How it works
- Uses REPOLib.Modules.Items.SpawnItem and
REPOLib.Modules.Valuables.AllValuables / Valuables.SpawnValuable
(REPOLib 4.2 API), instead of the old pre-3.0 calls the original mod used.
- The GUI is not attached to the plugin's own GameObject. In this game
that object never receives Update/OnGUI callbacks (unclear why -
possibly how BepInEx's manager object is parented/hidden here). Instead, a
Harmony postfix on PlayerAvatar.Start adds the ItemSpawnerGui component
directly onto the local player's own GameObject, which the game guarantees
is active and ticking. This mirrors what the original mod did (it patched
ShopManager.Awake for the same reason).
- Item lookups do not use REPOLib.Modules.Items.AllItems. That property
reads StatsManager.itemDictionary, which the game only populates on a
full progress reset (StatsManager.RunStartStats) - in an ordinary session
with an existing save it stays empty, silently hiding every item (weapons
included). Instead we call Resources.FindObjectsOfTypeAll(), which
finds every Item asset actually loaded in memory regardless of that
dictionary.
- Name matching checks both the REPOLib "friendly" name (itemName) and the
raw Unity asset name (e.g. "Item Gun Handgun", which is what the original
mod matched on), first for an exact match, then a partial (contains) match.
Controls
- The spawn window is visible by default when you load into a level - no
key press needed.
- If you click "Hide", a small "ItemSpawner" tab stays in the top-left
corner to bring the window back.
- Type or paste (Ctrl+V works) an item/valuable name into the text field and
click Spawn. Pasting a full slash command like `/additem Item Gun
Handgun also works - the /additem` part is stripped automatically.
- Click All Items or All Valuables to browse everything currently
loaded (base game + any REPOLib-registered mod content), with a filter
box. Clicking an entry fills the text field for you.
Why there's no hardcoded item list here
Earlier versions of this README shipped a hand-maintained list of every
valuable/item name. That list goes stale the moment the base game or any
REPOLib mod adds new content. Instead of maintaining a list by hand, the mod
reads the live list from the game at runtime - use the in-game All
Items / All Valuables buttons described above to see exactly what's
spawnable in your current modded setup, always up to date.
Notes
- Do not replace REPOLib with 1.4.2. Keep REPOLib 4.2.0.
- Build with Visual Studio/MSBuild on Windows. The.csproj HintPath
entries point at a Mod Manager profile and the Steam game
install - update them if your paths differ.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: