Difference between revisions of "Expert compile mode"

From Valve Developer Community
Jump to: navigation, search
 
m (The dialog)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Expert compile mode is a way of using a gui-screen to make batch scripted compiles.
+
{{mergeto|Hammer_Run_Map_Expert}} <!-- See this article's discussion page (old, but relevant). The information on the target article (Hammer Run Map Expert) could definitely be complemented with the information on this article, which would then redirect to it. -->
If you know what I mean by that, you probably should not use this, but batch files instead :)
 
  
=How does compiling work?=
+
{{cleanup}} {{pov}}
Once you understand [Saving and compiling |the basics], you might have a clue
+
 
 +
Expert compile mode is a way of using a GUI front end to execute batch scripted compiles. If you know what that means, you probably should not use this, but batch files instead.
 +
 
 +
== Compile process ==
 +
Once you understand the basics, you might have a clue.
  
 
[[Image:Hammer_setmapparam.gif]]
 
[[Image:Hammer_setmapparam.gif]]
  
 
First observe how the compile process consists of three programs:
 
First observe how the compile process consists of three programs:
*[[vbsp | vbsp.exe]] builds the mapfile
+
* [[vbsp | vbsp.exe]] builds the map file
*[[vvis | vvis.exe]] calculates which parts of your level need to be rendered when the player is at a certain place (using [[visleafs]] )
+
* [[vvis | vvis.exe]] calculates which parts of your level need to be rendered when the player is at a certain place (using [[visleafs]] )
*[[vrad | vrad.exe]] lights your map
+
* [[vrad | vrad.exe]] lights your map
  
Also observe you can use three options (1) for each tool. However, if you click on any of the links of the tools, you'll soon realise there are WAAAAAY more. You can only use them with <code>batch scripts</code> (which are basically a bunch of DOS-commands) or the expert compile mode.
+
Also observe you can use three options (1) for each tool. However, if you click on any of the links of the tools, you'll soon realize there are way more. You can only use them with <code>batch scripts</code> (which are basically a bunch of DOS-commands) or the expert compile mode.
  
See that "Expert" button in the lowerleft corner? Why don't you press it? Let's get adventuring.
+
See that "Expert" button in the lower left corner? Why don't you press it? Let's get adventuring.
  
=The dialog=
+
== The dialog ==
 +
[[File:Hammer_Run_Map_Expert.png]]
  
[[Image:Expert_compile.JPG]]
+
You'll see a dialog box like the one above show up. Although at first this may seem pretty difficult, it really isn't.
 
 
You'll see a dialog like above show up.
 
Allthough at first this may seem pretty difficult, it really isn't.
 
If you are scared, press the "Normal" button and act like you never even knew what expert compiling is.
 
  
 
First, we have some "configurations". This is handy, for instance, when you want multiple setups for compiling: one for fast compiling, one for compiling cs:s maps, one for [[glview]] etc.
 
First, we have some "configurations". This is handy, for instance, when you want multiple setups for compiling: one for fast compiling, one for compiling cs:s maps, one for [[glview]] etc.
 
You can add, delete, and rename configurations using the "Edit" button right of the selection box.
 
You can add, delete, and rename configurations using the "Edit" button right of the selection box.
  
Each setup holds a number of commands you can use. Normally, these commands are used to run each compile tool, and perhaps deleting, moving, copying or renaming certain files (e.g. moving the mapfile to the game-directory, deleting logfiles etc)
+
Each setup holds a number of commands you can use. Normally, these commands are used to run each compile tool, and perhaps deleting, moving, copying or renaming certain files (e.g. moving the map file to game directory, deleting log files, etc).
 
Use the "New" button to add a command. Use the "Remove" button to remove one, and use the "Move up" and "Move down" buttons to change the sequence in which the commands are run. We don't want to copy the map or run the game before it is made for instance.
 
Use the "New" button to add a command. Use the "Remove" button to remove one, and use the "Move up" and "Move down" buttons to change the sequence in which the commands are run. We don't want to copy the map or run the game before it is made for instance.
 
You can use the checkboxes to the left of each command to skip the commands if you wish.
 
You can use the checkboxes to the left of each command to skip the commands if you wish.
  
=The command=
+
== The command ==
Typically, a command consists of a "Command" and one or more "Parameters". The command shows which action to perform (you can select them using the "Cmds" button). If you want to run a program that's not directly in that list (the tools and the HL2 executable are already there) select "executable" and a dialog will open to browse to any executable. (you can use, but not select batch file here, btw) Some actions have a strange syntax, like $bsp_exe: hammer will recognise these commands and replace them with the right directories. $bsp_exe will be replaced with the directory to bsp.exe for instance.
+
Typically, a command consists of a "Command" and one or more "Parameters". The command shows which action to perform (you can select them using the "Cmds" button). If you want to run a program that's not directly in that list (the tools and the HL2 executable are already there) select "executable" and a dialog will open to browse to any executable. (You can use, but not select batch file here.) Some actions have a strange syntax, like $bsp_exe: hammer will recognise these commands and replace them with the right directories. $bsp_exe will be replaced with the directory to bsp.exe for instance.
  
