Entity creation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(move ?)
 
(27 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Level Design]]
{{LanguageBar|title=Entity creation in Hammer}}
Entities give life to your level. They are the monsters, doors, switches and lights that turn your static architecture into an interactive environment. Careful use of entities is critical to creating an interesting, unique and fun level for others to play.


Unlike solids, entities are not created within Hammer. Most users will simply choose from a pre-existing set of entities provided. Once you have selected the appropriate entity, Hammer gives you control over its placement and other properties.
Entities are the monsters, doors, switches and lights that turn your static architecture into an interactive environment. The available selection depends on the game for which you are mapping.


There are two types of entities: point-based and brush-based.
This article covers how to add them to your map.


Point-based entities exist only at a certain exact point. Examples include lights, monsters, and player start points. (Monsters <i>do</i> have an area, but it is defined by the game code and is not modifiable from within the map.) Some point type entities are just that: points. For example, the <code>env_beam</code> entity, which controls Half-Life's beam effects, uses two <code>info_target</code> entities as targets and the beam of light runs between these two points.
== Point entity placement ==


Brush-based entities are entities that depend on either a brush for their physical presence (like doors, trains, and other moving entities) or an "area" (like triggers, which require an activation field).
[[File:Hammer_newentity.png|frame|right|Select an entity to place using the New Objects toolbar.]]


=Point-based entity placement=
Placement of [[Point entity|point entities]] is simple:


Placement of point entities is simple:
# Select the [[Hammer Entity Tool|Entity Tool]] or press {{key|Shift+E}}.
 
# From the [[Hammer New Objects Toolbar|New Objects toolbar]], select the entity you want from the "Objects" selection box (which supports text search). If you can't find what you want in the list, it may be a brush entity.
# Select the Entity Tool.
# From the New Objects toolbar, select the entity you want from the '''Objects''' selection box. '''Note:''' the entity list in the '''New Objects''' dialog is for point-based entities only. For information on brush-based entities, please refer to the next section.
# Click in a 2D window, then position the entity cursor with the mouse. You can also click on a brush surface in the 3D view, and the point entity will be created there.
# Click in a 2D window, then position the entity cursor with the mouse. You can also click on a brush surface in the 3D view, and the point entity will be created there.
# Pressing Enter will create the entity.
# Pressing <code>Enter</code> will create the entity.
# Fine tune the entity position in the 2D and 3D views.
# Fine tune the entity position in the 2D and 3D views.
# Choose Properties under the '''Edit''' menu if you wish to edit the entity parameters.
# Choose Properties under the [[Hammer Edit Menu|Edit menu]] if you wish to edit the entity parameters.
 
{{tip|You can also use the shortcut <code>Alt+Enter</code> to open the [[Hammer Object Properties Dialog|Object Properties]] dialog box for the current selection.}}


'''Tip:''' You can also use the shortcut ALT+ENTER to open the Object Properties dialog box for the current selection.
== Brush entity creation ==


=Brush-based entity creation=
[[File:Hammer_objectproperties1.png|thumb|right|Select an entity for the solid from the Class list in Object Properties dialog.]]


Brush-based entities are a bit more complicated than point-based entities, but should not pose any difficulties once you know their basics.
[[Brush entity|Brush entities]] are a bit more complicated than point-based entities, but should not pose any difficulties once you know their basics.


# Create a brush where you would like it. You can use as many brushes as you'd like when building a brush-based entity.
# [[Basic Construction|Create a brush]], or as many as you like.
# Select the entire object.
# Select everything you want to form the entity.
# Select Tie to Entity from the '''Tools''' menu, or Press the Ctrl+T hotkey. This will turn the selected objects into a brush based entity.
# Select "Tie to Entity" from the [[Hammer Tools Menu|Tools Menu]], or press the {{key|Ctrl+T}} shortcut. This will turn the selected objects into a brush based entity.
# In the Object Properties dialog, select the appropriate entity from the '''Class''' list box. Once the entity type is selected, you can modify the entity properties as needed.
# In the Object Properties dialog, select the appropriate entity from the "Class" list box. Once the entity type is selected, you can modify the entity properties as needed.


'''Tip:''' You can bring up the '''Object Properties''' for a brush-based entity the same way you do for a point-based entity: select it and press ALT+ENTER.
{{tip|You can access the Object Properties dialog for a brush-based entity the same way you do for a point-based entity: select it and press <code>Alt+Enter</code>. '''''This will not work when the [[Hammer Selection Modes Toolbar|selection mode]] is "Solids"!'''''}}


