Extracting The Witcher 2 files

There are several useful files in the folder such as "..." these files contain all of the text, journal, dialogue, quest, character, attribute, skill entries. The first 2 letters of the filenames indicate the language version.
To extract the information, first off use Gibbed Red Tools to decode them then view/edit them with a editor such as Notepad++. It's easy, but the file structure is a little different than a simple file.
For images, the extracted files are mostly in the folder, in format, so a program which can open this format and convert them to is useful. One such free program is GIMP.
== Step by step guide ==
Written by JPulowski
First off let's take a look at basic file types:
Extension	Type 	Contains
.w2strings	string file 	Text
.w2ent 	entity file 	Models, miscellaneous...
.dds 	DirectDraw Surface 	Textures, images
.dzip 	archive file 	Game files
.xbm 	X BitMap graphic file 	Textures, images
.xml 	Extensible markup language	Item and character attributes, miscellaneous...
.swf 	Shockwave Flash Object 	Images, HUD, animations...
.usm 	Scaleform GFX Player file 	Video
.ws 	script 	Game machanics, behaviors, etc...
=== Requirements ===
*Gibbed Red Tools
*Text editor (Notepad, Notepad++)
*Image editor (GIMP, Adobe Photoshop)
**NVIDIA Texture Tools for Adobe Photoshop
**GIMP DDS Plugin
*Windows Texture Viewer
*QuickBMS
**The Witcher 2 Texture Converter
=== Unpacking .dzip files ===
In order to unpack .dzip files, first off all make sure you've downloaded Gibbed Red tools. In this tutorial, we are going to unpack pack0.dzip file which contains all of the game files in itself.
*Open up Command Prompt. (Start › Run... › Open: cmd › OK / ⊞ Win + R › Open: cmd › OK)
*Locate which is usually located in .
*Drag to Command Prompt or write
**For 32-bit: 
**For 64-bit: 
*to Command Prompt.You should see something like this on Command Prompt:
*If you hit ENTER, you'll see options:
Usage: Gibbed.RED.Unpack.exe [OPTIONS]+ input_dzip [output_dir]
Options:
 -o, --overwrite overwrite existing files
 --cdkey=VALUE cdkey for use with DLC archives
 (in format #####-#####-#####-#####)
 -e, --extension=VALUE only extract files of this extension
 -h, --help show this message and exit
*Locate which is located in folder in The Witcher 2 game directory.
*Drag to Command Prompt but make sure there is a space between two directories or you'll get an error message. For instance:
:WRONG:
:"C:\Program Files (x86)\Gibbed's RED Tools\Gibbed.RED.Unpack.exe""C:\Games\GOG.com\The Witcher 2\CookedPC\pack0.dzip"
:RIGHT:
:"C:\Program Files (x86)\Gibbed's RED Tools\Gibbed.RED.Unpack.exe" "C:\Games\GOG.com\The Witcher 2\CookedPC\pack0.dzip"
*Locate your output directory which must be located outside of the game directory or you may have some issues when playing the game. For instance I've created a folder named outside of the game directory. Create a new folder, name it as you wish. Then drag the folder to Command Prompt. And make sure there are spaces between three directories. So the final result must be something like this:
:"C:\Program Files (x86)\Gibbed's RED Tools\Gibbed.RED.Unpack.exe" "C:\Games\GOG.com\The Witcher 2\CookedPC\pack0.dzip" "F:\Witcher2Output"
*Hit ENTER and wait until all of the files has been extracted it may take several minutes depending on your computer and numbers of the files that it is getting extracted.
*After all of the files has been extracted, you may close Command Prompt.
*Now if you open up your output directory, you may see all of the files that has been extracted from .
=== Editing/Viewing texture files ===
There are two types of textures:
*.dds — DirectDraw Surface
*.xbm — X BitMap graphic file
DirectDraw Surface files usually contain 2D textures such as icons but also some of them contained in *.xbm files, the ones that contained *.xbm files contains model textures
X BitMap graphic files contain model *.dds texture files and *.bin files which is needed to convert back *.dds files to *.xbm files.
Let's start with simple *.dds files. For viewing purposes only you may use Windows Texture Viewer. It's a simple program designed for viewing DirectDraw Surface files. After downloading the *.rar file, extract its contents to any folder you wish. For making things easier, you may associate *.dds files with Windows Texture Viewer.
You may find *.dds files at these locations:
*
*
*
Now let's try to open a *.dds file with Windows Texture Viewer. Locate folder: ... then try to open one of the texture files. I chose to open which is Geralt's in-game journal image. If you've already associated *.dds files with Windows Texture Viewer then double click to any *.dds file. If you didn't associate them with Windows Texture Viewer then open up Windows Texture Viewer (WTV.exe) and drag one of the files to Windows Texture Viewer. Now you may see *.dds file. Pink areas show transparent areas in image. If you don't see any pink areas, press A to see alpha channel.
If you'd like to edit textures, you need to have an image editor such as GIMP or Adobe Photoshop with DDS plugin. (See requirements section.)
=== Editing/Viewing .w2strings files ===
*.w2strings can be found in folder.
*.w2strings files contain all of the in-game text files such as journal entries, character names, item names, item descriptions etc.
In order to view them, first they must be decoded using Red Tools.
Languages:
Name 	Lang.
cz0.w2strings	Czech
de0.w2strings	German
en0.w2strings	English
es0.w2strings	Spanish
fr0.w2strings	French
hu0.w2strings	Hungarian
it0.w2strings	Italian
pl0.w2strings	Polish
ru0.w2strings	Russian
zh0.w2strings	Chinese
In this tutorial, we are going to decode en0.w2strings file.
*Open up Command Prompt. (Start › Run... › Open: cmd › OK / ⊞ Win + R › Open: cmd › OK)
*Locate which is usually located in
**for 32-bit: 
**for 64-bit: 
*Drag to Command Prompt or write
**for 32-bit: 
**for 64-bit: 
*to Command Prompt. You should see something like this on Command Prompt:
*If you hit ENTER, you'll see options:
Usage: Gibbed.RED.Strings.exe [OPTIONS]+ input [output]
Options:
 -d, --decode decode strings file
 -e, --encode encode strings file
 -h, --help show this message and exit
*Locate which is located in folder in The Witcher 2 game directory.
*Press SPACE and write -d then press SPACE again.
*Drag to Command Prompt and press ENTER.
*If everything is gone perfectly, you will find a file named in folder which is located in your game directory.
*Now you may open the file with your favorite text editor, in this tutorial we're going to use Notepad++.
After you've opened the file, you will notice lots of texts. There are two types of text in strings files:
:key — You may think it as an ID of the text.
:text — Description, text, entry etc.
For instance, I want to find Geralt's character journal entries, then search using the keyword Geralt. Continue to search until you find these lines:
 <key id="geralt">99817</key>
 <key id="geralt 0">99818</key>
We can use this method for any character in the game. Now, let's examine these lines.
, usually the first line is a key for the character's name. If we make another search using the keyword 99817, we'll find the line below:
 <text id="99817">Geralt of Rivia</text>
So that means corresponds to .
If we use the same method for second line, we'll find the line below which is the journal entry about Geralt of Rivia:
<text id="99818">Behold our hero: subjected to mutations and rigorous sword and sorcery training as a child, he has become a superhuman monster slayer. Always penniless and often disdained by those whom he protects, he wanders the world seeking work. Fate has little mercy for him, piling obstacles in his way, yet he trudges on. He has more scruples than a beggaring bum has fleas. Doubts haunt him even when a band of ruffians, knives drawn, approaches him on the highway. Is he a good man? I do not think so. Does he try to maintain his humanity? I believe he does.<br>You must know that Geralt of Rivia died once already, or at least everyone thought him dead. During a massacre in Rivia, he sought to defend non-humans and fell to overwhelming odds. Placed in a boat, he floated into the mist, into a realm where he finally found peace. Not for long. Because of forces to be mentioned later, Geralt returned just in time to defend the witchers' ancient home fortress, and then embarked on a mission to recover the secrets stolen from it. Along the way he took part in a Scoia'tael uprising, shattered a powerful criminal organization, and killed the Grand Master of the Order of the Flaming Rose. All the while his fame as a lover grew. Well, that's Geralt for you. As if all this wasn't enough, he then foiled the attempted assassination of King Foltest of Temeria and became one of the monarch's most trusted men.</text>
We may use this simple method to find in-game text.
This guide is a WIP and will be expanded very soon. If you have any questions about game files you may ask them on talk page.
== External links ==
* GOG.com forum thread about editing textures
* GOG.com forum thread about unpacking .dzip files
* XeNTaX The Witcher 2 Game Archive Research forum thread
* The Witcher 2/Redkit converter
Category:The Witcher 2
Category:Pages with tables