Hammer Cordon Usage: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Unicodifying, replaced: [[Image: → [[File: (8))
 
(37 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{todo|Merge page better}}
{{lang|Hammer Cordon Usage}}
=== [[Image:mo-togglecordon.png]] Toggle Cordon State ===
==Overview of the Hammer Cordon Tool==


This function will toggle the visibility and effect of a cordon area you have created with the '''Edit Cordon Bounds''' tool. When the '''Toggle Cordon State''' is activated, a thick red line will appear around that area. When you compile, only the inside of that red area will be compiled, and a box will be placed around the area to seal leaks. With the button deactivated, the cordon area will not be visible, and the compile will be unaffected by the cordon. See Edit Cordon Bounds for information on how to create and edit cordon areas.
[[File:Toolbar cordon circled.PNG|center]]


=== [[Image:mo-editcordon.png]] Edit Cordon Bounds ===
The cordon tool is used to limit the map area to be compiled to a smaller area in order to either save compile time, test areas individually without interference from their surroundings, or to find the location of an unknown problem.


This function allows you to "cordon off" an area in order to test compile a section of the map file. When the Toggle Cordon State is activated, a thick red line will appear around that area. When you compile, only the objects inside of that red area will be compiled, and a black box will be placed around the area to seal leaks.
Compiling with cordon boundaries set will compile only the area within the cordon bounds (safely enclosing this area in a sealed box to prevent leaks).


This is extremely useful when you are working on a large level and want to look at changes made in only a small area. Rather than wait a considerable amount of time for the entire map to compile, you can selectively compile only a small area by using the cordon functions.
== General usage ==


This function allows you to create new cordon boundaries, or edit existing ones. After enabling Edit Cordon Bounds, the editing handles of a cordon area will become active. Drag the boundary handles to a new area to change the size of the area. Select an different editing tool to deactivate Edit Cordon Bounds and make the changes to the cordon area.
Using the cordon tool allows the developer to compile only one room, or test lighting in a particular area, without having to compile the entire map. Excluding large or complex areas in this way can save a considerable amount of compilation time.


To create a new cordon area:
Cordons can also be used to eliminate areas from compilation when trying to find the location of a problem. This can be done by gradually decreasing the size of the cordoned area until the problem is eliminated, defining the area in which the problem must be. It is also possible to move the cordoned area around the map until the problem is found or eliminated.


# Select the Edit Cordon Bounds button on the [[Hammer Map Operations Toolbar|Map Operations Toolbar]]. The Toggle Cordon State button will also automatically activate.
They can also be used to eliminate extra and confusing geometry from other rooms that overlap each other in the 2D views. Cordoning off one area can allow you to focus on the details of a particular room.
# Drag a selection box in one of the 2D views.
# Resize the selection box as necessary, in any of the 2D views.
# Select any other editing tool from the [[Hammer Map Tools Toolbar|Map Tools Toolbar]] to finish creating the cordon area. The Toggle Cordon State button will remain active.
{{tip|Make sure a player start point lies within the bounds of the cordoned area before you run a test compile, otherwise the game will place the player at the world origin when you load the map in the game engine.}}


[[Image:cordon1.png]]
=== Localized starting points ===


To edit an existing cordon area:
The cordon area does often not include the original starting point (the {{ent|info_player_start}}, {{ent|info_player_teamspawn}}, {{ent|info_player_deathmatch}}, or similar entity) of the map, and running a map without compiling a starting point will place the player at the world origin (0,0,0) in-game by default. You could, of course, prevent this by moving the original starting point back and forth between the original position and different cordon areas, but a less tedious solution in the long run is to place another starting entity in the cordon area.


# Select the Edit Cordon Bounds button on the [[Hammer Map Operations Toolbar|Map Operations Toolbar]]. The Toggle Cordon State button will also automatically activate.
Using several <code>info_player_start</code> entities will normally cause problems running the map in a single-player game when the cordon state is turned off again. The player will spawn at the first spawnpoint found in the map file, which could be any of the added entities. To force spawning at a particular position, set the ''Master'' spawnflag of the original <code>info_player_start</code> to indicate which one should be used when running the entire map. All other spawn points will be ignored when the game looks for possible spawn locations.
# Drag the handles of the selection box in any of the 2D views to change the size of the cordon area.
{{tip|{{in|{{tf2}}}} <code>info_player_teamspawn</code> entities automatically override <code>info_player_start</code> entities.}}
# Click-drag in the center of the selection box to move the entire box at once.
# Select any other editing tool from the [[Hammer Map Tools Toolbar|Map Tools Toolbar]] to finish editing the cordon area. The Toggle Cordon State button will remain active.


=Compiling=
== [[File:mo-editcordon.png]] Edit Cordon Bounds ==
Compiling with cordon boundaries set will compile only the part of the map you have selected. Say you want to compile one room, or want to test out some lighting; you can compile that small area without compiling the rest of the map, and without waiting for a full or even fast vis compile of the whole map. You can also use cordons to eliminate areas when trying to find the location of a problem.


==Use==
[[File:CordonSelected.gif|thumb|271px|A selected cordon with its handles.]]


To use cordon boundaries first load the map you want to compile. Then look on the tool bar for an icon representing a black and yellow box.
This function is used to set, or alter, boundaries of an area to "cordon off". Only objects that are at least partially within these boundaries will be compiled, and a box using the assigned cordon texture will be placed along these boundaries to seal leaks.


[[Image:Cordon1.jpg|center]]
=== To create a new cordon area ===


Of the two buttons shown circled in the image, click the '''Cordon Edit''' button (the hollowed out yellow and black square on the right). Then go to 2D views and draw the box around the part of the map you want to compile. The box is a cube shape, so you must use two different 2D views to alter the height, width, and depth of the cube to fit the section you wish to cordon.
# Select the '''Edit cordon bounds''' button on the [[Hammer Map Operations Toolbar|Map Operations Toolbar]].
# Drag a selection box in one of the 2D views around the section you wish to compile.
# As the cordon area is a 3D cube, you may find it necessary to resize the height, width, and/or depth of it (in any of the 2D views) to fit the intended area.
# Select any other editing tool from the [[Hammer Map Tools Toolbar|Map Tools Toolbar]] to finish creating the cordon area.
# Make sure that the cordon area includes at least one starting point for the player(s).


Once the area you want compiled is boxed off, the '''Cordon Toggle''' button (fully colored in black and yellow) will become active.
=== To edit an existing cordon area ===


Now compile, and if the cordon area small enough, it will take considerably less time then it did with the whole map.
# Select the '''Edit cordon bounds''' button on the [[Hammer Map Operations Toolbar|Map Operations Toolbar]].
# To resize a cordon area, drag its boundary handles in any of the 2D views.
# To move a cordon area, click-drag in the center of the selection box.
# Select any other editing tool from the [[Hammer Map Tools Toolbar|Map Tools Toolbar]] (like the ''Selection tool'', for instance) to finish editing the cordon area.
# Make sure that the cordon area still includes at least one starting point for the player(s).


:{{note|You '''must''' include a start point (an [[info_player_start]] or an [[info_player_deathmatch]]) inside your cordon boundary or else your map will not work.}}
== [[File:mo-togglecordon.png]] Toggle Cordon State ==


[[Image:Cordon2.jpg|thumb|left|300px|Cordon boundaries selected.]][[Image:Cordon3.jpg|thumb|left|300px|Cordon boundaries activated.]]<br style="clear:both">
[[File:CordonStateLine.gif|thumb|271px|A cordon while the cordon state is activated.]]


==Changing the cordon wall texture==
This function will toggle the cordon state i.e. the effect and visibility of the cordon area (created with the '''Edit cordon bounds''' tool).


[[Image:Cordon4.gif|thumb|200px|right]]
While the cordon state is active, the compiler will only compile the cordoned off area. The objects which will be included in the compile will be reflected in the 3D view, boundaries of the cordon area will also be outlined by a thick red line, like the pictures below show.


One downside of the cordon tool is the annoying black and purple texture that represents the cordon boundary in the 3D view. It can make you sick after moving around a lot. Fortunately, it can easily be changed to a different texture by changing the cordon material.
[[File:CordonStateNotActive.jpg|thumb|left|200px|Cordon state inactive.]]
[[File:CordonStateActive.jpg|thumb|left|200px|Cordon state active.]]
{{clr}}
 
With the cordon state deactivated, the compiler will compile the entire map as normal, and the cordon area will not be visible. (See [[#Edit Cordon Bounds|Edit Cordon Bounds]] above for information on how to create and edit cordon areas.)
 
{{note|While mapping with the cordon state active, and an entity is moved passed the cordon boundaries, the entity will disappear. It isn't removed from the map, just hidden by the cordon curtain. But you'll have to deactivate cordon to retrieve the entity.}}
 
== Changing the cordon wall texture ==
 
[[File:HammerConfigCordonHighlighted.png|thumb|caption|200px|right|The ''Cordon texture'' option.]]
 
If the cordon boundary is showing incorrectly in-game (as a black and pink checkerboard), this means an invalid material is chosen as the cordon texture. This texture can easily be changed by choosing a different material for the cordon:


# Go to '''[[Hammer Tools Menu|Tools]] > [[:Category:Hammer Options Dialog|Options...]] > [[Hammer Game Configurations|Game Configurations]]''' tab.
# Go to '''[[Hammer Tools Menu|Tools]] > [[:Category:Hammer Options Dialog|Options...]] > [[Hammer Game Configurations|Game Configurations]]''' tab.
# Click '''Browse''' by Cordon texture field.
# Locate the '''Cordon texture''' field, and click the '''Browse...''' button next to it, to open the texture browser.
# Double-click to select a different texture. The <code>tools/[[tool textures#skybox|toolsskybox]]</code> texture works well, but you need to make sure you have a [[light_environment]] in the bounds for the skybox texture to light the world properly after compile.
# Double-click to select a different texture. The <code>tools/[[tool textures#skybox|toolsskybox]]</code> texture works well, but you need to make sure you have a [[light_environment]] in the bounds for the skybox texture to light the world properly after compile.


[[Category:Level Design Tutorials]]
{{tip|The <code>tools/[[tool textures#skybox|toolsblack]]</code> material also makes a good choice for a cordon texture, especially if the light emitting from a <code>toolsskybox</code> material is undesirable (such as in an underground environment).}}
 
[[Category:Level Design]]
[[Category:Tutorials]]
[[Category:Hammer Tools]]
[[Category:Hammer Tools]]

Latest revision as of 00:05, 7 January 2024

English (en)Deutsch (de)Русский (ru)Translate (Translate)

Overview of the Hammer Cordon Tool

Toolbar cordon circled.PNG

The cordon tool is used to limit the map area to be compiled to a smaller area in order to either save compile time, test areas individually without interference from their surroundings, or to find the location of an unknown problem.

Compiling with cordon boundaries set will compile only the area within the cordon bounds (safely enclosing this area in a sealed box to prevent leaks).

General usage

Using the cordon tool allows the developer to compile only one room, or test lighting in a particular area, without having to compile the entire map. Excluding large or complex areas in this way can save a considerable amount of compilation time.

Cordons can also be used to eliminate areas from compilation when trying to find the location of a problem. This can be done by gradually decreasing the size of the cordoned area until the problem is eliminated, defining the area in which the problem must be. It is also possible to move the cordoned area around the map until the problem is found or eliminated.

They can also be used to eliminate extra and confusing geometry from other rooms that overlap each other in the 2D views. Cordoning off one area can allow you to focus on the details of a particular room.

Localized starting points

The cordon area does often not include the original starting point (the info_player_start, info_player_teamspawn, info_player_deathmatch, or similar entity) of the map, and running a map without compiling a starting point will place the player at the world origin (0,0,0) in-game by default. You could, of course, prevent this by moving the original starting point back and forth between the original position and different cordon areas, but a less tedious solution in the long run is to place another starting entity in the cordon area.

Using several info_player_start entities will normally cause problems running the map in a single-player game when the cordon state is turned off again. The player will spawn at the first spawnpoint found in the map file, which could be any of the added entities. To force spawning at a particular position, set the Master spawnflag of the original info_player_start to indicate which one should be used when running the entire map. All other spawn points will be ignored when the game looks for possible spawn locations.

Tip.pngTip:(in Team Fortress 2) info_player_teamspawn entities automatically override info_player_start entities.

Mo-editcordon.png Edit Cordon Bounds

A selected cordon with its handles.

This function is used to set, or alter, boundaries of an area to "cordon off". Only objects that are at least partially within these boundaries will be compiled, and a box using the assigned cordon texture will be placed along these boundaries to seal leaks.

To create a new cordon area

  1. Select the Edit cordon bounds button on the Map Operations Toolbar.
  2. Drag a selection box in one of the 2D views around the section you wish to compile.
  3. As the cordon area is a 3D cube, you may find it necessary to resize the height, width, and/or depth of it (in any of the 2D views) to fit the intended area.
  4. Select any other editing tool from the Map Tools Toolbar to finish creating the cordon area.
  5. Make sure that the cordon area includes at least one starting point for the player(s).

To edit an existing cordon area

  1. Select the Edit cordon bounds button on the Map Operations Toolbar.
  2. To resize a cordon area, drag its boundary handles in any of the 2D views.
  3. To move a cordon area, click-drag in the center of the selection box.
  4. Select any other editing tool from the Map Tools Toolbar (like the Selection tool, for instance) to finish editing the cordon area.
  5. Make sure that the cordon area still includes at least one starting point for the player(s).

Mo-togglecordon.png Toggle Cordon State

A cordon while the cordon state is activated.

This function will toggle the cordon state i.e. the effect and visibility of the cordon area (created with the Edit cordon bounds tool).

While the cordon state is active, the compiler will only compile the cordoned off area. The objects which will be included in the compile will be reflected in the 3D view, boundaries of the cordon area will also be outlined by a thick red line, like the pictures below show.

Cordon state inactive.
Cordon state active.

With the cordon state deactivated, the compiler will compile the entire map as normal, and the cordon area will not be visible. (See Edit Cordon Bounds above for information on how to create and edit cordon areas.)

Note.pngNote:While mapping with the cordon state active, and an entity is moved passed the cordon boundaries, the entity will disappear. It isn't removed from the map, just hidden by the cordon curtain. But you'll have to deactivate cordon to retrieve the entity.

Changing the cordon wall texture

The Cordon texture option.

If the cordon boundary is showing incorrectly in-game (as a black and pink checkerboard), this means an invalid material is chosen as the cordon texture. This texture can easily be changed by choosing a different material for the cordon:

  1. Go to Tools > Options... > Game Configurations tab.
  2. Locate the Cordon texture field, and click the Browse... button next to it, to open the texture browser.
  3. Double-click to select a different texture. The tools/toolsskybox texture works well, but you need to make sure you have a light_environment in the bounds for the skybox texture to light the world properly after compile.
Tip.pngTip:The tools/toolsblack material also makes a good choice for a cordon texture, especially if the light emitting from a toolsskybox material is undesirable (such as in an underground environment).