Details
Everything not listed in this reference is internal and may change without notice. Items marked experimental may change too.
- 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 toBepInEx\logs\obenseuer.moddingframework.modnpcs.log.
When you can call it
- Call everything from your mod’s normal code (
OnLoad, event handlers,Update), not from a background thread you started. The game only runs safely on the main thread (see the glossary).
What to check for and what comes back
- A call that can’t do its job returns its plain “no” value and does not throw.
Spawn,SpawnSaved,SpawnWithLookandCharacterIdOfreturn0,SpawnExtraandExtraObjectreturnnull, andDespawn,ClearandDespawnExtrareturnfalse. - The only errors are
ArgumentExceptionfor a badmodId,npcId,extraId,name,scene,positionoryaw. - If the game itself fails while the framework works, you get the same plain “no” value. The first failure of each member goes to the log as an error. Nothing half-built is left behind.
If something fails to set up
- This API does not change any game method when it starts.
- Its feature group, the name you will see in the log, is
obenseuer.moddingframework.modnpcs. A feature group is the named set of the framework’s changes for one feature. - If it has been switched off,
ModNpcs.IsAvailableisfalseandSpawnreturns0.