Skip to content

Modding Textures

Tahvohck edited this page Mar 18, 2021 · 1 revision

Extracting and annotating game assets also decodes and explodes the game's textures into library/textures.exploded. The game's original packed textures are written to library/textures.exploded/*.png and the texture regions are written to library/textures.exploded/*/*.png, where the folder name is the texture ID and the filename is the region ID.

Regions definitions can be found in library/textures.xml in <re n="..." /> tags and are used in library/animations.xml by the <assetPos a="..." /> tags.

The loader can overwrite existing textures from the base game and add new ones. To overwrite a texture, simply place a file called 123.png in a directory called textures (where 123 is the id of the texture you want to replace).

To add a new texture, you need to add a <re n="..." t="..." /> entry in library/textures.xml. Textures are packed together in .cim files, which are defined in <t i="..." /> entries. The re entry references the t entry through it's index i. Take care of choosing reasonably unique indexes to avoid conflicts. Once this is done, you can add the 123456.png file to the textures directory.

When loading your mod, the modloader will output the png version of the packed texture file for debugging purposes. This will allow you to check proper placement for new textures, or correct merging for existing ones.

Clone this wiki locally