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.traders.log. - The framework changes one game method when it starts, so it can scale prices. Its feature group, the name you will see in the log, is
obenseuer.moddingframework.traders.
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 and Unity only run safely on the main thread (see the glossary). - Reading is safe at any time, even on the main menu.
Getgivesnullwhen the trader is not found or the framework is not ready.
What to check for and what comes back
Traders.IsAvailabletells you whether reading a trader and changing its money work.Traders.PriceFactorsAvailabletells you whether price factors work. Both arefalsewhen the framework is not ready.- Writes return
falseinstead of throwing.SetMoney,Restock,SetPriceFactorsandClearPriceFactorsreturnfalseduring a save or a load, while a trade is running, for an unknown shop id, for a mod id that is not valid, or when a number is not a real number or out of range. BuyandSellreturnfalseand give a reason inrefusal.
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 framework cannot change the game’s price method, price factors stop working and the rest keeps working.
PriceFactorsAvailablebecomesfalse. (the method isTrade.GetItemStackPrice, the same one theShops.PriceQueryevent uses)