1.2. TrenchBroom setup
The following steps will help you to set up MESS for TrenchBroom:
- 1.2.1. Downloading MESS
- 1.2.2. Adding the mess.fgd game data file
- 1.2.3. Adding the MESS.exe compile step
- 1.2.4. Different game configurations
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 a folder, for example C:\HL\Tools\MESS\. You should see the following files:
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:
-
Go to the
games\Halflifefolder in your TrenchBroom installation folder. -
Copy
C:\HL\Tools\MESS\mess.fgdinto this folder. -
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 includezhlt.fgdhere. -
Open
GameConfig.cfgin a plain text editor, go to theentitiessection and replace the"definitions": [ "HalfLife.fgd" ],line with"definitions": [ "HalfLife_main.fgd" ],. -
Finally, open
C:\HL\Tools\MESS\mess.configand change the linefgd-path: {EXE_DIR}\mess.fgdso it points to themess.fgdfile in your TrenchBroom'sgames\Halflifefolder. For example, if you installed TrenchBroom inC:\HL\Tools\TrenchBroom, then the line should be changed tofgd-path: C:\HL\Tools\TrenchBroom\games\Halflife\mess.fgd.
Your TrenchBroom's games\Halflife folder should now contain at least the following files:
HalfLife_main.fgd should contain at least the following lines:
And mess.config's fgd-path setting should look like this (depending on where you installed TrenchBroom):
1.2.3. Adding the MESS.exe compile step
-
Open or create a map in TrenchBroom, then go to the
Runmenu and selectCompile Map.... -
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 likeHalf-Life, then add the following tasks:-
An
Export Maptask with the following file path:${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map(the-compilepart is important, because otherwise the source map file would be overwritten!). -
A
Run Tooltask. For the Tool Path, go to your compile tools folder and selecthlcsg_x64.exe(orhlcsg.exe). In the Parameters field, enter"${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map". You can also add additional CSG parameters here. -
A second
Run Tooltask forhlbsp_x64.exe, with the same path in its Parameters field as the CSG task. -
A third
Run Tooltask forhlvis_x64.exe, again with the same path in its Parameters field as in the previous tasks. -
A final
Run Tooltask forhlrad_x64.exe, using the same path in its Parameters field as in the previous tasks. -
A
Rename Filetask that copies${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.bspto${GAME_DIR_PATH}/${MODS[-1]}/maps/${MAP_BASE_NAME}.bsp.
-
An
-
Add a new
Run Tooltask, and move it up to just before the CSG task. -
For the Tool Path, select
C:\HL\Tools\MESS\MESS.exe. -
For the Parameters, enter
"${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map".
The Compile window should now look like this:
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:
-
Create a copy of
mess.configand give it the name of the game you're mapping for, for examplequake.config. -
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. Themess_template_libraryandcsfolders contain Half-Life and Counter-Strike specific entities, so you can remove those lines:
-
If you choose to remove the
mess_template_libraryline from your config file, you'll need to copy thetb_linked_group_id_handler.tedfile from thetemplate_entities\mess_template_libraryfolder into yourtemplate_entities\quakefolder. This file ensures that TrenchBroom group IDs aren't interpreted as MScript expressions. -
In TrenchBroom, open the Compile window and add
-config quaketo the parameters in theMESS.exetask. The parameters box should now contain:-config quake "${WORK_DIR_PATH}/${MAP_BASE_NAME}-compile.map":
-
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 yourmess.fgdfile. 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.