|
|
Updated as of Jan 11, 2006 by NinjaGrinch |
There are really only three small differences when configuring Hammer pre-Steam and post-Steam. First, Steam relocates your installation of Half-Life, and any mods you have, to the SteamApps folder. Second, the $game_exe command doesn't work correctly with long file names and causes Steam to not be able to launch the game properly from within Hammer. And third, .PAK files have been replaced with .GCF files. That should be enough to get most veteran mappers going, but for those new to the scene, read on:
Before continuing:
Get the latest version of Zoner's Half-Life Tools (the compile tools)
Extract game resources from Steam's game cache files (.gcf). (See Un-caching your Cache)
Section I - Game Configurations
Section III - Expert Compile Configuration
- Open Hammer, then click Tools>Options.
- Click on the Game Configurations tab.
- Click the Edit button, then click the Add button.
- Type in a name for the configurations (i.e. Half-Life, Counter-Strike, Team Fortress Classic, etc.), click OK, then click Close.
- In the Configuration listbox, select your newly created configuration. Here's a picture of my configuration for Counter-strike:

They say a pictures worth a thousand words, but I'll give you the thousand words anyway:
For Game Executable Directory, click Browse, then navigate to <install-location>\Steam\SteamApps\<your-steam-account>\<game-name>'. Where <install-location> is the location that you installed Steam to, <your-steam-account> is the name that you used when you created your Steam account, <game-name> is the name of the game you are mapping for. So if you installed Steam to C:\Program Files, and your Steam account name is l337_n00b, and your mapping for Team Fortress Classic, then your 'Game Executable Directory:' box should read:
C:\Program Files\Steam\SteamApps\l337_n00b\team fortress classic
Hammer looks in the Mod Directory and Game Directory for a sprites folder, so it can display sprites properly in the 3D view (Hammer 3.5beta also looks for a models folder). Set these two fields to the location where you extracted your game cache files (see Un-Caching your Cache). Mod Directory corresponds to the game folder for the game that you are mapping for (e.g. the 'cstrike' or 'tfc' folder). Game Directory will be the game folder for regular half-life (i.e. the 'valve' folder)
The RMF Directory is SUPPOSED to set the default save location for your .rmf's, but Hammer always defaults to the last place that you saved, so this field doesn't really work. You can leave it blank if you want, or set it to where you save your .RMF's if it makes you feel better. Either way it won't affect anything...
- Repeat these steps for as many Game Configurations as you want., then proceed to Section II, Build Programs
- Continuing from Section I, Step 6, click on the Build Programs tab.
- In the Configuration listbox, select the game configuration you want to set the build programs for:
- For Game executable do not use the browse button! Just type hl.exe and nothing else. See this note if your curious why no path information is needed.
- For the rest of the boxes, do use the Browse buttons, and set each one using the picture as a guide (your setup will be slightly different):

