Details
Target: Obenseuer 0.5.08 (buildid 25969064), Unity 6000.0.77f1 Mono, BepInEx 6 Unity.Mono (be.788, the tested build) or BepInEx 5 (5.4.23 or later). Namespace: ObenseuerCore. Logs go to BepInEx\logs\obenseuer.moddingframework.spawners.log.
Everything not listed in this reference is internal and may change without notice.
- The framework changes one of the game’s methods when it starts, so it can tell your mod when a spawner spawns.
- This page’s feature group is
obenseuer.moddingframework.spawners, the name you will see in the log.
When you can call it
- Call everything from your mod’s normal code, not from a background thread you started. The game and Unity only run safely on the main thread (see the glossary). This goes for every member on this page and for the code that handles
Spawned. - It is safe to call any of it at any time. With no save loaded, reads return an empty list or
null, and the writing calls returnfalse. Nothing throws, and a null or unknown id finds nothing. - The writing calls return
falsewhile a save is loading or being written. (the check isSaveData.Busy.)
If something fails to set up
The framework changes some of the game’s methods when it starts. If a game update breaks one of them, the framework turns off the feature group that depends on it, and writes error lines to the group’s log file in BepInEx\logs. The rest of the framework keeps working.
- If the change behind
Spawnedcannot be made,Spawners.IsAvailablebecomesfalseandSpawnednever fires. The feature group is turned off. The reads,SetRespawn,SetRespawnTimingandTriggerNowkeep working. (the change is a postfix onSpawner.TrySpawn(bool).)
What you can’t do (yet)
- You can’t change the game’s difficulty adjustment of the respawn wait. You can set the timing fields, but the countdown itself is only readable.
- You can’t read or change what a spawner spawns. Which items, furniture or characters appear is not covered here. For item lists, see Loot and
Spawnon the world objects page. - You can’t make a spawn that skips the chance roll. The game calls its plain spawn from its own code in many places, so there is no single place for the framework to attach to. (
Spawner.Spawn()with no chance roll is not wrapped.)
While a save is loading
- The framework does not hold back
Spawnedwhile a save is loading. - If your handler should ignore events raised during a load, check
SaveData.Busyfirst. It istruewhile a save is loading or being written.