1.2. TrenchBroom setup

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

1.2.1. Downloading MESS

This guide assumes that you have downloaded MESS 1.2.2 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

That's it! You're now ready to start using template entities and templates.