DawnLibExperimental

版本 v1.0.9·更新於 2026-09-22

An experimental release of DawnLib, the modern API for Lethal Company content and all sizes of mods [V81]

模組介紹 作者原文

DawnLib

(was CodeRebirthLib)

DawnLib is a modern API for Lethal Company content and all sizes of mods. It contains:

  • DawnLib API
  • Moons
  • Interiors
  • Weathers
  • Terminal Commands
  • FootstepSurfaces (With gravity control)
  • Enemies
  • Items
  • Map Objects (Inside and Outside hazards)
  • Unlockables (Ship Upgrades and Furniture)
  • Additional Tile Sets (injecting more tilesets to interiors)
  • Dead Bodies
  • Round Loading Steps
  • DuskMod API
  • Ship Creation (In-progress)
  • Achievements
  • Entity Replacements (Enemy, Item, Unlockable and MapObject skin replacements)
  • Vehicles (Highly experimental)
  • Some extra utilities
  • SmartAgentNavigator (completely intelligent NavMeshAgent navigator that uses PathfindingLib to performanently be able to use entrance teleports and fire exits reliably).
  • NetworkAudioSource
  • And more!

DawnLib also categorises (almost) everything in the game with keys, allowing for easy references to existing vanilla content.

If you'd like to support in the development of DawnLib, please consider reaching out to @xuxiaolan on discord, whether through the modding discord, github, or just

pinging on the lethal modding discord, we accept any sort of help, UI, Coders, Artists, etc.

NOTE: Enemies/Items/etc managed through DawnLib are likely _unsupported_ by mods like CentralConfig or LethalQuantities.

This is because of the way DawnLib supports dynamically updating weights and therefore cannot be fixed from DawnLib.

For this, DawnLib has collaborated with the creator @Crafty that made the mod LunarConfig which does super similar functionality and gives the user a lot of control!

DawnLib (All C#)

DawnLib is a hands-off way to register your content. The code to switch from LethalLib to DawnLib is very similar and will require minimal refactoring.

Most registration methods are under the DawnLib static class. When calling DefineXXX you are provided with a builder method that

explains most settings that you can configure.

Example:

public static class MeltdownKeys {

public static readonly NamespacedKey GeigerCounter = NamespacedKey.From("facility_meltdown", "geiger_counter");

}

// In your plugin

DawnLib.DefineItem(MeltdownKeys.GeigerCounter, assets.geigerCounterItemDef, builder => builder.DefineShop(shopBuilder => shopBuilder.OverrideCost(90).OverrideInfoNode(assets.geigerCounterNode)

)

);

LethalContent is an easy way to reference vanilla/modded content:

EnemyType blobEnemyType = LethalContent.Enemies[EnemyKeys.Blob].EnemyType;

It should be noted that the vanilla references will not be in the registry until a while after the lobby is created.

In order to make sure everything is ready, you can listen to a registry's "freeze" event.

OnFreeze will only run once _ever_ (even between lobby reloads)

LethalContent.Enemies.OnFreezeWithContext += (NamespacedKeyResolver resolver) =>

{

// All vanilla content is in and no more modded content can be added.

};

if (LethalContent.Enemies.IsFrozen)

{ // or check that the registry has already been frozen

//...

}

PersistentDataContainer

PersistentDataContainer is an alternative to ES3. You can easily access save data with the.GetPersistentDataContainer() extension method,.GetCurrentContract() or.GetCurrentSave()

void Awake() { // Plugin awake

PersistentDataContainer myContainer = this.GetPersistentDataContainer(); // use this however you want, note that 'this' is required to use the extension method in the Awake function.

// these only return null when not in-game. these also automatically handle resetting the save

PersistentDataContainer? contract = DawnLib.GetCurrentContract(); // resets on: getting fired and save deletion.

PersistentDataContainer? save = DawnLib.GetCurrentSave(); // resets on: ONLY save deletion.

}

Note: If you are going to make a large edit (calling.Set,.GetOrSet, etc multiple times) you should wrap it with using(container.CreateEditContext()). This delays saving data to the disk until all your edits have been compl

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

Evaisa-FixPluginTypesSerializationZaggy1024-PathfindingLibHamunii-AutoHookGenPatchermattymatty-MonkeyInjectionLibraryBepInEx-BepInExPack

檔案與校驗

檔案名稱
DawnLibExperimental-1.0.9.zip
檔案大小
951.2 KiB