Additions
An addition ships a brand-new asset in your mod and lets a template clone reference it by name. Use additions when a cloned item, weapon, or skill needs its own visual or audio identity that doesn't exist in the vanilla game.
The modder workflow is:
- Drop the asset file under
assets/additions/<category>/<name>.<ext>. - Reference it from a template clone with
set "FieldName" asset="<name>". - Compile and ship.
File layout
assets/additions/
sprites/
textures/
audio/
prefabs/ (also produced by unity/ batchmode build)Each category folder is walked recursively. The asset's runtime name is its path under the category folder, with the extension stripped. So assets/additions/sprites/lrm5/icon.png becomes a Sprite referenced as asset="lrm5/icon".
Forward slashes (/) in the reference mirror the folder layout. Use them whenever you want to organise files by feature, weapon family, or any other grouping.
KDL syntax
clone "ItemDefinition" from="pen" id="fancy-pen" {
set "Name" "Fancy Pen"
set "Icon" asset="lrm5/icon"
}The category is inferred from the destination field's declared Unity type. Icon on ItemDefinition is a Sprite, so the compiler looks for the file under assets/additions/sprites/. You don't have to repeat the category in the KDL.
Supported categories
| Category | Field types | Page |
|---|---|---|
| Sprite | UnityEngine.Sprite | Sprites |
| Texture | UnityEngine.Texture2D | Textures |
| Audio | UnityEngine.AudioClip | Audio |
| Material | UnityEngine.Material | (no dedicated page) |
| Prefab | UnityEngine.GameObject, List<UnityEngine.GameObject> | Prefabs |
Compile-time checks
The compiler walks assets/additions/ once at build time and verifies:
Every
asset="..."reference resolves to a real file under the inferred category folder. Missing files fail the build with the expected path:textTemplate patch '...': asset="lrm5/icon" was not found at assets/additions/sprites/lrm5/icon.<ext>. Add the asset file or correct the reference name.Two files in the same category folder don't share the same logical name with different extensions.
assets/additions/sprites/icon.pngandassets/additions/sprites/icon.jpgare a hard error: the runtime can't disambiguate by name.The destination field's declared Unity type is a supported asset class.
asset="..."on astringor numeric field is rejected with a clear message.
Runtime resolution
At apply time the loader walks the mod's bundle catalog first, then falls back to the live game-asset registry filtered by name. Bundle hits win on collision: a modder shipping assets/additions/sprites/cocaine.png overrides the vanilla cocaine sprite for any clone that references asset="cocaine", while leaving the vanilla item using its original sprite.
Backslashes are not allowed
KDL asset="..." must use forward slashes only:
set "Icon" asset="lrm5/icon" // good
set "Icon" asset="lrm5\\icon" // rejected at parse timeThe compiler walks the filesystem with native separators (so Windows authors don't need to do anything special on disk) but the authored KDL stays portable.