In this tutorial we'll walk through the steps needed to modify a perk's description. We'll look at how to make these adjustments, and how package these up into a PTF-compliant mod that we can easily publish. The techniques learned can then be applied to any and all Localization changes in KCD2.
Here's what we'll be looking to achieve with this tutorial
If you'd like to grab the final, complete mod and learn by getting hands-on, you can download it Here
1 Finding the localization entries for the perk
2 Making PTF-compliant changes in our own mod
3 Packaging our changes so they're ready to be published
If you're new to Localization and how it works in KCD2, check out this Guide first.
Let's get started.
First of all, we need to decide which perk we want to change. In this tutorial we've chosen the Hard-Working Lad perk, though the exact perk is up to you. Here's the Vanilla description for this perk:
You grew up in a forge where hard work was never in short supply. And you find a certain satisfaction in it.
If you are carrying a sack or even a dead or unconscious body, their weight only counts as a half. Therefore, they are less likely to overencumber you, and carrying them will now not cost you any extra stamina. In addition, your carrying capacity is permanently increased by 8 pounds.
The description for this perk is defined in the text_ui_soul.xml file of each language PAK file. In our case, we're interested in the one inside of English_xml.pak. Let's do the following:
We'll use a relatively long string to increase the accuracy of our search. let's go with:
You grew up in a forge where hard work
Searching for this text leads us to the following row entries:
We can see two rows here that correspond to the Vanilla perk description shown above. Notice that each <Row> object has three child <Cell> objects within it, which are explained in the table below:
Cell 1 | Language-agnostic localization string name |
---|---|
Cell 2 | Language-specific string value |
Cell 3 | Language-specific string value (Fallback) |
For both of these <Row> entries we're interested in the strings in the first cells. We'll use these to override the vanilla description and set our own. Take a note of these for later:
Now we'll set our own custom values for these Localization strings using a mod.
The mod creation process is outside the scope of this guide, and will be covered separately. In this section it is assumed that you have a blank and newly created mod for the changes to be added to. For help doing this, take a look at KCD Mod Generator, which easily creates the initial mod skeleton for you. Alternatively, you can grab an empty mod template Here
Take the following Steps:
For the mod to be PTF-compliant and ensure maximum compatibility with other mods, it is essential that the new file is named in exactly the way described. It must start with text__ (two underscores) followed by the ID of your mod, as specified in the mod.manifest file.
For example, if you have a mod with a Mod ID of my_test_mod, then you would create the following file:
test__my_test_mod.xml
Now for the fun part, adding our own descriptions!
Open the XML file you just created in a Text Editor, and add the following lines to it.
<Table>
<Row>
<Cell>perk_hardworking_lad_lore_desc</Cell>
<Cell>It works! We've overriding the Lore description of the Hard-Working Lad perk</Cell>
<Cell>It works! We've overriding the Lore description of the Hard-Working Lad perk</Cell>
</Row>
<Row>
<Cell>perk_hardworking_lad_desc</Cell>
<Cell>Now we're overriding the regular description</Cell>
<Cell>Now we're overriding the regular description</Cell>
</Row>
</Table>
Feel free to take this opportunity to set the descriptions to something more interesting, and then save the file.
Unfortunately, the game can't read our XML file directly. We need to package it up into a game-ready and valid PAK file. This can easily be done using KCD PAK Builder, and you can find all of the information needed to do it Here.
Note that the PAK file we create needs to have the same name as the Vanilla Localization PAK file that we're overriding, such as English_xml.pak
In our case, we're using the following configuration for PAK Builder
After running the PAK Build, we have a directory and PAK file that looks like this:
That's our mod finished. Now we have one simple task left; the test our changes in the game!
Loading into the game and checking out the Hard-Working Lad perk confirms that our mod has been loaded, and our Perk description applied
Hopefully you've found this information useful and that it enables you to modify other Localization data in KCD2.
Please feel free to leave any comments, suggestions and feedback, and thank you for reading.