Jump to content

How to modify armor/clothing textures


khowder

Recommended Posts

It took me a few days how to modify armor and clothing textures and I am sure there are easier ways, but this worked for me and I thought I would share for anyone who might need help.

 

I tried using the new mod tools, but I havn't figured out how to actually modify anything with them yet.

 

Anyways, here is my guide on how to modify armor and clothing textures:

 

 

1. Tools:
Notepad++
https://notepad-plus-plus.org/
*Notepad++ seems to be best for viewing .xml files, but I think any basic text editor will work
NVIDIA Texture Tools for Adobe Photoshop
https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop
(For other image editing programs, you will just need to find a plugin that can save a file as .dds)

2. Find the item ID for the item that you want to modify:
https://forum.kingdomcomerpg.com/t/item-id-and-in-game-names/48105
The second post in this forum thread has an item_ids.txt that you can download and search the file for keywords from the item that you are looking for. However, this file does not seem to contain all items (see next method).

If the item you are looking for is not in it, you can download the "cheat" mod
https://www.nexusmods.com/kingdomcomedeliverance/mods/106
You can install the "cheat" mod by spraguep and use the in game console command (` key). Use the command cheat_find_items token:[item keyword here] This will give you a list of all found items containing that keyword and their item ids.

3. Find the .dds texture files for the item:
3a. Navigate to your KCD data folder (something like C:\Program Files (x86)\Steam\steamapps\common\KingdomComeDeliverance\Data) Find and copy Tables.pak to another folder (on your desktop or somewhere else). Then extract Tables.pak using a compression tool like winrar, winzip, etc.
3b. This will extract the Tables.pak so you can browse and open the files it contains. Navigate in this new folder to Tables\Libs\Tables\item\armor.xml and open it with Notepad++
3c. Run a search (Search > Find...) for the item ID. This should bring you to the item's entry in this file. In the same row, you should see something like clothing_id="4c3b85bb-8b17-b78d-4f03-d11a1d1a3f94" This is the clothing ID (minus the quotes)

3d. Navigate to Tables\Libs\Tables\item\clothing.xml and run a search for the clothing ID that you just found. What you are looking for in this row is something like material="s1_p2_l3_v012_tx001" This would tell you the name of the .mtl file that you will be looking for next

3e. Now you will need to repeat step 3a, but instead of Tables.pak, you will need one of the Cloth paks. Cloth-part0.pak Cloth-part1.pak and Cloth-part2.pak The material file and the .dds files will be in one of these paks. You can preview what's in the paks using winrar or a similar program, or you can copy all 3 and extract them (takes a bit of time)

3f. Within the cloth paks, find the .mtl file with the same name that you found for the material in step 3d. Something like s1_p2_l3_v012_tx001.mtl Open this file with Notepad++ and it will give you the information for the names of the texture files for the item that you are wanting to modify. You will likely only want to modify the diffuse texture as it's the one that gives color to the items.
Note: this gives the file name for a .tif, but it is the same file name as the .dds files that you need

Diffuse - This is the general texture of an item that makes it look the way it does
Bumpmap - This controls bumps and indents for details such as engraving etc
Specular - This should control the glossiness/shinyness of an item
Environment - I don't know what this one is for
Decal - Blood and what not on the item that can be washed off
Custom - Dings and scratches
[1] Custom - More dings and scratches


4. Convert .dds files to a single .tif file

Copy all of the diffuse .dds files into the SC Texture Converter folder that you extracted it to and run sctexconv_1.3.exe to create a single editable .tif file of the items diffuse texture.
There will likely be several .dds files - .dds, .dds.1, .dds.2, .dds.3 etc. for the example above, there were 8 files for the diffuse texture (s1_p2_l3_v012_tx001_diff.dds, s1_p2_l3_v012_tx001_diff.dds.1, s1_p2_l3_v012_tx001_diff.dds.2, s1_p2_l3_v012_tx001_diff.dds.3, s1_p2_l3_v012_tx001_diff.dds.4, s1_p2_l3_v012_tx001_diff.dds.5, s1_p2_l3_v012_tx001_diff.dds.6, s1_p2_l3_v012_tx001_diff.dds.7)

More information on this process here: https://wiki.nexusmods.com/index.php/Textures_and_Images
The example file was for the item "Cuirass" so all that actually shows up in the diffuse file is the belt for the cuirass. I think this is because metal is handled more through specular than actual texture. However, if you want to change the color of metal, you can still add colors/designs to the area where the armor should be in the diffuse texture. You may have to use the specular or normal map textures as reference to where the armor should be in the diffuse texture.

5. Make your edits to the texture using photoshop, gimp, etc. and save the new file as .dds with the exact name of the original .dds ex: s1_p2_l3_v012_tx001_diff.dds

6. Pack into a mod

6a. Create a folder for your mod (ex: colormod). Inside this folder, create a new text file and create a new folder named Data

6b. inside the text file:

<?xml version="1.0" encoding="utf-8"?>
<kcd_mod>
<info>
<name>[YOUR MOD NAME]</name>
<description>[YOUR MOD DESCRIPTION]</description>
<author>[YOU]</author>
<version>1.0</version>
<created_on>2019-12-29</created_on>
</info>
</kcd_mod>
Save the text file as mod.manifest

6c. Inside your Data folder, create the same structure for the file that you are replacing and put your modified .dds file in it. ex: colormod\Data\Objects\characters\humans\cloth\s1_p2_l3_v012_tx001_diff.dds

6d. Navigate back to your Data folder and compress the new folder that you have added (Objects) Note: Do not use WinRAR to compress the folder, for some reason it doesn't work. The way I have been doing it is to right click > Send to > Compressed (zip) folder

6e. Rename this compressed file to [YOUR MOD NAME].pak ex: colormod.pak Note: I think this has to match what you put in the manifest between <name></name>. ex: colormod.pak to match <name>colormod</name> I havn't tested whether these have to be the same, I thought I read somewhere in a forum post that they have to match, so that's what I have been doing.

6f. Move your mod folder to your KingdomComeDeliverance\Mods folder and you should be good to go.
You can also add the armor.xml file in your mod within its structure if you want to change those color, saturation, and hue values. If you do this, you will need to add a Libs\Tables\item folder structure in your mods Data folder. You will want to delete all the lines between <rows> and </rows> and add just your row line. Save this file as armor__[YOUR MOD NAME].xml 2 underscored so that it modifies the table instead of replacing it, and make sure {YOUR MOD NAME} matches what you have in the manifest. When packing your mod, compress both folders in the Data folder.

 

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...