Creating Brush Entities: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See Also: external links)
m (formatting (not sure if better))
Line 1: Line 1:
__NOTOC__{{first room menu}}
__NOTOC__
{| style="float:right"
|- valign="bottom"
| [[Image:Hammer_primitive_crate.png|thumb|center|Properly-sized cube with 32x32 texture.]] || {{first room menu}}
|}
In Hammer, a [[Primitives|Primitive]] is a relatively simple brush object.  Primitives can be world geometry or interactive entities subject to physics & damage. In this example, we will create an interactive primitive, subject to physics & damage in the map: specifically, a 32 unit [http://www.oldmanmurray.com/features/39.html crate].
In Hammer, a [[Primitives|Primitive]] is a relatively simple brush object.  Primitives can be world geometry or interactive entities subject to physics & damage. In this example, we will create an interactive primitive, subject to physics & damage in the map: specifically, a 32 unit [http://www.oldmanmurray.com/features/39.html crate].


<br style="clear:both">
# Select the [[Hammer Block Tool|Block Tool]] [[Image:hammer_block.png|28px]] and create a cube in your map.
# Select the [[Hammer Block Tool|Block Tool]] [[Image:hammer_block.png|28px]] and create a cube in your map.
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''dev crate'''.  '''Dev/dev_measurecrate02''' should be a 32x32 crate texture.[[Image:Hammer_primitive_crate.png|thumb|left|Properly-sized cube with 32x32 texture.]]
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''dev crate'''.  '''Dev/dev_measurecrate02''' should be a 32x32 crate texture.
# Apply the '''dev/dev_measurecrate02''' texture to your cube. {{Note|If the grid on your 2D views is too large to get down to 32 units, press the <code>[</code> key or click the '''Smaller Grid''' button [[Image:Hammer_SmallerGrid.png]] to create smaller objects on the grid.}}
# Apply the '''dev/dev_measurecrate02''' texture to your cube. {{Note|If the grid on your 2D views is too large to get down to 32 units, press the <code>[</code> key or click the '''Smaller Grid''' button [[Image:Hammer_SmallerGrid.png]] to create smaller objects on the grid.}}
# Resize your cube using the [[Hammer Selection Tool|Selection Tool]] [[Image:hammer_select.png|28px]] until the texture fits properly on the cube. {{Note|To this point, creating primitives for world geometry and for interactive objects is the same.  In order to specify whether our crate is, indeed, world geometry or an interactive object, we must select it and move it either [[Hammer_New_Objects_Toolbar#toWorld_.3CCtrl.2BShift.2BW.3E|toWorld]] or [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]].}}[[Image:hammer_toEntityButton.png|right|thumb|150px|'''toEntity''' button ('''Ctrl+T''')]]
# Resize your cube using the [[Hammer Selection Tool|Selection Tool]] [[Image:hammer_select.png|28px]] until the texture fits properly on the cube. {{Note|To this point, creating primitives for world geometry and for interactive objects is the same.  In order to specify whether our crate is, indeed, world geometry or an interactive object, we must select it and move it either [[Hammer_New_Objects_Toolbar#toWorld_.3CCtrl.2BShift.2BW.3E|toWorld]] or [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]].}}[[Image:hammer_toEntityButton.png|right|thumb|150px|'''toEntity''' button ('''Ctrl+T''')]]
# Select the crate using the [[Hammer Selection Tool|Selection Tool]].
# Select the crate using the [[Hammer Selection Tool|Selection Tool]].
[[Image:Hammer_object_properties.png|right|thumb|300px|func_breakable object properties]]
# Click the [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]] button to tie a [[List_of_entities#Function_.28brush.29_entities|function]] to the primitive. This will bring up the [[Hammer_Object_Properties_Dialog|Object Properties]] dialog box.
# Click the [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]] button to tie a [[List_of_entities#Function_.28brush.29_entities|function]] to the primitive. This will bring up the [[Hammer_Object_Properties_Dialog|Object Properties]] dialog box.
# Select [[Func_breakable|func_breakable]] from the '''Class:''' drop-down menu.
# Select [[Func_breakable|func_breakable]] from the '''Class:''' drop-down menu.
# Under '''Keyvalues''', select '''Name''' and name your crate something descriptive. [[Image:Hammer_object_properties.png|right|thumb|300px|func_breakable object properties]]
# Under '''Keyvalues''', select '''Name''' and name your crate something descriptive.  
# Under '''Keyvalues''', select '''Strength'''. The Strength value specifies how much damage the crate can take before breaking. Set the value to '''1'''.
# Under '''Keyvalues''', select '''Strength'''. The Strength value specifies how much damage the crate can take before breaking. Set the value to '''1'''.
# Under '''Keyvalues''', select '''Material Type'''. The material type specifies the sounds the crate will make and also what type of gibs it will break into.  Select '''Wood''' from the drop-down menu.
# Under '''Keyvalues''', select '''Material Type'''. The material type specifies the sounds the crate will make and also what type of gibs it will break into.  Select '''Wood''' from the drop-down menu.
Line 18: Line 22:


==Crate Texture==
==Crate Texture==
[[Image:Hammer_primitive_crate2.png|thumb|315px|left|Textured functional crate]]
Once our crate is correctly sized, we can apply a proper texture to it using the same technique we used previously.
Once our crate is correctly sized, we can apply a proper texture to it using the same technique we used previously.
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''crate'''.
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''crate'''.
# Select '''props/woodcrate001a''' and apply it to your cube.  You may have to use the Face Edit Sheet to fit the texture to the cube. {{Note|Ensure that the texture is aligned to '''Face'''.}}
# Select '''props/woodcrate001a''' and apply it to your cube.  You may have to use the Face Edit Sheet to fit the texture to the cube. {{Note|Ensure that the texture is aligned to '''Face'''.}}
[[Image:Hammer_primitive_crate2.png|thumb|315px|left|Textured functional crate]]





Revision as of 17:28, 19 March 2009

Properly-sized cube with 32x32 texture.

In Hammer, a Primitive is a relatively simple brush object. Primitives can be world geometry or interactive entities subject to physics & damage. In this example, we will create an interactive primitive, subject to physics & damage in the map: specifically, a 32 unit crate.

  1. Select the Block Tool Hammer block.png and create a cube in your map.
  2. Open the Texture Browser and filter for dev crate. Dev/dev_measurecrate02 should be a 32x32 crate texture.
  3. Apply the dev/dev_measurecrate02 texture to your cube.
    Note.pngNote:If the grid on your 2D views is too large to get down to 32 units, press the [ key or click the Smaller Grid button Hammer SmallerGrid.png to create smaller objects on the grid.
  4. Resize your cube using the Selection Tool Hammer select.png until the texture fits properly on the cube.
    Note.pngNote:To this point, creating primitives for world geometry and for interactive objects is the same. In order to specify whether our crate is, indeed, world geometry or an interactive object, we must select it and move it either toWorld or toEntity.
    toEntity button (Ctrl+T)
  5. Select the crate using the Selection Tool.
func_breakable object properties
  1. Click the toEntity button to tie a function to the primitive. This will bring up the Object Properties dialog box.
  2. Select func_breakable from the Class: drop-down menu.
  3. Under Keyvalues, select Name and name your crate something descriptive.
  4. Under Keyvalues, select Strength. The Strength value specifies how much damage the crate can take before breaking. Set the value to 1.
  5. Under Keyvalues, select Material Type. The material type specifies the sounds the crate will make and also what type of gibs it will break into. Select Wood from the drop-down menu.
  6. Under Keyvalues, select Physics Impact Damage Scale. This scales damage energy when the object is hit by a physics object.
    Note.pngNote:A value of 0 means this feature is disabled. Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.
  7. Click Apply and close the Object Properties dialog box.


Crate Texture

Textured functional crate

Once our crate is correctly sized, we can apply a proper texture to it using the same technique we used previously.

  1. Open the Texture Browser and filter for crate.
  2. Select props/woodcrate001a and apply it to your cube. You may have to use the Face Edit Sheet to fit the texture to the cube.
    Note.pngNote:Ensure that the texture is aligned to Face.



External Links


Template:Otherlang:en Template:Otherlang:en:fr Template:Otherlang:en:zh-cn