Configuring Valve Hammer Editor
This article help you configure Valve Hammer Editor (formerly known as Worldcraft). I assume that you have experience with Windows Explorer and WinZip and that you know how to install programs. It also helps if you're familiar with the folder structure of Half-Life and Counter-Strike (before and after Steam).
In order to create maps for Counter-Strike you need the following:
- A map editor; in this case Valve Hammer Editor 3.4. Install it in e.g. C:\Program Files (x86)\Valve Hammer Editor.
- A CS specific definition file for Hammer. The program wasn't made for Counter-Strike but for Half-Life and various other mods based on this. Therefore Hammer needs to know which entities are available and which properties they have. Hammer does come with such a file, but it's obsolete, so use this one instead. Unzip it in the root of the Hammer folder.
- Textures from various wad files that come with Half-Life and Counter-Strike. You need GCFScape to extract these from the cache files (see below).
- Compilation tools to convert your Hammer maps to something that's usable in Counter-Strike. There are several sets of these; I recommend XP-Cagey's Half-Life Compile Tools 2.5.3 Custom Build 1.7p15. Unzip it in C:\Program Files (x86). This will create a folder with the name ZHLT253-17p15. Among other files you'll find zhlt.wad that has textures with special meaning for the compilation tools. You need to copy this to SteamApps\<Account Name>\counter-strike\cstrike.
[ Top ]
Hammer isn't very exciting without some textures to play with, so we're going to use some of the wad files that come with Half-Life and Counter-Strike. Up to and including CS 1.5 these were lying around in the valve and cstrike folders, but in the Steam version they are located inside so-called cache files, which makes the configuration of Hammer a bit more complicated.
A cache file (with the file type .gcf) is a file that can contain multiple files in a folder structure, just like a zip file. In order to look inside them we're going to use the program GCFScape.
Install GCFScape and launch the program. If it doesn't work it may be because you don't have Microsoft .NET Framework 2.0 installed.
We need the following wad files:
Here's how to extract the wad files from the cache files:
- Click the menu File and select Open.
- Locate the cache file in the SteamApps folder and doubleclick it. You should now be presented with a layout that resembles Windows Explorer. If you're familiar with the folder structure of Half-Life and Counter-Strike you should feel right at home.
- Go to the folder that has the wad files you need.
- Select the wad files (hold Ctrl to select multiple), then right click and select Extract.
- Select SteamApps\<Account Name>\counter-strike\cstrike as destination folder.
[ Top ]
The Textures Tab
Launch Hammer if you haven't done so already. If this is the first time you'ved started it (or if for some reason it hasn't been configured yet), the program will offer to open the New User's Guide. Don't do this. You can then skip Step 1 below, as Hammer will automatically open the Options window.
- Click the menu Tools and select Options.
- Go to the Textures tab.
- If there are any wad files on the list, select them and click Remove.
- Click Add WAD and select the following files from SteamApps\<Account Name>\counter-strike\cstrike:
Note: In the old days (before Steam) the path to the cstrike folderen was typically quite short (e.g. D:\Games\Half-Life\cstrike), but in Steam the paths are so long that you can't see the names of the wad files. Fortunately, Hammer doesn't change the order of the wad files, so just remember that you shouldn't remove the first 6 entries.
[ Top ]
The Game Configurations Tab
- Go to the Game Configurations tab.
- Click Edit and then Add in the little window that appears.
- Hammer supports multiple game configurations, so you need to name this one. It doesn't matter what you call it, but feel free to call it Counter-Strike.
- Click OK (or hit Enter) and then Close.
- Click Add, go to Valve Hammer Editor\fgd\counter-strike, and select counter-strike.fgd.
- Set Default PointEntity class and Default SolidEntity class to anything, for example light and func_wall, respectively.
- Set Game Executable Directory to the drive letter of the path where Steam is installed, followed by a colon, for example D:. This might only be necessary if Steam is installed on another drive then the compilation tools.
- Leave the rest of the fields empty.
[ Top ]
The Build Programs Tab
- Go to the Build Programs tab.
- Set Game executable to Steam\Steam.exe.
- Set CSG executable, BSP executable, VIS executable, and RAD executable to hlcsg.exe, hlbsp.exe, hlvis.exe, and hlrad.exe, respectively, in the ZHLT folder.
- Set Place compiled maps in this directory before running the game to SteamApps\<Account Name>\counter-strike\cstrike\maps.
- Click OK.
[ Top ]
The Run Map Dialog
I don't recommend compiling your map from within Hammer, unless you have a lot of RAM. It takes a lot of resources to have Hammer running with the map loaded, and it seems to be impossible to cancel the compilation once it's been started. I suggest you take a look at my article on How to Compile Maps using a Batch File instead.
If you still want to compile from Hammer, here's how to do it:
- Click the Run Map! icon on the far right on the toolbar.
- Click Expert if it doesn't already say Run Map [Advanced] in the window's titlebar.
- Select Half-Life: Counterstrike (full) under Configurations.
- Click the bottom line (the one with $game_exe) in the Compile/run commands box, insert -applaunch 10 at the beginning of the line in the Parameters box and remove -game cstrike. You should end up with -applaunch 10 +map $file -dev -console +deathmatch 1. Be sure to have spaces between the parameters.
- Click Go!.
The compilation settings are saved, so from now on you can just click Go!.
[ Top ]