Configuring Hammer to compile Entity Groups
Part of this process involves executing some Perl scripts provided by Valve which compile entity groups. In order to proceed you must have the Perl programming language installed on your computer so that these scripts can run.
If you are running Windows, go to www.perl.org to download and install ActiveState Perl
Set up Hammer
- Load Hammer
- Load a .VMF that you wish to compile into an entity group.
- Only entities can be compiled into an Entity Group. World solids will be discarded. Brush entities can be compiled but they will not have brush models. So you can for example compile a func_tracktrain or func_door but any associated brushes will be discarded.
- Triggers volumes such as trigger_multiple, trigger_once and trigger_push can be compiled as entity groups. The brush models are discarded but the trigger area still functions as expected.
- Ensure that you have configured Hammer to compile maps and the game executable and paths are correct. Below are example images showing the tabs you'll need to configure in order to compile entity groups.
EXAMPLE: The Build Programs tab located in Tools->Options. Your file paths may differ!
EXAMPLE: The Game Configurations tab located in Tools->Options. Your file paths may differ!
- If you make changes you may be prompted to restart Hammer in order for the changes to take effect
- Load a vmf you wish to compile into an entity group (NOTE: file must be saved in EntityGroups folder as of this writing)
- Open the "Run Map dialog" by pressing F9 or by clicking the game pad button on the Map Operations bar:
If you are not in "Expert" mode click the button at the bottom of the dialog labeled "Expert"
- Click the "Edit" button to open the Run Map Configurations panel and then click "New"
- Name your configuration (e.g., Export Entity Group) and click Close
- Ensure that your new configuration is selected in the Configurations dropdown
- Click the "New" button to add a new command and check the checkbox to enable it.
- In the Command field in Command Properties enter the path to your perl.exe. If you prefer, you can click Cmds then select Executable from the list that appears and browse to where you installed perl.exe.
- In the Parameters field use these parameters:
$gamedir\..\bin\export_entity_group.pl $path\$file.$ext $gamedir\scripts\vscripts\entitygroups\$file_group.nut
- It is highly recommended that you check the box labeled "Wait for keypress when done compiling" so you can examine the output of the script.
- Click 'GO!' and it should compile your entity group.