1.2. TrenchBroom setup

The following steps will help you to set up MESS for TrenchBroom:

NOTE

This setup guide assumes that you're making maps for Half-Life or Counter-Strike, but MESS can also be used for other games that use the Valve 220 .map format, such as Quake. Step 4 explains how to disable template entities and scripts that are specific to Half-Life.

1.2.1. Downloading MESS

This guide assumes that you have downloaded MESS 1.2.3 and extracted the contents of the zip file to C:\HL\Tools\MESS\. You should see the following files:

MESS folder contents
MESS folder contents

1.2.2. Adding the mess.fgd game data file

Even though a game configuration in TrenchBroom can contain multiple fgd files, only one can be active at the same time. This can be solved by creating a single 'master' fgd file that includes all the other fgds:

  1. Go to the games\Halflife folder in your TrenchBroom installation folder.
  2. Copy C:\HL\Tools\MESS\mess.fgd into this folder.
  3. Create a text file named HalfLife_main.fgd (or whatever name you prefer) and add the following lines: @include "HalfLife.fgd" and @include "mess.fgd". If you're using the latest ZHLT or VHLT compile tools, then you should also include zhlt.fgd here.
  4. Open GameConfig.cfg in a plain text editor, go to the entities section and replace the "definitions": [ "HalfLife.fgd" ], line with "definitions": [ "HalfLife_main.fgd" ],.
  5. Finally, open C:\HL\Tools\MESS\mess.config and change the line fgd-path: {EXE_DIR}\mess.fgd so it points to the mess.fgd file in your TrenchBroom's games\Halflife folder. For example, if you installed TrenchBroom in C:\HL\Tools\TrenchBroom, then the line should be changed to fgd-path: C:\HL\Tools\TrenchBroom\games\Halflife\mess.fgd.

Your TrenchBroom's games\Halflife folder should now contain at least the following files:

TrenchBroom games Halflife folder
TrenchBroom games Halflife folder

HalfLife_main.fgd should contain at least the following lines:

TrenchBroom HalfLife_main.fgd
TrenchBroom HalfLife_main.fgd

And mess.config's fgd-path setting should look like this (depending on where you installed TrenchBroom):

TrenchBroom MESS fgd path
TrenchBroom MESS fgd path

1.2.3. Adding the MESS.exe compile step

  1. Open or create a map in TrenchBroom, then go to the Run menu and select Compile Map....
  2. If you already have a compilation profile for Half-Life, continue with step 3. Else, you'll need to create one by pressing the small + button on the left. Change the name of the new profile to something like Half-Life, then add the following tasks:
    1. An Export Map task with the following file path: ${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map (the -compile part is important, because otherwise the source map file would be overwritten!).
    2. A Run Tool task. For the Tool Path, go to your compile tools folder and select hlcsg_x64.exe (or hlcsg.exe). In the Parameters field, enter "${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map". You can also add additional CSG parameters here.
    3. A second Run Tool task for hlbsp_x64.exe, with the same path in its Parameters field as the CSG task.
    4. A third Run Tool task for hlvis_x64.exe, again with the same path in its Parameters field as in the previous tasks.
    5. A final Run Tool task for hlrad_x64.exe, using the same path in its Parameters field as in the previous tasks.
    6. A Rename File task that copies ${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.bsp to ${GAME_DIR_PATH}/${MODS[-1]}/maps/${MAP_BASE_NAME}.bsp.
  3. Add a new Run Tool task, and move it up to just before the CSG task.
  4. For the Tool Path, select C:\HL\Tools\MESS\MESS.exe.
  5. For the Parameters, enter "${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map".

The Compile window should now look like this:

TrenchBroom Compile window
TrenchBroom Compile window

If you're making maps for Half-Life or Counter-Strike then you're ready to start using template entities and templates. For other games, continue with step 4 to create a game-specific configuration.

1.2.4. Different game configurations

MESS contains a number of template entities and behaviors (automation scripts) that were made specifically for Half-Life and Counter-Strike. If you're making maps for a different game then it's recommended to disable these:

  1. Create a copy of mess.config and give it the name of the game you're mapping for, for example quake.config.
  2. Open this new config file in a text editor and search for the line that says template-entity-directories:. There are several directories listed below that line. Remove the mess_template_library and cs lines and save your config file.:
  3. In TrenchBroom, open the Compile window and add -config quake to the parameters in the MESS.exe task. The parameters box should now contain: -config quake "${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map":
  4. Run the compile process (or open a console window and run MESS.exe -config quake). This will remove Half-Life and Counter-Strike specific entities from your mess.fgd file. You may need to restart TrenchBroom to see the fgd changes.

That concludes the setup for your game. Take a look at the macro entities and tutorials to get started.