Vpk.exe: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 25: Line 25:
; <code>-M</code>
; <code>-M</code>
: Produce a multi-chunk VPK that is split across several files and has an index. To inspect a multi-chunk VPK look at the '_dir' file.
: Produce a multi-chunk VPK that is split across several files and has an index. To inspect a multi-chunk VPK look at the '_dir' file.
=== Multi-chunk files ===
A multi-chunk VPK requires a list of the files to be packed:
* Create the list using Windows console, <code>dir /s /b *.<file format> >> <text file name></code>. ''For example, dir /s /b *.vmt >> responsefile''. Repeat this (manually or with a script) until every file format to be packed is added to the list.
* In a text editor, remove any absolute paths making them relative to the game. {{todo|For example...}}
* Finally pack the file, <code>vpk -M a pak01 @<text file name></code>. ''For example, vpk -M a pak01 @responsefile''.


== See also ==
== See also ==
Line 31: Line 37:
* [[L4D Campaign Add-on Tutorial]]
* [[L4D Campaign Add-on Tutorial]]
* [[L4D2 Campaign Add-on Tutorial]]
* [[L4D2 Campaign Add-on Tutorial]]
* [[Releasing A Portal 2 Map]]
* [[Swarm Campaign Add-on Tutorial]]
* [[Swarm Campaign Add-on Tutorial]]


[[Category:Modding]]
[[Category:Modding]]

Revision as of 08:37, 22 October 2011

VPK ("Valve Pak") files are uncompressed archives used to package content (never code). They are the successors to GCFs, and when passed to the addoninstaller tool are also used to distribute add-ons like custom campaigns.

VPK tool

VPKs can be created with the command line tool vpk.exe, found at <game>\bin\. It is available in all newer Source engine games since Left 4 Dead.

When you create a VPK, some executable and archive files will be discarded. Files with following extensions are affected: .zip, .reg, .rar, .msi, .exe, .dll, .com, .cmd and .bat.

Commands

<dirname>
Creates a new VPK in the directory given, containing the contents of that directory. Must be an existing location. Alternatively, drag a folder onto the tool in Explorer to trigger this command.
Icon-Bug.pngBug:If the location is outside the game's folder, the file will just be called ".vpk".  [todo tested in ?]
x <vpkfile> <filename1> <filename2> ...
Extract file(s).
a <vpkfile> <filename1> <filename2> ...
Add file(s).
a <vpkfile> @<filename>
k vpkfile <filename>
Add files listed in a response file ('a' - note the @) or a keyvalues file ('k').
Icon-Bug.pngBug:They will appear inside the VPK with their full path (C:\etc\) intact - is there a way to avoid this?  [todo tested in ?]
l <vpkfile>
L <vpkfile>
List contents of VPK. Uppercase 'L' means more detail.
-v
Verbose output.
-M
Produce a multi-chunk VPK that is split across several files and has an index. To inspect a multi-chunk VPK look at the '_dir' file.

Multi-chunk files

A multi-chunk VPK requires a list of the files to be packed:

  • Create the list using Windows console, dir /s /b *.<file format> >> <text file name>. For example, dir /s /b *.vmt >> responsefile. Repeat this (manually or with a script) until every file format to be packed is added to the list.
  • In a text editor, remove any absolute paths making them relative to the game.
    Todo: For example...
  • Finally pack the file, vpk -M a pak01 @<text file name>. For example, vpk -M a pak01 @responsefile.

See also