CBreakable

From Source Entities
Jump to navigation Jump to search

Code classes:

CBreakable is a class inherited by breakable brush entities in Source.

Classnames:

  • func_breakable

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
func_break_max_pieces15Arbitrary numberMaximum amount of gibs a breakable can produce.
func_break_reduction_factor0.5MultiplierIf a breakable is using Reduced gibs for Performance Mode, this number will be the fraction that the gibs are reduced to.

Flags[edit | edit source]

  • 1: Only Break on Trigger (Break input)
  • 2: Break on Touch
  • 4: Break on Pressure (when something is on top of this entity)
  • 512: Break immediately on Physics (any physics damage will break the brush)
  • 1024: Don't take physics damage
  • 2048: Don't allow bullet penetration - When a bullet hits a glass-textured face of this entity, the bullet will pass through the brush if it's less than 16 units thick, unless this flag is checked. Does not work in Css.pngCsgo-small.pngL4d.pngL4d2-small.png.Tested in: Css.pngCsgo-small.pngL4d.pngL4d2-small.pngP2.pngHl2.png

Keyvalues[edit | edit source]

Prop Data (propdata) <choices>
Set to the best approximation of the size and material of this entity's brushes. If set, this will override Strength and Material Type and may change how much damage the entity takes from some weapons. See prop_data base types for what each entry specifies.
Note: Some settings can make the brush unbreakable.
  • 0: None
  • 1: Wooden.Tiny
  • 2: Wooden.Small
  • 3: Wooden.Medium
  • 4: Wooden.Large
  • 5: Wooden.Huge
  • 6: Metal.Small
  • 7: Metal.Medium
  • 8: Metal.Large
  • 9: Cardboard.Small
  • 10: Cardboard.Medium
  • 11: Cardboard.Large
  • 12: Stone.Small
  • 13: Stone.Medium
  • 14: Stone.Large
  • 15: Stone.Huge
  • 16: Glass.Small
  • 17: Plastic.Small
  • 18: Plastic.Medium
  • 19: Plastic.Large
  • 20: Pottery.Small
  • 21: Pottery.Medium
  • 22: Pottery.Large
  • 23: Pottery.Huge
  • 24: Glass.Window
Strength/Health (health) <integer>
How much damage to take before breaking. The brush will not break from damage if this is 0.
Material Type (material) <choices>
Material type of the brush. Decides what sounds to make when damaged, and what gibs to produce when broken.
  • 0: Glass
  • 1: Wood
  • 2: Metal
  • 3: Flesh - Tile sound, HL1 flesh gib sound on break, wood gibs
  • 4: CinderBlock - Concrete
  • 5: Ceiling Tile - Tile sound, HL1 plaster gib sound on break, wood gibs
  • 6: Computer - Metal sounds, spark sound and effect, wood gibs
  • 7: Unbreakable Glass - Not breakable. Makes cartoon-y bullet sound.
  • 8: Rocks - Rock/concrete
  • 9: Web (Not in FGD) - Only functional in Half Life: Source.
  • 10: None - Wood gibs
Gibs Direction (explosion) <choices>
Used to decide which direction to throw gibs when broken.
  • 0: Random
  • 1: Relative to Attack
  • 2: Use Precise Gib Dir (see below)
Precise Gib Direction (gibdir) <angle>
An exact direction in which to throw gibs when breaking. Be sure to select Use Precise Gib Dir in Gibs Direction!
Damaging it Doesn't Push It (nodamageforces) <boolean>
If this entity is physically simulated, (like func_physbox) setting this to Yes will make the entity not move when damaged.
Gib Model (gibmodel) <string>
Used only for Half-Life: Source.
Spawn On Break (spawnobject) <choices>
When broken, an entity of the selected type will be created.
Explode Magnitude (explodemagnitude) <integer>
Does not work.
Performance Mode (PerformanceMode) <choices>
Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
  • 0: Normal
  • 1: No Gibs
  • 2: Full Gibs on All Platforms (including Xbox 360, PS3, etc) - Useless for community mappers.
  • 3: Reduced gibs
Min Damage to Hurt (minhealthdmg) <integer>
If a single hit to the object doesn't do at least this much damage, the entity won't take any of the damage from that hit.
Pressure Delay (PressureDelay) <float>
Seconds to delay breaking from pressure if Break on Pressure is checked. Allows creaking/groaning sounds to play.
Physics Impact Damage Scale (physdamagescale) <float>
Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.
Explosion Damage (ExplodeDamage) <float>
Not in code.
Explosion Radius (ExplodeRadius) <float>
Not in code.
Shadows (Not in FGD) (vrad_brush_cast_shadows) <choices>
Determines if this entity will cast lightmap shadows.
  • 0: No shadows
  • 1: Cast shadows
Render Mode (rendermode) <choices>
A special rendering mode to use on this entity.
Render Amount/Transparency (renderamt) <integer>
Transparency amount, requires a Render Mode (rendermode) other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color channel filter to add to this entity's texture(s). Bug: P2.pngCsgo-small.pngBroken for brush entities.
Render FX (renderfx) <choices>
Preset appearance effects. Partially supported in Asw.png, completely non-functional in P2.pngCsgo-small.png. Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
Minimum Light (_minlight) <float>
Minimum amount of light to hit this brush. 0 is none, 1 is "fullbright". Useful because the lightmaps will not update as the entity moves.
Render in Fast Reflections (drawinfastreflection) <boolean> (available in all games since P2.png)
Makes the entity be rendered in reflections from water materials using $reflectonlymarkedentities.
Damage Filter Name (damagefilter) <filterclass>
When this entity receives damage, it will filter by this entity.
Team Number (Not in FGD) (team_number) <integer> (only available in Tf2.png)
Seems to do nothing...
Breakable By (BreakableType) <choices> (only available in L4d.pngL4d2-small.png)
Who can break this?

Inputs[edit | edit source]

SetMass <float>
If this entity is physically simulated, set its mass.
Break
Breaks the breakable.
SetHealth <integer>
Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
AddHealth <integer>
Adds health to the breakable.
RemoveHealth <integer>
Removes health from the breakable.
Alpha <integer>
Sets Render Amount/Transparency (renderamt).
Color <color255>
Sets the Render Color (rendercolor).
EnableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to true.
DisableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to false.
SetDamageFilter <target_destination>
Sets Damage Filter Name.

Outputs[edit | edit source]

OnBreak
Fired when this object breaks. Activator is whatever breaks the object.
OnHealthChanged <float>
Fired whenever the health of the breakable has increased or decreased. Note: Will fire multiple times at once when shot by shotguns in some games. Automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) as the input parameter, unless overridden by the mapper.

See Also[edit | edit source]