Difference between revisions of "BSPZIP"

From Valve Developer Community
Jump to: navigation, search
m (Usage)
(badly formatted, doesn't even work, bad example overall)
Line 56: Line 56:
  -extractcubemaps <bsp file> <output folder>
  -extractcubemaps <bsp file> <output folder>
  -deletecubemaps <bsp file>
  -deletecubemaps <bsp file>
=== Example of usage ===
Taken from [http://forum.l4dmaps.com/viewtopic.php?f=5&t=2817| Left 4 Dead Mapping ]
:*Go to C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2\bin
:*Create a new text file name it for example: customsBSPZIPPING.
:*Open this file and copy paste this:
bspzip -addfile "%vproject%/maps/palacev3_6_night.bsp"
:*Just replace the two palacev3_6_night.bsp by your map name and the good path of your sound. Don't forgot .bsp and the .wav/.mp3 at the end.
:*Save the file. Rename the .txt into a .bat
:*(Later if you need to add others sound just open the .bat with notepad++ and correct the paths.)
:*Run the .bat you created and voilà.
== Testing ==
== Testing ==
Line 93: Line 74:
[[Category:Level Design]]
[[Category:Level Design]]

Revision as of 19:45, 4 February 2014

BSPZIP is a command-line tool that allows arbitrary files to be embedded within a BSP. When the map is being loaded the files will be mounted as if they were present in the game's real content folders.

Tip.png Tip: Several GUI utilities have been created that may be more convenient than using BSPZIP directly.
Tip.png Tip: Embedded content can be examined with archive tools that support .zip by opening the BSP file.

While it is usually a good idea to BSPZIP content, there are times when it can cause problems and other times when it won't work at all (e.g. for Maplist Thumbnails). When this happens a resource list can be used instead.


Note.png Note: Remember to set the appropriate VPROJECT before starting to use the tool.

BSPZIP is found at "common\<gamename>\<gamefolder>\bin\bspzip.exe". It performs several functions:

Adding a list of files

The most common function. There are two related commands:

-addlist <input bsp> <file list> <output bsp>
-addorupdatelist <input bsp> <file list> <output bsp>

Include file extensions. The former command packs all files in the list, the latter (untested, Orange Box only) packs only those that have changed since the last operation.

Tip.png Tip: The input and output files can be the same.

The 'file list' is a .txt file containing this pattern:

  • Internal paths ('relative paths') are the location the file will take within the BSP, e.g. materials/metal/new_steel.vmt.
  • External paths ('full paths') are the location of the file to be packed, e.g. C:\Users\Public\our_maps\materials\metal\new_steel.vmt.

Adding a single file

The same principle as above, but without a file list.

-addfile <input bsp> <internal path> <external path> <output bsp>

Viewing and extracting files

If you have an archive tool installed that is able to look inside BSPs it's better to use that. If you don't, these are the commands you need:

-extract <bsp file> <output.zip>
-extractfiles <bsp file>
-dir <bsp file>

Handling cubemaps

Should be self-evident:

-extractcubemaps <bsp file> <output folder>
-deletecubemaps <bsp file>


There are situations where files won't be loaded from BSP files correctly. As time goes on they become fewer in number, but it's always worth checking regardless. The easiest way to do so is moving all of the embedded content out of the game's folders -- or even better, not storing it there in the first place.

GUIs / Replacements

The following GUI tools are often preferred to BSPZIP directly, and may aid you in determining which files need to be packed into your map.

See also

  • Resource list (Alternative method to push content to users)
  • GCFScape (Read-only tool for inspecting BSP contents)