[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:
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:
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
You can save it as mynewicon.png with the same folder path and refer to it in xml files as
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.
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
means that the original texture path was:gameplay#gui_new#icons#inventory#potions#black-blood-64x64.dds
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
Last edited: