func_breakable

From Valve Developer Community

Jump to: navigation, search

func_breakable is a brush entity available in all Source games.

Contents

Entity description

This entity can take damage and break apart, optionally producing gibs.

Note:If your func_breakable will not break, this may have to do with the prop_data setting. Some prop types will override the health of the func_breakable, making it unbreakable. See below.

Keyvalues

Min Damage to Hurt <integer>
The brush will ignore any damage events if the damage is less than this amount.
Minimum Light Level <string>
The minimum level of ambient light that hits this brush.
Confirm:Color depends on the environment.
Physics Impact Damage Scale <float>
Scales damage energy when this object is hit by a physics object.
Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.
Note:0 means this feature is disabled for backwards compatibility

BreakableBrush:

Prop Data <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. If set, it will override this entity's health and damage taken from various weapons. See prop_data base types for what each entry specifies.
  • None
  • Wooden.Tiny
  • Wooden.Small
  • Wooden.Medium
  • Wooden.Large
  • Wooden.Huge
  • Metal.Small
  • Metal.Medium
  • Metal.Large
  • Cardboard.Small
  • Cardboard.Medium
  • Cardboard.Large
  • Stone.Small
  • Stone.Medium
  • Stone.Large
  • Stone.Huge
  • Glass.Small
  • Plastic.Small
  • Plastic.Medium
  • Plastic.Large
  • Pottery.Small
  • Pottery.Medium
  • Pottery.Large
  • Pottery.Huge
  • Glass.Window
Strength <integer>
The damage to take before breaking. The brush will not break from damage if this is 0.
Material Type <choices>
Set to the material type of the brush. Decides what sounds to make when damaged, and what gibs to produce when broken.
  • Glass - As stated, uses glass gibs and sounds. Gibs may not match with material used.
  • Wood - As stated, uses wood gibs and sounds. Gibs may not match with material used, and may be too big for certain funcs.
  • Metal - As stated, uses metal gibs and sounds. Gibs are very small, and evidently made for vents. May not match material.
  • Flesh - Uses HL1 gib death sounds and wood gibs. Not much practicality for this type unless one is making a meat slab (With proper gibs, of course).
  • CinderBlock - Uses concrete gibs and sounds. Gibs may not match with material and be too big for the brush.
  • Ceiling Tile - Uses tile sounds, wood gibs and HL1 plaster gib death sound.
  • Computer - Uses spark sounds and wood gibs, coupled with an HL1 gib death sound.
  • Unbreakable Glass - Uses glass sounds. Using this material type overrides any Strength value previously set to 0, making it unbreakable.
  • Rocks - Uses concrete gibs and sounds. Gibs may not match with material, and don't even look like rocks to begin with.
Gibs Direction <choices>
Used to decide which direction to throw gibs when broken.
  • Random
  • Relative to Attack
  • Use Precise Gib Dir
Precise Gib Direction <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 <boolean>
When enabled the brush will move in response to damage.
Gib Model <string>
Used by HL1Port to specify a custom gib model to break into, overriding the Material Type.
Spawn On Break <choices>
When broken, an entity of the selected type will be created.
Explode Magnitude <integer>
If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage.
Confirm:Damage radius is proportional to magnitude.
Pressure Delay <float>
A delay, in seconds, that the prop will wait between reaching 0 health and breaking. Allows for pressure/straining sound to play.

Global:

Global Entity Name <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.

Parentname:

Parent <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent.

Breakable:

Explosion Damage <float>
If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also Explosion Radius.
Explosion Radius <float>
If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also Explosion Damage.
Performance Mode <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
  • 3 : Reduced gibs

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Name(s) of script files that are executed after all entities have spawned.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

DamageFilter:

Damage Filter <targetname>
Name of the filter_damage_type entity that controls which entities can damage us.

Shadow:

Disable shadows <boolean>
Prevent the entity from creating cheap render-to-texture shadows. Does not affect shadow mapping.
Disable ShadowDepth <boolean> (New with Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Projected Texture Cache <choices> (New with Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Disable flashlight <boolean> (New with Portal 2)
Used to disable projected texture lighting and shadows on this entity.

Reflection:

Render in Fast Reflections <boolean> (New with Portal 2)
If enabled, causes this entity/prop to to render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

Angles:

Pitch Yaw Roll (Y Z X) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Origin:

Origin (X Y Z) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.

Reflection:

Render in Fast Reflections <boolean> (New with Portal 2)
If enabled, causes this entity/prop to to render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

Flags

BreakableBrush:

  • 1 : Only Break on Trigger
  • 2 : Break on Touch
  • 4 : Break on Pressure
  • 512 : Break immediately on Physics
  • 1024 : Don't take physics damage
  • 2048 : Don't allow bullet penetration

Inputs

BreakableBrush:

EnableDamageForces
Damaging the entity applies physics forces to it.
DisableDamageForces
Damaging the entity does not apply physics forces to it.

Breakable:

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. If the breakable's health reaches zero it will break.
RemoveHealth  <integer>
Removes health from the breakable. If the breakable's health reaches zero it will break.
EnablePhyscannonPickup
Makes the breakable able to picked up by the Gravity Gun.
DisablePhyscannonPickup
Makes the breakable not able to picked up by the Gravity Gun.
SetMass  <float>
Set mass of this object.

Targetname:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a game script file from disk.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of script source code. String quotation may be needed when fired via console.
Warning:Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2)
Execute a game script function.

DamageFilter:

SetDamageFilter  <string>
Sets the entity to use as damage filter. Pass in an empty string ("") to clear the damage filter.

Shadow:

DisableShadow
Turn shadow off.
EnableShadow
Turn shadow on.
DisableReceivingFlashlight  (New with Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (New with Portal 2)
This object may receive light or shadows from projected textures.

Reflection:

DisableDrawInFastReflection  (New with Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (New with Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.

Parentname:

SetParent  <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment  <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset  <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

Shadow:

DisableShadow
Turn shadow off.
EnableShadow
Turn shadow on.
DisableReceivingFlashlight  (New with Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (New with Portal 2)
This object may receive light or shadows from projected textures.

RenderFields:

Alpha  <integer>
Set the sprite's alpha (0 - 255).
Color  <color255>
Set the sprite's color (R G B).

Reflection:

DisableDrawInFastReflection  (New with Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (New with Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.

Outputs

Breakable:

OnBreak
Fired when this breakable breaks. (activator is the breaker)
OnTakeDamage
The breakable has taken damage.
OnHealthChanged <float>
The health of the breakable has changed. Passes the new value as a normalised percentage of max health.
OnPhysCannonDetach
Prop has started its ACT_PHYSCANNON_DETACH activity (caused by the gravity gun ripping it from a wall).
OnPhysCannonAnimatePreStarted
OnPhysCannonAnimatePullStarted
Prop has started its ACT_PHYSCANNON_ANIMATE_PRE or ACT_PHYSCANNON_ANIMATE activities. Both are caused by the player trying to grab the prop with the gravity gun; ANIMATE_PRE plays once, then ANIMATE starts looping.
OnPhysCannonAnimatePostStarted
Prop has started its ACT_PHYSCANNON_ANIMATE_POST activity (caused by the player letting the prop go from the gravity gun).
OnPhysCannonPullAnimFinished
Prop has finished all gravity gun-related animations.
OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  

(New with Left 4 Dead)

This Output fires when the entity is killed and removed from the game.
Personal tools
Namespaces
Variants
Actions