Skip to content
QinShenYu edited this page Jun 16, 2026 · 13 revisions

ScavLib — Scav Prototype Mod API Library

Current Version:​ 0.7.2

Authors:​ Kanisuko / QinShenYu

BepInEx GUID:​ com.kanisuko.scavlib


ScavLib is a foundational developer-focused API and utility library for Scav Prototype (a.k.a. Casualties Unknown). It provides safe, well-documented wrappers around the game's core systems so mod authors can focus on their features rather than boilerplate and null-checking.

Note for players:​ This is a dependency library. It adds no content on its own and is only needed if another mod requires it.


Requirements

  • BepInEx 5.x (64-bit recommended)
  • Scav Prototype (Steam)
  • Optional: KrokoshaCasualtiesMP — if present, ScavLib's compatibility bridge activates automatically. See Multiplayer Compatibility.

Quick Navigation

Page Description
Getting Started Installation and your first mod
PlayerUtil Player vitals, state queries, drugs, last-stand, writes, and inventory
LimbUtil Per-limb health, bleeding, infection, and bone state
SkillUtil Skill levels, XP, global multiplier
ItemUtil World-space item scanning and manipulation
CustomItemRegistry Register custom items with CustomItemBuilder
RecipeBuilder Register custom crafting recipes
CustomLiquidBuilder Register custom liquid types
i18n JSON-driven localization for custom items, buildings, moodles, and free-form strings
SaveCompanionFile Per-instance persistence for custom items without touching the vanilla save format
Multiplayer Compatibility KrokoshaCasualtiesMP bridge: spawn, sync, validation, save dir
EventBus Event-driven mod patterns + GetHandlerCount diagnostics
CommandRegistry Custom developer console commands + scavlib check
GUI uGUI + IMGUI menus
ConfigManager BepInEx config wrappers
ModRegistry Mod metadata, ModSession, and VersionedDependency
Lifecycle System IModLifecycle, world events, and mod callbacks
Changelog Version history

What's New in 0.7.2

  • Multiplayer compatibility (Krokosha MP).​ New compat/krokmp/ bridge fixes custom-item sync, dedicated-server /spawn, and the validation-loop spawn bug. Companion save files automatically follow the active MP save directory. See Multiplayer Compatibility.
  • JSON-driven localization.​ The ScavLib.i18n.LocaleManager API replaces the old ScavLib.locale.LocaleRegistry. Drop a lang/EN.json next to your DLL, call LocaleManager.AutoRegister(...) once in Awake(), and language switches at runtime stay in sync. A TranslationTemplateGenerator produces and incrementally merges template files. See i18n.
  • Save companion files.​ New ScavLib.save namespace lets custom items persist per-instance state in a JSON sidecar — no risk of corrupting the vanilla save format. See SaveCompanionFile.
  • Spawn / registry hotfixes.​ Deferred-Awake clone path in UtilsCreatePatch (custom liquid containers no longer lose their default contents); ledger-first collision check in CustomItemRegistry fixes cross-run re-registration; SetTags() invoked on every custom ItemInfo so Item.Start no longer NREs on Stats.HasTag(...).
  • Build / tooling.​ Target framework upgraded to .NET Framework 4.8 with <LangVersion>latest</LangVersion>.

See the Changelog for the full list and migration notes.


Verifying Installation

After placing ScavLib.dll in BepInEx/plugins/ and launching the game, open the developer console and run:

scavlib status

You should see ScavLib's version, authors, and all registered mods. Mods registered with a lifecycle object are annotated with [F].

For a deeper diagnostic — Harmony patch status, registered command ownership, conflict detection — run:

scavlib check

Clone this wiki locally