Command List
Display help for a specific command: e.g. unbundle -h

Unbundle

Separating archives into distinct compressed REDengine files

unbundle -p "PATH TO ARCHIVE" -o "OUTPUT PATH" -w *.mesh
  • Extracts all files from archive
  • -w Use optional search pattern (e.g. *.ink), if both regex and pattern is defined, pattern will be prioritized.
  • -r Use optional regex pattern
  • --hash: Extract single file with a given hash. If a path is supplied, all hashes will be extracted
The unbundle command also takes folder paths as input (will recursively extract all .archives in a folder), or a list of paths (e.g. unbundle -p "C:\MODDING\archives\basegame_4_gamedata.archive" "C:\MODDING\archives\basegame_1_engine.archive"
You can filter the files to extract from an archive with the -w (Wildcard) or the -r (Regex) filters: unbundle -p "PATH TO ARCHIVE" -w *.mesh e.g. will only extract files with the extension .mesh.

Uncook

Separating archives into distinct uncompressed REDengine files with external buffers

uncook --uext png -p "PATH TO ARCHIVE" -o "OUTPUT PATH" -or "RAW FOLDER OUTPUT PATH"
  • Extract all textures from archive, common formats (tga, bmp, jpg, png, dds) supported
  • -w Use optional search pattern (e.g. *.ink), if both regex and pattern is defined, pattern will be prioritized.
  • -r Use optional regex pattern
  • -hash: Extract single file with a given hash. If a path is supplied, all hashes will be extracted
  • --flipUse boolean option (e.g. 'true' or 'false') : Flip textures vertically (can help with legibility if there's text)
  • --forcebuffers: Force uncooking to buffers for given extension. e.g. mesh
The REDengine extension for textures is XBM
There are a number of files that support Uncook, including mesh, csv, xbm, and mlmask.
Cyberpunk textures use DDS format, but WolvenKit Console supports conversions to the most common image formats such as TGA, PNG, etc.
For example, textures can be converted to PNG using:
uncook -p "PATH TO ARCHIVE" --uext png
The same options apply here as well: When using
uncook -p "PATH TO ARCHIVE" -w *.xbm
Only files with the XBM extension will be uncooked.

Import

Converting raw files to REDengine files

import -p "INPUT PATH" -o "OUTPUT PATH" --keep
  • Convert raw files to REDengine files
  • -p can be a folder or file
  • -o (optional) is the output path where the REDengine files are created
  • -k (optional) use this parameter if you have already existing REDengine files in your output folder
When using -k you need both .dds/.buffer and .xbm/.mesh files
e.g. judy_body_wet.xbm AND judy_body_wet.dds
When using -o, then the REDengine files need to be located in that folder, while the raw files have to be in the folder specified with -p.

Export

Converting REDengine files to raw files

export --uext png -p "PATH TO FILE"
  • Convert REDengine file (mesh, xbm) to the corresponding raw files (gltf/glb, dds)
You can specify a folder to export, or multiple files pack -p "FILE 1" "FILE 2"
There are a number of files that support exporting: .mesh, .csv, .xbm, .mlmask and many more.
The in-game textures have .dds fileformat, but WolvenKit Console supports conversions to the most common image formats (png, jpg, tga). E.g. to convert the game textures to png use: export -p "PATH TO FILE" --uext png

Pack

Creating new archive files

pack -p "MODDED FOLDER PATH"
  • Pack a folder of REDengine files: this will create a new .archive file.
You can specify multiple folders to pack: pack -p "FOLDER 1" "FOLDER 2"
Do not replace existing vanilla archives

CR2W/W2RC

  • Convert a REDengine file into human readable form: cr2w -s "<PATH TO FILE>"
  • Convert a json file into a REDengine file: cr2w -d "<PATH TO JSON>"

Tweak

  • Convert .tweak files (in YAML format) to a TweakDB .bin file that can be loaded with TweakDBext
  • tweak -p "<input directory>" -o "<output directory>"
  • Defaults to current directory if -p or -o are not specified.
The .tweak file must be in the following format, with either flats or groups declared:
1
flats:
2
Mycustom.flat:
3
type: Float
4
value: 1.0
5
groups:
6
MyOtherCustomRecordOrGroup.mine:
7
type: Vehicle
8
members:
9
affiliation:
10
type: TweakDBID
11
value: Factions.Unaffiliated
12
animals:
13
type: array:String
14
value:
15
- cow
16
- pig
17
- horse
18
- cat
Copied!

Groups

Flats for the groups (also called records) are automatically created by appending the member's name to the end of the record's name. Using the example above, the following flats would be created:
1
Mycustom.flat
2
MyOtherCustomRecordOrGroup.mine.affiliation
3
MyOtherCustomRecordOrGroup.mine.animals
Copied!
A group's type (Vehicle in the example above) should exist in CP2077 for it to be useful. The compiler will not warn you if the type doesn't exist, but TweakDBext will let you know upon loading it (watch for messages in red4ext\logs\tweakdb.log). Generally a TweakDB type is the RTTI type without gamedata or _Record (a full list can be see here, where the gamedata is already omitted from the filenames) - as an example, the a Vehicle's RTTI type is gamedataVehicle_Record.

Types

Flats and group members must have one of the following as a base type :
1
CName
2
String
3
TweakDBID
4
raRef:CResource
5
Float
6
Bool
7
Uint8
8
Uint16
9
Uint32
10
Uint64
11
Int8
12
Int16
13
Int32
14
Int64
15
Color
16
EulerAngles
17
Quaternion
18
Vector2
19
Vector3
20
LocKey
Copied!
Types can be prepended with array: to create an array, like array:String in the example. Arrays can be formatted with hyphens & newlines as in the example, or specified with square brackets and commas. The same array could look like this:
1
animals:
2
type: array:String
3
value: [ cow, pig, horse, cat ]
Copied!
Strings can left unenclosed, and optionally enclosed in double quotes, but if you're using paths with raRef:CResource, you'll need to double-up the \, like this:
1
curvesPath:
2
type: raRef:CResource
3
value: "base\\gameplay\\vehicles\\curves\\muscle_car.vehcurveset"
Copied!
raRef:CResource also accepts integers (ones that you might pull from a tweakdb output) in place of the path, like this:
1
curvesPath:
2
type: raRef:CResource
3
value: 5774411407796421038
Copied!
TweakDBID types can be the full path of the flat/group:
1
flats:
2
myFlat.reference:
3
type: TweakDBID
4
value: myOtherFlat.cow
Copied!
Or the shorthand that uses the hash & length, both in hexadecimal:
1
flats:
2
myFlat.reference:
3
type: TweakDBID
4
value: TDBID:12345678:12
Copied!
Vector3 are declared like this, using a capital XYZ:
1
flats:
2
whereIam.position:
3
type: Vector3
4
value:
5
X: 0
6
Y: 0
7
Z: 0
Copied!
Export as PDF
Copy link
Edit on GitHub