Creating Brush Entities

From Valve Developer Community
Jump to: navigation, search
Français Magyar Русский 简体中文

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: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

  3. This will bring up the Object Properties dialog:

    Object properties dialog

    Tip: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!



Your First Map
Adding Point Entities
Adding Light