[TUTORIAL] How to modify textures.(gwent cards)

+
[TUTORIAL] How to modify textures.(gwent cards)

Requirements:
a)The Witcher 3 :)
b)Lua 5.3.1 and lua_zlib x64 binaries https://github.com/hhrhhr/Lua-utils-for-Witcher-3/releases
c)Lua scripts from: https://github.com/hhrhhr/Lua-utils-for-Witcher-3
d)Offset file unzipper 0.3.6a and e) PackZip 0.3 http://aluigi.altervista.org/mytoolz.htm
f)Gimp 2.8.10+ http://www.gimp.org/downloads/
g)Gimp DDS plugin https://code.google.com/p/gimp-dds/
h)PSPad editor http://www.pspad.com/en/download.php
f)File String Finder v1.4 http://www.shockingsoft.com/FileStringFinder.html

I show you how to change design of gwent cards from DLC.
1)Create folder “tutorial”
2)Create subfolders “lua”,”exported_lua”,”exported_offzip”
3)Copy \The Witcher 3 Wild Hunt\DLC\DLC8\content\texture.cache to “tutorial”
4)Copy (b) “lua.exe”,”lua53.dll”,”zlib.dll” to “tutorial”
5)Copy (d) “offzip.exe” and (e)”packzip.exe” to “tutorial”
6)Copy (c)LUA files to “tutorial/lua”
View attachment 19869
7)Run cmd.exe and go to “tutorial” (http://www.7tutorials.com/command-prompt-how-use-basic-commands)
8)Extract textures with lua script:
D:\tutorial>lua lua/unpack_textures.lua texture.cache exported_lua
9)Extract textures with offzip:
D:\tutorial>offzip -a texture.cache exported_offzip 0
-)I want to change Triss card.
10)Triss card texture is “exported_lua/dlc#dlc8#data#gameplay#gui_new#icons#gwint#neu_triss_dlc.png.(6).dds”
-)Now we need find this texture in “exported_offzip”
11)Run (h)PSPad/File/Open in HEX Editor and open file from step (10)
12)Run (f)String Finder and search for some HEX string from step (11) at “exported_offzip”
-)I tried 384A51FD from line 00130
View attachment 19870


13) Remember name of file which you found. “001b6009.dat”
14) Open /dlc#dlc8#data#gameplay#gui_new#icons#gwint#neu_triss_dlc.png.(6).dds in GIMP.(yes, she is blue…..)
15)Edit. I used sex card from Witcher 1.(don't change size)
16)Colors/Components/Channel Mixer switch Blue with Red
View attachment 19871
17)”Export as” 001b6009.dds to “tutorial” (Compression:None)
18) Run (h)PSPad/File/Open in HEX Editor and open file from step (17)
19) Remove (Ctrl-X) DDS header.
View attachment 19872
20)Save as “001b6009.dat” to “tutorial”
21)Import new texture back to texture.cache
“packzip -o 0x001b6009 -u 001b6009.dat texture.cache”

22)Move texture.cache back to \The Witcher 3 Wild Hunt\DLC\DLC8\content\texture.cache
View attachment 19873

WARNING:





...

6122/9039: gameplay#gui_new#icons#gwint#neu_triss.png
bbca2009 0: 361632-> 548784
...
OK





PackZip 0.3.1
by Luigi Auriemma
e-mail: aluigi@autistici.org
web: aluigi.org

- open input new_cards/bbca2009.gfa
- open output texture.cache
- offset 0xbbca2009
- windowbits 15
- seek offset
- input size 0x00085fb0 / 548784
- compression ZLIB
- output size 0x00058393 / 361363 <--- This size MUST be smaller than number above (from lua script)
- done in 10 seconds





If it is higher, then you damaged texture, which is stored after new texture.
 

Attachments

  • t1.png
    t1.png
    18.1 KB · Views: 796
  • t2.png
    t2.png
    43.3 KB · Views: 1,050
  • t3.jpg
    t3.jpg
    113.8 KB · Views: 894
  • t4.png
    t4.png
    83.1 KB · Views: 882
  • t5.jpg
    t5.jpg
    83.5 KB · Views: 1,472
Last edited:
Don't get parts 11), 12)...
What is the HEX string actually? How do I find it?
In my case it is similar for every texture I open.

ps. Can not post an image because of the "new member" limit, but I am talking about 8-characters word on the very bottom of PSpad interface... this code is similar for every texture in case I put the cursor on the same place of text...

pps. looks like the image was attached anyway

---------- обновленный 01:12 ----------

I think I understood... what I tryied to search for is not a HEX string actually, it was just the line number...
 

Attachments

  • Screenshot_7.png
    Screenshot_7.png
    258.3 KB · Views: 386
Last edited:
Is the Syntax somehow failured? If I follow all to the letter using the LUA Tools, I always get the "No Such File or Directory" message :-/
 
I've done everything but the gwent card picture ingame looks distorted.

EDIT: I made a new file and renamed it 001b6009.dds but this way it doesn't work correctly (you get a corrupted image).
You need to edit the original .dds file.
 
Last edited:
Great tutorial, step-by-step and easy to follow, thanks!!!

Is there a way to run the last command for multiple .dat files (as opposed to one by one)? So that if there are multiple files run a single command and move them back to texture.cache? This one:
packzip -o 0x001b6009 -u 001b6009.dat texture.cache

Thanks
 
Top Bottom