This article's documentation is for the "GoldSrc" engine. Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

Creating Brush Entities: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (bad nav)
m (Nesciuse moved page Creating Brush Entities/en to Creating Brush Entities without leaving a redirect: Move en subpage to basepage)
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
__NOTOC__
{{LanguageBar}}
{| style="float:right"
{{Goldsource topicon}}{{source topicon}}
|- valign="bottom"
{{first room menu}}
| [[Image:Hammer_primitive_crate.png|thumb|center|Properly-sized cube with 32x32 texture.]] || {{first room menu}}
We have already [[Basic Construction|created brushes]]. There is another side to them: the '''[[brush entity]]'''.
|}
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].


# Select the [[Hammer Block Tool|Block Tool]] [[Image:hammer_block.png|28px]] and create a cube in your map.
In this example, we will create a brush that acts as a sliding door. When the player touches the brush, it will rise into the air and allow passage.
# 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.}}
# 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]].
[[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.
# Select [[Func_breakable|func_breakable]] from the '''Class:''' drop-down menu.
# 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 '''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 '''Physics Impact Damage Scale'''. This scales damage energy when the object is hit by a physics object. {{Note|A value of '''0''' means this feature is disabled. Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.}}
# Click '''Apply''' and close the Object Properties dialog box.
<br style="clear:both">


==Crate Texture==
[[File:Door basic.png|thumb|none|A basic {{ent|func_door}} entity.]]
[[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.
# 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'''.}}


== Construction ==
# Select the {{hammer block}} and create a new brush. 128×128×16 is a good size, but anything will do. {{tip|If Hammer’s grid is too large to get down to 16 units, press {{key|[}} or click '''Smaller Grid''' [[File:Hammer SmallerGrid.png|link=]] to scale it down. Never disable snapping unless you really, ''really'' need to!}}
# Move the brush to an entity (also known as “tying” to an entity) using {{key|Ctrl+T}} or the [[Hammer New Objects Toolbar#toEntity_(Ctrl+T)|toEntity]] button:<p>[[File:Hammer toEntityButton.png|border|Hammer toEntity button|link=]]</p>. {{tip| If you've unselected the brush you wish to tie the entity to you will need to reselect it otherwise the toEntity button will not work when you click on it}}
# This will bring up the [[Hammer Object Properties Dialog|Object Properties]] dialog:<p>[[File:Hammer object properties.png|400px|Object properties dialog]]</p> {{tip|If you need to access the dialog again later, select your brush and press {{key|Alt+Enter}}.}}
# Select [[func_door]] from the “Class” drop-down menu in the top left (you can search by typing into the box) and hit “Apply”.
# Near the bottom of the main “Keyvalues” list, find “Move Direction”. Either change its value to read “<code>-90 0 0</code>” or select “Up” from the drop-down list to the left of the black circle.
# Click “Apply” again, then close the Object Properties dialog.


<br style="clear:both">
You should now be able to compile your map and see the door working.
==External Links==
*[http://www.vadear.com/koko/?p=194 Creating Basic Primitives. On Vadear.com]
{{Navbar|Applying_Textures|Your First Map|Adding Entities}}


{{otherlang:en}}
== Finishing ==
{{otherlang:en:ru|Creating Primitives:ru}},
Open the [[Hammer Texture Browser|Texture Browser]] and [[Hammer Texture Browser#Filter|filter]] for “door”. Choose a material that you like and apply it to your brush as you would normally. You might also want to build a wall that connects the door to the edges of your map.
{{otherlang:en:fr|Creating Primitives:fr}},
{{otherlang:en:zh-cn|Creating Primitives:zh-cn}}


[[Category:Level Design Tutorials]]
[[File:Decorated door.jpg|400px|thumb|none|But don’t get too carried away!]]
 
==Destroying==
To make a brush entity back into a regular one, select it and press {{key|Ctrl+Shift+W}}, or '''ToWorld''', right next to the ToEntity button you clicked earlier.
 
{{Navbar|Adding Point Entities|Your First Map|Adding Light}}
 
[[Category:Hammer]]
[[Category:Level Design]]
 
 
{{stub}}

Latest revision as of 06:01, 12 July 2024

English (en)Français (fr)Magyar (hu)日本語 (ja)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)

We have already created brushes. There is another side to them: the brush entity.

In this example, we will create a brush that acts as a sliding door. When the player touches the brush, it will rise into the air and allow passage.

A basic func_door entity.

Construction

  1. Select the Block tool Hammer block.png and create a new brush. 128×128×16 is a good size, but anything will do.
    Tip.pngTip:If Hammer’s grid is too large to get down to 16 units, press [ or click Smaller Grid Hammer SmallerGrid.png to scale it down. Never disable snapping unless you really, really need to!
  2. Move the brush to an entity (also known as “tying” to an entity) using Ctrl+T or the toEntity button:

    Hammer toEntity button

    .
    Tip.pngTip: If you've unselected the brush you wish to tie the entity to you will need to reselect it otherwise the toEntity button will not work when you click on it
  3. This will bring up the Object Properties dialog:

    Object properties dialog

    Tip.pngTip:If you need to access the dialog again later, select your brush and press Alt+Enter.
  4. Select func_door from the “Class” drop-down menu in the top left (you can search by typing into the box) and hit “Apply”.
  5. Near the bottom of the main “Keyvalues” list, find “Move Direction”. Either change its value to read “-90 0 0” or select “Up” from the drop-down list to the left of the black circle.
  6. Click “Apply” again, then close the Object Properties dialog.

You should now be able to compile your map and see the door working.

Finishing

Open the Texture Browser and filter for “door”. Choose a material that you like and apply it to your brush as you would normally. You might also want to build a wall that connects the door to the edges of your map.

But don’t get too carried away!

Destroying

To make a brush entity back into a regular one, select it and press Ctrl+Shift+W, or ToWorld, right next to the ToEntity button you clicked earlier.



Stub

This article or section is a stub. You can help by expanding it.