[HOW-TO] Unpacking texture.cache files

+
[HOW-TO] Unpacking texture.cache files

THIS GUIDE IS OUTDATED!
NOW YOU CAN USE CACHE READER INSTEAD OF LUA TOOLS.


For some reason wcc does not handle all ingame textures, some part of them (for example, inventory icons) are stored in texture.cache files only. So, if you want to extract it this guide is for you.

While creating this guide I found that you do not need to install full Lua 5.3 binaries because lua531_lua_zlib_x64.zip contains neccessary minimal libraries setup.

Requirements:
Windows OS 64-bit

Required downloads:
Altogether you should have three archives: lua531_lua_zlib_x64.zip, Lua-utils-for-Witcher-3-bin.zip and unpack-textures-bat.zip


Let's do it:

1. Create a new folder where you wanna store all Lua libs. In this guide I'll use the next path: D:\Lua

2. Unpack lua531_lua_zlib_x64.zip to D:\Lua

3. Unpack unpack-textures-bat.zip to D:\Lua

4. Open Lua-utils-for-Witcher-3-bin.zip, then open Lua-utils-for-Witcher-3-bin folder and extract its content to D:\Lua (not the folder itself!)


Now your Lua folder should look like this:



5. Create a new folder where you wanna store all unpacked textures. In this guide I'll use the next path: D:\Unpacked

6. Goto D:\Lua, open unpack-textures.bat with Notepad or any other text editor and change the path to W3 folder (line 1) and to destination folder (line 2).
Make sure that you do not have the slash at the end of the first line!

With my setup I have this values:
set W3PATH=c:\Steam Games\steamapps\common\The Witcher 3
set UNPACKPATH=d:\Unpacked

This bat-file unpacks all W3 and HoS texures but not from DLCs. You can add or remove any commands according to your wishes, For example, if you also want to unpack textures from DLC1, copy-paste the line 19 and change it to:
lua.exe unpack_textures.lua "%W3PATH%\DLC\DLC1\content\texture.cache" "%UNPACKPATH%"

7. Run the unpack-textures.bat . If you did all things right you will see something like this:

Now you can take a break for about 15-30 mins (depends of chosen cache files amount). At the end ot the process you'll see "All operations completed message".

8. Keep in mind that script dumps all textures as a dds files and puts them into the same folder at that its filenames contains relative path to file where slashes replaced with # symbols. Example: filename
gameplay#gui_new#icons#inventory#potions#black-blood-64x64.dds
means that the original texture path was:
gameplay/gui_new/icons/inventory/potions/black-blood-64x64.dds

You can save it as mynewicon.png with the same folder path and refer to it in xml files as
icons/inventory/potions/mynewicon.png

9. Done.

The process is a bit complicated, but I didn't find an easier way and don't know if it exists :)
Tested on Win10 x64. Credits to Lua-utils-for-Witcher-3 author and some peeps from Nexus forums.
 

Attachments

  • screen2.png
    screen2.png
    16.3 KB · Views: 1,146
  • screen1.png
    screen1.png
    69.9 KB · Views: 1,419
Last edited:
@RivenII thx for fast reply...

I dont know nothing about forum structure but isit possible to create kind of subforum where every tutorials threads are located?
 
The process is a bit complicated, but I didn't find an easier way and don't know if it exists :)
Tested on Win10 x64. Credits to Lua-utils-for-Witcher-3 author and some peeps from Nexus forums.

Hell yeah...
So I stitched together a "little" Autohotkey-Script to make things a bit easier.
Note that it's still in early alpha, but it seems to work (at least for me...)
I included the compiled script for those who haven't installed Autohotkey and the uncompiled for those who have and wanna play around with it ;D.

View attachment 27906
 

Attachments

  • Witcher3GUI.zip
    504.2 KB · Views: 429
Last edited:
Hi. I googled for my problem and it brought me here. Is this metod still working? I want to uncook the icons not from a game but from a mod(promotional and trailer swords). I read carefully but the file for the bat is dead. Maybe I can create it myself? Some advice please
 

Guest 3841499

Guest
Cache Parser does not seem to unpack full-quality texture files... Does this LUA tool unpack full quality texture files?
 

Guest 3841499

Guest
I am trying to extract DDS textures from texture.cache-stand-alone mod, but the ones I get from Cache Reader/Parser are not of the original quality... This method is complex - I get confused with bats and paths and etc...Can I just place texture.cache in same directory as LUA and run a single command to have texture.cache extracted then and there?
 
Top Bottom