You might be familiar with my Customizable Starting Equipment mod. Sure, that mod can give you some cool armor, but maybe the color scheme doesn't go with your character's look. That's where this tutorial comes in!
Fair warning: I can't seem to get this method working on every armor/clothing set. Some just don't change color in-game and I'm not sure why.
TUTORIAL (PLEASE READ):
The file download for this mod contains two sets of folders, one titled "FILES TO EDIT" and the other "Public". The files you will be editing are located in separate folders inside the "FILES TO EDIT" folder series. Now, depending on what armor/clothing set you want to recolor, whether it is classified as armor or clothing, or what gender you'll be playing, you need to edit different files. The files are located in the following folders:
Female Armor
Female Clothing
Male Armor
Male Clothing
Inside each of these folders is a DIFFERENT "_merged.lsx" file. DON'T MIX THEM UP! Their contents are entirely different, despite having the same name. I'd recommend using Notepad++ to open them.
Now, I'm going to be modifying the female breastplate armor set, so it turns from a blue/cyan color to red, as shown in the image section. For that, I'd need to edit the female armor "_merged.lsx" file, so I'm going to open that in Notepad++.
When you open one of the files, it's going to be a super long mass of code. Don't worry! As long as you know the name of the armor/clothing you want to edit, you can find the right section in the file with the ctrl+f search function. I'm modifying the breastplate, so I'm going to type that into the search bar. If I click the option "find all in current document" the Notepad++ window will split in half so there's a new section on the bottom. These are our search results, shown in that bottom section! The entries we care about start with "<attribute id="Name"", so here are those entries, which are the first listed in the search results:
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_0_Body" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_1_Body" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_2_Pants" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_0_Pants" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_1_Pants" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_2_Body" />
(Note: Now, there may be some more entries that look identical to the ones listed, but extend with a "_" and then some capitalized letters. Those have to do with the textures I'm pretty sure, and aren't what we're looking for, so don't worry about those.)
Now, we can see the different versions of the breastplate armor listed here as versions 0, 1, and 2. I want to edit version 2 because that's the version of that armor I think looks the coolest, so the entries I care about are:
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_2_Pants" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_2_Body" />
As an example, let's start by working on the "HUM_F_ARM_Breastplate_A_2_Body" entry. I'm going to double click on that entry in the search results, and it will automatically jump to that section in the top half of the window. What I'm going to now see is this paragraph:
<node id="Resource">
<attribute id="ID" type="FixedString" value="ea92c0cb-3584-f25d-77ee-81497879a596" />
<attribute id="Localized" type="bool" value="False" />
<attribute id="MaterialType" type="uint8" value="44" />
<attribute id="Name" type="LSString" value="HUM_F_ARM_Breastplate_A_2_Body" />
<attribute id="SourceFile" type="LSWString" value="Public/Shared/Assets/Materials/Characters/CHAR_BASE_VertCut.lsb" />
<attribute id="_OriginalFileVersion_" type="int32" value="1073741872" />
<children>
The details will change when you're editing your own sections of these files, but the basic format should look like this.
Now, the sections I want to edit are listed below this entry. So I'm going to scroll down, past the "ScalarParameters", the "Texture2DParameters", and the "Vector3Parameters", until I see just "VectorParameters" at the top of one of the paragraphs. What we've just found is the code for the cloth colors, which should look something like this:
<node id="VectorParameters">
<attribute id="Enabled" type="bool" value="True" />
<attribute id="GroupName" type="FixedString" value="02 Colour" />
<attribute id="IsColor" type="bool" value="True" />
<attribute id="ParameterName" type="FixedString" value="Cloth_Primary" />
<attribute id="ShaderFlags" type="int16" value="79" />
<attribute id="UniformName" type="FixedString" value="Vector4Parameter_Cloth_Primary" />
<attribute id="Value" type="fvec4" value="0.2083596 0.373615 0.4704402 1" />
</node>
<node id="VectorParameters">
<attribute id="Enabled" type="bool" value="False" />
<attribute id="GroupName" type="FixedString" value="02 Colour" />
<attribute id="IsColor" type="bool" value="True" />
<attribute id="ParameterName" type="FixedString" value="Cloth_Secondary" />
<attribute id="ShaderFlags" type="int16" value="79" />
<attribute id="UniformName" type="FixedString" value="Vector4Parameter_Cloth_Secondary" />
<attribute id="Value" type="fvec4" value="0.1701384 0.04614884 0.04614884 1" />
</node>
<node id="VectorParameters">
<attribute id="Enabled" type="bool" value="False" />
<attribute id="GroupName" type="FixedString" value="02 Colour" />
<attribute id="IsColor" type="bool" value="True" />
<attribute id="ParameterName" type="FixedString" value="Cloth_Tertiary" />
<attribute id="ShaderFlags" type="int16" value="79" />
<attribute id="UniformName" type="FixedString" value="Vector4Parameter_Cloth_Tertiary" />
<attribute id="Value" type="fvec4" value="0.07176144 0.06190747 0.1061561 1" />
</node>
<node id="VectorParameters">
<attribute id="Enabled" type="bool" value="True" />
<attribute id="GroupName" type="FixedString" value="02 Colour" />
<attribute id="IsColor" type="bool" value="True" />
<attribute id="ParameterName" type="FixedString" value="Accent_Color" />
<attribute id="ShaderFlags" type="int16" value="79" />
<attribute id="UniformName" type="FixedString" value="Vector4Parameter_Accent_Color" />
<attribute id="Value" type="fvec4" value="0.1869885 0.8993845 1 1" />
</node>
In order, each paragraph is "Cloth_Primary", "Cloth_Secondary", "Cloth_Tertiary", and "Accent_Color". You'll notice each of these paragraphs ends with a series of decimals. Those are actually the RGB color codes!
Now comes the really not fun part. In order to figure out which of these colors is actually which on the armor, we're gonna have to do some math. Luckily, this isn't a test, and you can use a calculator! I sure did.
Take the "Cloth_Primary" sections RGB code. It's "0.2083596 0.373615 0.4704402 1", meaning "0.2083596" is red, "0.373615" is green, and "0.4704402" is blue. We're going to take each of these numbers, one by one, and multiply each one by 256. Basically, your math should look like:
0.2083596 x 256 = 53.3400576 (red)
0.373615 x 256 = 95.64544 (green)
0.4704402 x 256 = 120.4326912 (blue)
Take the numbers after the decimals off your results, and plug those new RGB values into a RGB color picker, either online or in some kind of image editing software or something. Then compare that color with the appearance of the armor. Is this a color we want to replace or not? (Note: the color we get from the RGB code is darker than the color we see in game, which is much brighter)
In my case, this looks to be the blue/teal color I wanted to replace with red, so I am going to replace this value in the code. So, first things first... I need to pick a new shade to work with (keeping in mind that it needs to be darker than I want). I went with "153, 0, 0" as my new RGB values. Now I need to convert that to decimals, which I will do by individually dividing each value by 256 (In this case I only need to do this with the 153 value because you can't divide zero):
153 / 256 = 0.59765625 (red)
This makes my new RGB code "0.59765625 0.00000000 0.00000000 1"! So now I'm going to go back to the "Cloth_Primary" sections RGB code, and replace the existing code with mine. So it will look like:
<attribute id="Value" type="fvec4" value="0.2083596 0.373615 0.4704402 1" />
change into:
<attribute id="Value" type="fvec4" value="0.59765625 0.00000000 0.00000000 1" />
Congrats! We have just changed our first color code! However, our work is not yet done. There are still the "Cloth_Secondary", "Cloth_Tertiary", and "Accent_Color" values to check and see if they need to be changed. Plus, if you want, you can scroll past these cloth entries and find the leather and metal color codes to modify as well. Not to mention, this was only for the "HUM_F_ARM_Breastplate_A_2_Body" entry. The "HUM_F_ARM_Breastplate_A_2_Pants" entry still needs to be checked and possibly modified this way as well. Luckily the method I just showed you should have taught you how to edit each of those sections.
This tutorial is already getting pretty long, so I'm not going to walk you through modifying ALL those values, so I'm going to skip ahead. Once you are finished modifying the color codes to your hearts content, save your modified file somewhere. Make sure it has the .lsx file extension still!
This next step requires a tool: Norbyte's lslib tool to be exact. We're going to be converting that .lsx file you modified into a .lxf file, which is the format the game expects it to be. Once you've downloaded Islib, run the ConverterApp.exe. This new window will, at the top, have the word Game: and then a drop down menu. I'm using version 1.15.1, which if you are as well, you want to select Divinity: Original Sin 2 DE (64-bit) in that drop down menu. I know that makes no sense, considering we're modding Baldur's Gate 3, but whenever I selected Baldur's Gate 3 in the drop down menu and converted a file to .lxf, it wouldn't work in the game. It's possible this has been fixed with the newest version of Islib, so you might want to try it with Baldur's Gate 3 selected if you have a newer version and see if it works, but I figured I'd warn you all so there isn't any issues.
Moving on! Below the drop down menu there are tabs. The one we care about, and the one you want to click on, is titled "LSX / LSB / LSF / LSJ Tools". Once you're in that tab, the first thing listed should be "Convert LSX / LSB / LSF / LSJ files", with an input file path and an output file path. This is the function we're going to use.
Next to each path, there is a "..." button. Click the one next to the input path first, and this should open a file browser. Navigate to your modified "merged.lsx" file and select it. The path to the file should now be displayed in the input file path. Now, for the output file path! Click on the "..." button next to the output path, but this time I want you to navigate to the folders you downloaded for this mod... specifically the "Public" set of folders. If you go deeper in that folder path, you will find four folders starting with "[PAK]". The folder you want to save this file to depends on what "_merged.lsx" it is you modified. If you modified the female armor "_merged.lsx", then this new file will go in the "[PAK]_Female_Armor" folder, and so on and so forth. Navigate into the folder you need, and then type into the file name bar ""_merged.lsf". Then click save. This should update the output file path with your new file path!
Once you have the paths figured out, click the "Convert" button, and you should get a pop-up saying the conversion was a success. You can now close the Islib window! All that's left to do is navigate back to the top "Public" folder, and copy that folder into your "Data" folder in your Baldur's Gate 3 installation directory. If you followed these instructions correctly and the armor/clothing you modified is in fact tintable, then you should see your changes in game! Good luck!
来源与文件
文件说明
Base files for editing. Please follow instructions in the description!
前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:baldursgate3:48 -->