''For the real nerds: Any dos-command can be used here.''
+
''For the real nerds: Any DOS command can be used here.''
  
The parameters tell the programs what to do. For instance, which map to compile, or what options to use. Again, the "Parms" button allows you to select a number of variables hammer knows and replaces. Things like the mapfile, or certain directories can be used here. Between multiple parameters, add a space. Examine the "Default" configuration a bit and the compile tools Wike entries (see above) so you can learn which parameters can be used. Please note that each compile tool needs the directory of the mapfile to know what file to compile. This should be logical to you. They also have a "game" parameter, telling them which directories to look in to find the stuff they need (textures, models, etc)
+
The parameters tell the programs what to do. For instance, which map to compile, or what options to use. Again, the "Parms" button allows you to select a number of variables hammer knows and replaces. Things like the mapfile, or certain directories can be used here. Between multiple parameters, add a space. Examine the "Default" configuration a bit and the compile tools Wiki entries (see above) so you can learn which parameters can be used. Please note that each compile tool needs the directory of the map file to know what file to compile. This should be logical to you. They also have a "game" parameter, telling them which directories to look in to find the stuff they need (textures, models, etc)
  
 
Fiddle around with the options, but make sure you have a backup of whatever you are experimenting with. You don't want your maps to be accidentally deleted.
 
Fiddle around with the options, but make sure you have a backup of whatever you are experimenting with. You don't want your maps to be accidentally deleted.
Line 42: Line 42:
 
The last two options are
 
The last two options are
 
==Ensure file post-exists:==
 
==Ensure file post-exists:==
You can use this to make sure certain files are copied befire overwritten
+
The compilation will halt if the indicated file does not exist after the command ends. This saves you from waiting for later steps executing when an early step had an error (like a [[leak]]).
==Use Process window==
+
 
You should always leave this on, but it certain cases you don't want to know the progress of your map-compiling.
+
== Use Process window ==
 +
You should always leave this on, but use it in cases where you don't want to know the progress of your map-compiling.
  
 
Finally, press "Go!" to run the compile.
 
Finally, press "Go!" to run the compile.
 +
 +
[[Category:Level Design]]

Latest revision as of 18:39, 12 February 2012



Expert compile mode is a way of using a GUI front end to execute batch scripted compiles. If you know what that means, you probably should not use this, but batch files instead.

Compile process

Once you understand the basics, you might have a clue.

Hammer setmapparam.gif

First observe how the compile process consists of three programs:

  • vbsp.exe builds the map file
  • vvis.exe calculates which parts of your level need to be rendered when the player is at a certain place (using visleafs )
  • vrad.exe lights your map

Also observe you can use three options (1) for each tool. However, if you click on any of the links of the tools, you'll soon realize there are way more. You can only use them with batch scripts (which are basically a bunch of DOS-commands) or the expert compile mode.

See that "Expert" button in the lower left corner? Why don't you press it? Let's get adventuring.

The dialog

Hammer Run Map Expert.png

You'll see a dialog box like the one above show up. Although at first this may seem pretty difficult, it really isn't.

First, we have some "configurations". This is handy, for instance, when you want multiple setups for compiling: one for fast compiling, one for compiling cs:s maps, one for glview etc. You can add, delete, and rename configurations using the "Edit" button right of the selection box.

Each setup holds a number of commands you can use. Normally, these commands are used to run each compile tool, and perhaps deleting, moving, copying or renaming certain files (e.g. moving the map file to game directory, deleting log files, etc). Use the "New" button to add a command. Use the "Remove" button to remove one, and use the "Move up" and "Move down" buttons to change the sequence in which the commands are run. We don't want to copy the map or run the game before it is made for instance. You can use the checkboxes to the left of each command to skip the commands if you wish.

The command

Typically, a command consists of a "Command" and one or more "Parameters". The command shows which action to perform (you can select them using the "Cmds" button). If you want to run a program that's not directly in that list (the tools and the HL2 executable are already there) select "executable" and a dialog will open to browse to any executable. (You can use, but not select batch file here.) Some actions have a strange syntax, like $bsp_exe: hammer will recognise these commands and replace them with the right directories. $bsp_exe will be replaced with the directory to bsp.exe for instance.

For the real nerds: Any DOS command can be used here.

The parameters tell the programs what to do. For instance, which map to compile, or what options to use. Again, the "Parms" button allows you to select a number of variables hammer knows and replaces. Things like the mapfile, or certain directories can be used here. Between multiple parameters, add a space. Examine the "Default" configuration a bit and the compile tools Wiki entries (see above) so you can learn which parameters can be used. Please note that each compile tool needs the directory of the map file to know what file to compile. This should be logical to you. They also have a "game" parameter, telling them which directories to look in to find the stuff they need (textures, models, etc)

Fiddle around with the options, but make sure you have a backup of whatever you are experimenting with. You don't want your maps to be accidentally deleted.

The last two options are

Ensure file post-exists:

The compilation will halt if the indicated file does not exist after the command ends. This saves you from waiting for later steps executing when an early step had an error (like a leak).

Use Process window

You should always leave this on, but use it in cases where you don't want to know the progress of your map-compiling.

Finally, press "Go!" to run the compile.