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.hud.log.
Everything not listed in this reference is internal and may change without notice. This page is experimental and may change too.
The framework changes some of the game’s methods when it starts, so it can add console commands and tell your mod about task item changes. This page calls each group of those changes a feature group. Each group has a name that shows up in the log. This page uses two: obenseuer.moddingframework.hud (the console commands and the task item event) and obenseuer.moddingframework.difficulty (the difficulty factors).
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). That includes the code that handles
TaskItems.Changed, and theruncode of a console command. - It is safe to call at any time, even on the main menu, while a save is loading, or with no save loaded. If there is nothing to read yet, you get a neutral answer:
null,0, an empty array, an empty list orfalse. A call that changes something gives backfalsewhen the part of the game it needs is missing. - Some calls throw an error when you pass a bad value. An invalid mod id, or a null or empty name, text, title or body, throws an
ArgumentException. A mod id is 1 to 64 characters of letters, digits,.,_or-. Printis the exception, and only throws for a nulltext.- A null
linesorrunthrows anArgumentNullException. - A negative fade time throws an
ArgumentException. - Ids that name game things, such as an achievement id or a note id, never throw. An unknown id gives
null,0orfalse. - If the game itself fails during a call, you get the plain default answer instead of an error. The first failure of each member goes to the log. Later failures of that member are not logged again.
- Unlocking an achievement cannot be undone from a mod.
Achievement.Trigger,AddProgressandSetProgressunlock the real Steam achievement and store its stat. They give backfalsewhile a save is loading or being written. Everything else on this page only reads, or changes the screen for this session. (They go through the game’s own trigger, and the save 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 and a warning to the group’s log file in BepInEx\logs. The rest of the framework keeps working.
- If the console setup fails,
ConsoleCommands.IsAvailableisfalseandRegistergives backfalse.Print,OpenandIsOpentalk to the game’s console directly, so they do not depend on that setup. (The methods involved areDeveloperConsole.HandleInputandDeveloperConsole.PrintValidCommands.) - If the task item setup fails,
TaskItems.Changedstops firing.All,Has,Amount,AddandRemovekeep working. (The methods involved areTaskItemsManager.AddTaskItemandTaskItemsManager.RemoveItem.) - If the difficulty setup fails,
GameDifficulty.FactorsAvailableisfalseandSetFactorgives backfalse.Current()keeps working.