You will notice that brush-based entities appear as a different color in the 2D windows, typically purple.
You will notice that brush-based entities appear as a different color in the 2D windows, typically purple.


=Combining Solid Entities=
=== Combining solid entities ===
 
You can add new brushes to an existing brush entity, even if they are already tied to another one:


Multiple solid entities can be also combined into a single entity:
# Select the brushes you wish to combine.
# Select "Tie to Entity" from the Tools menu, or press {{key|Ctrl+T}}.
# If you have selected more than one brush entity a dialog will open with a list of them to choose from. Select the one you wish to keep for the final, combined entity (it will be highlighted in the 2D and 3D Views when selected) and press OK.


# Select the entities or brushes you wish to combine.
The Object Properties dialog will then appear, allowing you to change the parameters for the combined entity.
# Select Tie to Entity from the '''Tools Menu''', or press CTRL+T.
# A dialog will open with a list of entities in the current selection. Choose which of the entities you wish to keep for the final, combined entity. Select one of the entities, and that entity will also be highlighted in the 2D and 3D Views. Click '''OK''' to confirm your choice.
# The '''Object Properties''' dialog will appear, allowing you to change the parameters for the combined entity.


== Using entities ==


© 2004 Valve Corporation. All rights reserved. Valve, the Valve logo, Half-Life, the Half-Life logo, the Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the Counter-Strike logo, Source, the Source logo, Hammer and Counter-Strike: Condition Zero are trademarks and/or registered trademarks of Valve Corporation. Microsoft and Visual Studio are trademarks and/or registered trademarks of Microsoft Corporation.  All other trademarks are property of their respective owners.
* You can move and rotate entities in the same manner as brushes. But you can't resize point entities.
* Entities can be manipulated when the map is running with the [[Inputs and outputs|I/O system]].
* You can change which type of entity each entity is at any time. KeyValues shared between the first and second types will be preserved.
 
== See also ==
* [[Basic Construction]]
* [[Inputs and Outputs]]
* [[Hammer Entity Tool]]
* [[Entity parameters inputs outputs]] - List of entities parameters, Inputs and Outputs (Advanced stuff)
[[Category:Level Design]]

Latest revision as of 09:05, 26 April 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)

Entities are the monsters, doors, switches and lights that turn your static architecture into an interactive environment. The available selection depends on the game for which you are mapping.

This article covers how to add them to your map.

Point entity placement

Select an entity to place using the New Objects toolbar.

Placement of point entities is simple:

  1. Select the Entity Tool or press Shift+E.
  2. From the New Objects toolbar, select the entity you want from the "Objects" selection box (which supports text search). If you can't find what you want in the list, it may be a brush entity.
  3. Click in a 2D window, then position the entity cursor with the mouse. You can also click on a brush surface in the 3D view, and the point entity will be created there.
  4. Pressing Enter will create the entity.
  5. Fine tune the entity position in the 2D and 3D views.
  6. Choose Properties under the Edit menu if you wish to edit the entity parameters.
Tip.pngTip:You can also use the shortcut Alt+Enter to open the Object Properties dialog box for the current selection.

Brush entity creation

Select an entity for the solid from the Class list in Object Properties dialog.

Brush entities are a bit more complicated than point-based entities, but should not pose any difficulties once you know their basics.

  1. Create a brush, or as many as you like.
  2. Select everything you want to form the entity.
  3. Select "Tie to Entity" from the Tools Menu, or press the Ctrl+T shortcut. This will turn the selected objects into a brush based entity.
  4. In the Object Properties dialog, select the appropriate entity from the "Class" list box. Once the entity type is selected, you can modify the entity properties as needed.
Tip.pngTip:You can access the Object Properties dialog for a brush-based entity the same way you do for a point-based entity: select it and press Alt+Enter. This will not work when the selection mode is "Solids"!

You will notice that brush-based entities appear as a different color in the 2D windows, typically purple.

Combining solid entities

You can add new brushes to an existing brush entity, even if they are already tied to another one:

  1. Select the brushes you wish to combine.
  2. Select "Tie to Entity" from the Tools menu, or press Ctrl+T.
  3. If you have selected more than one brush entity a dialog will open with a list of them to choose from. Select the one you wish to keep for the final, combined entity (it will be highlighted in the 2D and 3D Views when selected) and press OK.

The Object Properties dialog will then appear, allowing you to change the parameters for the combined entity.

Using entities

  • You can move and rotate entities in the same manner as brushes. But you can't resize point entities.
  • Entities can be manipulated when the map is running with the I/O system.
  • You can change which type of entity each entity is at any time. KeyValues shared between the first and second types will be preserved.

See also