Sprite additions
Ship a new Sprite asset and reference it from a template clone. Common use case: a cloned weapon, item, or skill needs its own icon.
Workflow
Drop a PNG or JPG under
assets/additions/sprites/. The path under that directory (with the extension stripped) is the asset's runtime name. Subdirectories are allowed and encouraged for organisation.textassets/additions/sprites/lrm5/icon.png assets/additions/sprites/lrm5/icon_equipment.pngReference each asset from a template clone:
kdlclone "ModularVehicleWeaponTemplate" from="mod_weapon.medium.rocket_launcher" id="mod_weapon.light.rocket_launcher_lrm5" { set "Icon" asset="lrm5/icon" set "IconEquipment" asset="lrm5/icon_equipment" }Compile. The compiler verifies each
asset="..."resolves to a real file and packs the sprite into the mod's bundle.
File layout
assets/additions/sprites/<logical-name>.<ext><ext> is .png, .jpg, or .jpeg. The basename (with subdirs, without extension) is the logical name the modder writes in KDL.
Two files sharing the same logical name with different extensions in the same folder (icon.png and icon.jpg) are a hard compile error.
Authoring at the right size
There's no atlas compositing for additions. The Sprite is created from the full PNG, with the pivot at (0.5, 0.5) and a default pixelsPerUnit of 100. Author the file at the size you want the icon to render in-game.
If you're starting from a vanilla asset to use as reference, export it as a texture first:
jiangyu assets export texture <vanilla-name> --output assets/additions/sprites/my-icon.pngStudio workflow
- Open the Asset Browser pane.
- Find the vanilla asset you want to start from.
- Click Export to pull the pixels out, save under
assets/additions/sprites/<your-logical-name>.png. - In the Visual Editor, open the clone you want to attach it to. The asset-typed field shows an Asset kind chip and a path input. Type your logical name (
lrm5/icon). - Compile.
Compile-time errors
Compile refuses the build, with a clear message, when:
- An
asset="..."reference doesn't resolve to a file underassets/additions/sprites/. - Two files share the same logical name with different extensions.
- The destination field's declared Unity type isn't
Sprite. The sameasset="..."syntax works for textures and audio (with the appropriate Unity field type), since the category is inferred from the field rather than stated in KDL.