Creating Batch Files for Compiling Maps using Notepad.
This is a basic guide to writing a batch file in notepad in order to comple a .map file into a .bsp, it was written presuming you are using windows xp.
1) Make sure the directory with your compile tools has no spaces in it (this can cause errors), for this I'm going to assume the compile tools directory is "C:\zhlt\".
2) Place any .wad files you wish to include in the .bsp in the compile tools directory (C:\zhlt\), this means if you include all custom textures in the .bsp you do not need to include a custom .wad file with your map. This is much better if people are downloading the map from the server.
3) Place .map file of your map in a folder, I use an empty folder, as all the outputs of the compile are put here and then I move the .bsp file to my game directory afterwards. For the purpose's of this we'll call the folder where you have placed the map file "C:\maps\".
4) Open Notepad and type the following:
C:\zhlt\hlcsg.exe -low -estimate -wadinclude custom.wad C:\maps\yourmap.map
C:\zhlt\hlbsp.exe -low -estimate C:\maps\yourmap.map
C:\zhlt\hlvis.exe -low -full -estimate C:\maps\yourmap.map
C:\zhlt\hlrad.exe -low -extra -estimate C:\maps\yourmap.map
You of course need to replace custom.wad and yourmap.map with the correct file names! You can add to the command lines to change the compile options, here's an explaination of the one's I've used:
-estimate this add's a ball park figure to how long it will take until the current proccess finishes
-low this runs the process with a low priority, useful if you want to multitask.
-high this means the compile will be done quicker but you won't be able to do anything else while the compile is running.
-full only for use with hlvis.exe, this does a full VIS, results in lower r_speeds and less VIS errors, you will want to use this for a final compile.
-quick only for use with hlvis.exe, this does a quick VIS, good for checking your map for bugs, but the r_speeds will be high, not for final compile.
-extra only for use with hlrad.exe it turns on 9 point oversampling for lighting, making it look much better.
For all the possible options and what they do see documentation.html that came with your compile tools, if you've some how lost it the documentation click here to view the zhtl p14 documentation, or click here to download it.
5) Go to save as, under Save as Type select All Files, and type the name as compile_yourmap.bat (or whatever, as long as it ends in .bat) and then save it in your C:\maps\ folder.
6) Run the file! That's it! The icon'll look something like this (it of course depends on your folder options as to what it looks like).
7) You can add a couple more lines to the end of the file to add extra functions two good ones are:
copy C:\maps\yourmap.bsp C:\yoursteammapsdir\yourmap.bsp
C:\YourSteamDir\Steam.exe -applaunch 70 -game ns +map yourmap
The first opens the log file once the compile is finished, this is very useful if you're not sure that the compile will work, as the cmd prompt closes once the program finishes and you don't have time to read the errors.
The second copies the .bsp file you've just created to your maps directory so you don't have to do it manually.
The third opens the map in steam, in this case it would launch natural-selection, you should only use this if you're sure that the compile will work!
Just in case you can't be bothered to work out the command line to launch different steam games here they are:
Counter-Strike : C:\Valve\Steam\Steam.exe -applaunch 10
Condition-Zero : C:\Valve\Steam\Steam.exe -applaunch 80
Counter-Strike Source : C:\Valve\Steam\Steam.exe -applaunch 260
Day of Defeat : C:\Valve\Steam\Steam.exe -applaunch 30
TFC : C:\Valve\Steam\Steam.exe -applaunch 20
Deathmatch Classic : C:\Valve\Steam\Steam.exe -applaunch 40
Opposing Force : C:\Valve\Steam\Steam.exe -applaunch 50
Ricochet : C:\Valve\Steam\Steam.exe -applaunch 60
Half-Life : C:\Valve\Steam\Steam.exe -applaunch 70
Natural-Selection : C:\Valve\Steam\Steam.exe -applaunch 70 -game ns