func_breakable_surf

From Source Entities
Jump to navigation Jump to search
Func breakable surf.png

Code classes:

func_breakable_surf is a brush entity present in all Source games. It creates a surface that can be broken bit by bit. All faces except one should use the nodraw texture. The face that will be broken must be rectangular. The material applied to the visible face must be set up to be breakable. To do: How?

Note: Despite common misconception, this entity is available and functional in Tf2.png, although without sounds.

There are only a few stock textures set up to work with this entity (using ones without the proper VMT settings may crash the game on startup!):

  • glass/glasswindowbreak070a (but not glass/glasswindowbreak070b!)
  • tile/tilebreak001c (using this will stretch the texture if broken)
  • glass/urban_glass_3 (only available in Csgo-small.png)

Bug: If this entity is placed on the boundary of the default visleaf cuts (indicated by blue/brown lines in Hammer's 2D view), the breaking sound will play from both the entity and the origin of the map (0, 0, 0).

Bug: The visual portion of this entity will be positioned wrong once broken if its origin keyvalue is present in the VMF.

Flags[edit | edit source]

  • 1: Physics damage decals - If a physics object weakly damages the entity, it will leave an impact mark.
  • 2: Take damage from held objects (Hl2.pngP1.pngP2.png)

Keyvalues[edit | edit source]

Fragility (fragility) <integer>
If the Surface Type is set to Glass, this value sets how fragile the glass pieces are after the surface has been broken.
Surface Type (surfacetype) <choices>
Surface material type.
  • 0: Glass
  • 1: Tile
error (Not in FGD) (error) <choices>
Set automatically by Hammer to indicate an invalid glass/tile surface, when non-zero the entity will be removed when spawned, and a error message will be thrown in the console.
  • 0: No Error
  • 1: Multiple Textured Faces (Only one side of the brush can be textured. You must use tools/toolsnodraw to nodraw the 5 remaining sides.[Confirmed])
  • 2: Non-Square Face

Inputs[edit | edit source]

Shatter <string>
Shatters the window. Takes 3 numbers. The first two are the X and Y coords of the impact (as values from 0 to 1). The third is the radius of the shatter, in hammer units.