R.E.P.O.
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
2 days ago
Downloads
316
Size
13KB

ItemSpawner REPOLib 4.2 Compatibility

A rewritten, working replacement for Spoopylocal's original ItemSpawner mod (https://thunderstore.io/c/repo/p/Spoopylocal/ItemSpawner_Fixed), 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<Item>(), 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 Thunderstore Mod Manager profile and the Steam game install - update them if your paths differ.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.