EXTRA NOTES IN CASE PICTURES DON'T DO IT FOR YOU:
- For CSG, BSP, VIS, and RAD executable, click Browse, then navigate to the folder where the compile tools are located and select the respective programs (hlcsg.exe, hlbsp.exe, hlvis.exe, and hlrad.exe).
- For 'Place compiled maps in this directory before running the game:', click Browse, then navigate to <install-location>\Steam\SteamApps\<your-steam-account>\<game-name>\<mod-folder>\maps'. Where <install-location> is the location that you installed Steam to, <your-steam-account> is the name that you used when you created your Steam account, <game-name> is the name of the game you are mapping for, and <mod-folder> is the mod folder within the game folder. So if you installed Steam to C:\Program Files, and your Steam account email is l337_n00b, and your mapping for Team Fortress Classic, then your 'Place compiled maps in this directory before running the game:' box should read:
C:\Program Files\Steam\SteamApps\l337_n00b\team fortress classic\tfc\maps
NOTE: It may be necessary for you to create the maps folder manually. The maps folder doesn't exist by default on a new installation and only gets created when the game downloads a map from a server. So, again, if you don't have a maps folder, just create one yourself.
- Repeat these steps for all the Game Configurations that you have, then click OK to save your settings and proceed to Section III, Expert Compile Configuration.
- Continuing from Section II, Step 5: You can't set your compile configuration unless you have a map open, so either open a map you are working on, or click New Map on the the File menu.
- Now click the 'Run Map!' button (or just press F9) to open the 'Run Map' dialog. If you started a New Map you'll be asked to save it.
The first time you try to compile a map, the 'Normal' compile dialogue opens. The 'Normal' mode has some bugs that cause unusual behavior or errors on some systems, so you need to use the 'Expert' mode. Switch to expert mode by clicking the 'Expert' button. The window will change to the 'Run Map [Advanced]' dialogue and look something like this:
This picture is from Hammer 3.4; the layout has been changed in 3.5beta.
- Configuration Presets: Hammer can store presets for as many compile configurations as you need, and comes ready-to-run with presets for Half-Life, Counter-Strike, Team Fortress Classic, and Opposing Force. If you want to create a preset for a different mod, click the Edit button, then Copy one of the other presets and give it a new name. If you really want to build a preset from scratch, read about Compile Setup in Hammer's help file (.
- Hammer uses the Game Configuration that was selected when the map was first opened to determine where the map will get copied to after it finishes compiling, regardless of the compile configuration preset that you select. There are only two reasons for having more than one preset for compiling: #1. So different parameters for the compile tools can be saved; mainly options for hlcsg to adjust wad configuration and hlrad to tweak lighting quality. And #2. To properly launch the game and load the map once it's finished compiling. This last command has absolutely nothing to do with the actual compiling of a map and is a completely optional command. Personally, I prefer to leave the game running and switch between Hammer and the game using Alt+Tab, and reloading the map after each compile.
- Next, take a look at the three check boxes "Use long filenames" "Ensure post-file exists" and "Use Process Window". These check boxes are unique for EACH command listed. Rather than explain what each does, I'll just tell you: 1. ALWAYS have "Use long filenames" checked for EVERY command. 2. "Use Process window" should be checked for every command except $game_exe, and 3. "Ensure post-file exists" should be unchecked for every command (until you have a firm handle on compiling and want to start getting fancy). Let me reiterate once more, that the check boxes can be set differently for EACH command in the compile configuration. All of the pre-made presets have the check boxes correctly set, initially, but if you add some custom commands , or make a configuration from scratch, you will need to select each command and verify they are set properly.
- Now take a look at the 'Cmds' and 'Parms' buttons. When clicked, they open a menu listing the available commands and parameters that you can insert into the 'Command' or 'Parameters' boxes. Should you decide to add some custom parameters (see step 8.), you can use the 'Parms' menu, or simply type them out, but for custom commands, adhere to this note from Hammer's help file: "Note: It is important that you select the commands from the Cmds menu rather than typing them in the Command text box. Although they may look the same, typing out the commands will cause problems in the compile."
At some point you're going to want to fiddle with custom parameters for the compile tools. These, as you may have guessed, will go in the 'Parameters' box. Please refer to the ZHLT Reference documentation for a description of the available parameters for each compile tool. A more complete discussion of compiling and the Advanced Compile dialog is covered in the articles listed below, however some of the information is out dated and none of them specifically discuss Steam, so if there is a conflict between them and this guide, follow this guide:
- Compiling 101 (VERC Collective)
Valve Hammer Editor Help File
>Reference
>Valve Hammer Editor 3.4 Setup Guide
>Compile Setup
- Compiling Introduced (TWHL)
- The Advanced Compile Dialog (VERC Collective)
- Texture configuration is pretty self-explanatory: Click the Add button and select any texture packages (.WAD files) that you want to be available for use in Hammer.
- There's no real limit on the number of .WAD files that you can add, but the total number of textures in all .WAD's combined cannot exceed 8,256 textures. If you go over this limit Hammer will immediately crash.
- Also, Zoner's compile tools have a limit on the total combined length of the .WAD path. (e.g. if you have three wad files loaded in Hammer and they are located in C:\My Wads\, then the .WAD path would be "C:\My Wads\wad1.wad;C:\My Wads\wad2.wad;C:\My Wads\wad3.wad", and the length of the path would be 59 characters. The current limit is 4095 characters, which you would have to try really hard to reach. But if you ever manage to go over the limit, hlcsg will give you a "Token too large" error.
- Finally, Steam hides most game resources in .gcf files, including the textures. So if you want to use any of the original texture .wad files, you will need to extract the .wad files from the <gamename>.gcf. See Un-caching Your Cache for details on how to do this. Alternatively you can download the Half-Life SDK Full Installation, which includes the original Half-Life wad files in the 'Texture Wad Files' directory (the .wad files are also available in the Steam dedicated server download).
That's all there is to setting up Hammer so click the Go! button and compile away! And if it still doesn't work, just head on over to http://collective.valve-erc.com and post a message in the Valve Hammer Editor Forums; there are lots of nice folks to help you there.
Q: Why don't we need a path anymore?
A: The short answer is, we never needed a path. The first command of every compile configuration is Change Directory $exedir. This changes the current directory to whatever is set in the Game Executable Directory field on the Game Configurations tab, which happens to be the directory where hl.exe is located. Windows (and every other operating system for that matter) automatically looks in the current directory when given a command or executable. In the old days, there was only one hl.exe to worry about, and all mods used it. So the fact that the $game_exe command always uses short path names, like C:\PROGRA~1\HALFLI~1\HL.EXE, didn't really matter. But with the advent of Steam, there is a separate hl.exe for each game. These new hl.exe's are just the game launcher that tells Steam your wanting to start a game. I'm not entirely sure how Steam actually handles it all, but it appears to get confused when one of these hl.exe's is called using a short path name, not realizing that the short path is actually the same as the current directory, and gives you some nonsense about having multiple installs of Steam on your drive; blah blah...
The Steam.exe does have an alternative syntax for launching games but it is rather cryptic, disguising the game name as number. To see what it looks like, right click on a game listed in Steam's Games window and click "Create desktop shortcut". Then go and look at the Properties of the shortcut, which should look something like this: D:\Games\Steam\Steam.exe -applaunch 10. The Steam.exe handles all the regular command-line options that could be used with hl.exe, so you can use whichever you prefer.
NOTE on Hammer 3.5 beta: You need to have Hammer 3.4 installed before you can use 3.5 beta which is available here. Rather than replacing your original hammer.exe, just rename the 3.5 beta exe to hammer35.exe and create a separate shortcut to it. That way you can switch between 3.4 and 3.5 beta whenever you want.