Tuesday 23 October 2012

Witcher 2 Texture Swaps


Introduction


This is a quick guide for anyone who wants to swap the texture of one item of Geralt's clothing (armour, boots, trousers, gauntlets) for another. This is something you would do if you like the visual appearance of one item, but for some reason you're equipped with another. (Maybe because you prefer the stats, or because the nice-looking item isn't available to you). So if, for example, you like the look of Thyssen armour, but want to use the stats of Vran, this will give you a Vran armour that looks like Thyssen. I'll use this particular change as the example in the instructions below.

The base instructions work for everything except the original DLC items (Blue-Stripes Armour, Herbalist Gloves, Mage Pants). They're a little more complicated because the game stores the data in a different way, so there's separate instructions for changing them to look like something else. The base method works for the later DLC, such as the Dark Mode items.

Edit: If you're also using Kindo's CEO mod, you can use the standard method for changing the original DLC files too, as Kindo merged the data into the main files.

TW2 has a folder called CookedPC. This is in your main program directory where the game itself is and is NOT the one where the gamesaves are. The folder should already exist - if you don't know where it is, do a search.

Sometimes the files get changed when the game version is updated. You will need to re-do the mod on the latest version of the files when that happens.

Texture swap mods are made to xml files. These are stored in the CookedPC folder either as the xml files themselves, or in a compressed format (dzip). When the game loads, it only unpacks the dzip files if the xml isn't there, so a mod will usually be in xml format. To remove a mod, you just need to remove the xml file, and the game will go back to using the original dzip version.

If you're using other mods that change the same files, you can probably keep them both going. Just make the change to the modded xml file instead of to the vanilla version. But if you're using a complex mod that is in dzip format, your texture mod will override it, so you may get strange things happening. I'm NOT covering how to deal with this, so don't ask.

Getting the XML files - The Easy Way


If you just want to do a quick mod and don't want to get into modding, the easiest way to get the xml files you need is from an existing mod. Find a mod at a site such as The Nexus that changes items in the same category (armor, pants, whatever) and is for the same game version, and download that to use as your base file. (Blatant self-promotion - use the "Extras" files from my Santa Witcher mod, without installing the base mod itself)

Download the files and put them somewhere while you work on them.

Getting the XML files - The Full Set


Use this if you can't find the xml files you need, or if you're planning to do a lot of mods, or if you're planning to change the DLC mods, or any other reason why you prefer to start with a clean set. This involves extracting the files from the game, and takes time and a fair amount of space if you do the full set. But you only have to do it once for each version of the game.

You'll need either the Gibbed RED tools or QuickBMS to do the extraction from the main data files (pack(0).dzip). I'd recommend QuickBMS as it's the easier to use, There are instructions on how to get it, and how to use it at the Gog forums. Warning: Do NOT extract to your program folder. The total set of files extracted can be huge.

Making the Change


1. Find the xml file you want to change. If you used QuickBMS, they'll be in the "items" folder with names starting def_item
(Example: items/def_item_armour.xml)

2. Make a backup before you go any further.

3. Right-click on the file and select to edit it using Notepad (Do NOT left-click as this will probably open it in the browser).

If you want to change your armour to look like Blue Stripes, you can skip the next three steps, because you won't find it. The equipment template value for Blue Stripes is"30_dlc_roche_armor" and the belt value is "belt_5".
Now jump straight to #7.


4. Each item in the category starts with the tag <item name=, so search for this to try to find the one that matches your desired item, i.e. the one that you want it to look like. So for my example where I want to change Vran to look like Thyssen, I'll be looking for Thyssen. Most of the time, you'll be able to work it out from the description, but there are some cryptic ones (for example, "Tentadrake" is actually "Kayran Carapace"). You can also try searching for the in-game name, but this doesn't always work.
(Example: <item name="Thyssen Armor")

5. When you find the destination item, find the value for equip_template and copy what's inside the quotes
(Example: copy 19_thyssen_leather)

6. If you're changing armour, I recommend you also take note of the value for the belt, which will a couple of lines lower down in tags, such as <item>belt_4</item>. You'll probably want to change this too so that it matches the armour. If you're changing a sword, look for the scabbard value (e.g. <item>scabbard_silver</item>) and take a note of that too.

7. Find the item that's actually equipped, the same way, then paste over the equip_template value.
(Example: paste over the top of 31_vran_armor)

8. For armour and swords, replace the text for the belt or scabbard with the one you took note of a couple of minutes earlier.

9. Save the file.

10. Copy it into the CookedPC/items folder in your main program directory. You may need to create the items folder if it doesn't already exist.

11. Play and enjoy.

Replacing the DLC textures


This applies only to the Blue Stripes Armour, Herbalist Gloves and Mage Pants, as these aren't in the def_item files. For the Dark Mode items, the method described above works.

1. Use the QuickBMS method to extract the content of the DLC file you want to change. The dzip file is
roche_jacket.dzip for Blue Stripes Armour
alchemy_suit.dzip for Herbalist Gloves
magical_suit.dzip for Mage Pants

2. Follow steps 1-6 from "Making the Change" to get the name of your desired armour (for example, if you want to change Blue Stripes to look like Raven, you'll be picking up "16_ravens_leather")

3. Edit the dlc file by right-clicking on the extracted xml file and using notepad.

4. Change the equip_template value to match. If you're changing the armour, change the belt value too.

5. Save the modified xml file.

6. Copy to the correct location. You'll almost certainly need to create the subfolders (CookedPC will already exist)
Armour - CookedPC/game/dlc/roche_jacket/roche_jacket.xml
Gloves - CookedPC/game/dlc/alchemy_suit/def_herbalist_gloves.xml
Pants - CookedPC/game/dlc/magical_suit/def_item_unique_pants.xml

Again, to uninstall just remove the file from CookedPC.

What you can't do


You can use this method to make a "Normal" item look like its Dark Mode equivalent, but you can't use it to get the full Dark Mode stats in an Easy/Normal/Hard/Insane mode. The game engine recognises the Dark Mode items as such and will still unequip them if you're in the wrong mode, regardless of what they look like.

In theory, you can use this method to make a sword look like a secondary weapon, such as a pickaxe or the succubus staff, but they're still carried in scabbards so you may not like the results. Most of the secondary weapons are in items/geralt/geralt_secondary_wepons (no, that's not a typo)

The hard-to-find names


Blue Stripes - 30_dlc_roche_armor and belt_5 (Doesn't appear in the file)

Kayran Carapace Armor - 17_tentadrake_leather and belt_2 (Called tentadrake in the file)

Hunter's Amor - 10_shiadhal_jacket and belt_3 (Called "Unique Jacket 1" in the file)

The Dark Mode items all have names like Dark Difficulty Armor A1 (i.e. Dark Mode for Chapter 1)

8 comments:

  1. Is there a way to swap textures from one dark difficulty armor set and swords to another dark difficulty armor set and swords, by using REDKit?

    ReplyDelete
    Replies
    1. I've never used REDKit, so can't advise on that. The method I described doesn't require REDKit.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Hey I cannot find any tutorial on QuickBms, when I run exe file I don't know what script or plugin to use or where it even is.

      Delete
    4. Found the tutorial, nevemind.

      Delete
    5. Sorry, it's a long time since I did this. There used to be instructions over at GOG, they should still be there. Failing that, use the instructions given in "Getting the XML files - The Easy Way", it still works.

      Delete
    6. Instructions aren't too much clear for me. I have QuickBMS working, pack0.dzip is extracted, only thing I need is to know what specific line to change in the file for both armor (including gloves, pants and boots) and sword (silver and steel).

      Delete
    7. Figured it out, everything works.

      Delete