Func breakable

From Valve Developer Community

This Brush-based Entity is available in all Source Games. In code it is represented by class CBreakable (http://doxygen.page.needed/class_c_breakable.html), defined in func_break.cpp (http://doxygen.page.needed/func__break_8cpp-source.html).

Table of contents

Entity description

A brush entity that can be broken from damage or an input.

Keyvalues

  • origin
<origin> The position of this entity's center in the world. Rotating entities rotate around their origin.
Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
  • disableshadows
<boolean> Used to disable dynamic shadow casting from this entity.
Name of the filter_damage_type entity that controls which entities can damage us.
If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also 'Explosion Radius'.
If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also 'Explosion Damage'.
Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
Literal Value Description
0 Normal
1 Limit Gibs
2 Full Gibs on All Platforms
Delay, in seconds, after 'broken' by pressure before breaking apart (allows for sound to play before breaking apart).
Specifies the targetname of this entity's Parent in a movement hierarchy. Child entities mimic the movements of their Parent.
  • globalname
<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.
<choices> Set to the best approximation of the size and material of this entity's brushes. If set, it will override this entity's health and damage taken from various weapons. See the propdata.txt file in the scripts directory of your MOD to get a detailed list of what each entry specifies.
Literal Value Description
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
<integer> Number of points of damage to take before breaking. Will not break if set to 0.
<choices> Set to the material type of the brush. Used to decide what sounds to make when damaged, and what gibs to produce when broken.
Literal Value Description
0 Glass
1 Wood
2 Metal
3 Flesh
4 CinderBlock
5 Ceiling Tile
6 Computer
7 Unbreakable Glass
8 Rocks
<choices> Used to decide which direction to throw gibs when broken.
Literal Value Description
0 Random
1 Relative to Attack
2 Use Precise Gib Dir
<angle> Specifies the direction to throw gibs when this breakable breaks. Be sure to select Use Precise Gib Dir in the Gibs Direction (explosion) field!
  • nodamageforces
<boolean> Used to determine whether or not damage should cause the brush to move.
  • gibmodel
<studio> Used by HL1Port to specify a custom gib model to break into, overriding the Material Type (material).
  • spawnobject
<choices> When broken, an entity of the selected type will be created.
Literal Value Description
1 item_battery
2 item_healthkit
3 item_ammo_pistol
4 item_ammo_pistol_large
5 item_ammo_smg1
6 item_ammo_smg1_large
7 item_ammo_ar2
8 item_ammo_ar2_large
9 item_box_buckshot
13 item_smg1_grenade
14 item_box_sniper_rounds
16 weapon_stunstick
18 weapon_ar2
21 weapon_smg1
23 weapon_slam
24 weapon_shotgun
26 item_dynamic_resupply
If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage.
  • pressuredelay
<float> Delay, in seconds, after 'broken' by pressure before breaking apart (allows for sound to play before breaking apart).
  • renderfx
<choices>
Literal Value Description
0 Normal
1 Slow Pulse
2 Fast Pulse
3 Slow Wide Pulse
4 Fast Wide Pulse
5 Slow Fade Away
6 Fast Fade Away
7 Slow Become Solid
8 Fast Become Solid
9 Slow Strobe
10 Fast Strobe
11 Faster Strobe
12 Slow Flicker
13 Fast Flicker
14 Constant Glow
15 Distort
16 Hologram (Distort + fade)
17 Scale up
22 Spotlight FX
23 Cull By Distance (TEST)
24 Fade Wider Pulse
  • rendermode
<choices> Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'.
Literal Value Render Mode Description (Click for more info.)
0 Normal Default rendering.
1 Color Obsolete.
2 Texture Plain opacity.
3 Glow No Z buffer checks. Fixed size on screen.
4 Solid / Alphatest Obsolete. (Use alphatest capabilities in materials instead.)
5 Additive Obsolete. Add this entity's color to what's behind it.
7 Additive Fractional Frame Obsolete? Blend between animation frames.
8 Alpha Add (Not in FGD.) Add alpha.
9 World Space Glow No Z buffer checks. Fixed size in world (as opposed to on screen).
10 Dont Render / None Don't render.
  • renderamt
<integer> FX Amount (0 - 255) - How opaque the entity will be rendered. (0 is fully transparent, while 255 is fully opaque). Will not work if the rendermode keyvalue is set to Normal or Dont Render.
  • rendercolor
<color255> FX Color - What color the entity will be rendered in (to the degree of the opacity set with renderamt).
  • disablereceiveshadows
<boolean>
Pitch Yaw Roll (Y Z X)
This entity's angular orientation in the world (also used for angular effect entities).
  • minhealthdmg
<integer> The prop will ignore any damage events if the damage is less than this amount.
  • _minlight
<integer> The minimum level of ambient light that hits this brush.
  • physdamagescale
<float> Scales damage energy when this object is hit by a physics object.
Image:note.png Note: 0 means this feature is disabled for backwards compatibility. Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.

Flags

  • 1 : Only Break on Trigger - This entity will only break when it receives an input.
  • 2 : "Break on Touch - This entity will break when collided with.
  • 4 : "Break on Pressure - This entity will break when pressure is applied to this entity.
  • 512 : Break immediately on Physics - This entity will break when it hits the ground, if it is attached to a physics entity.
  • 1024 : Don't take physics damage - This entity will not break when dropped with physics, no matter what.

Inputs

  • Kill
Removes this entity from the world.
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 == infinite)>
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
Set the rendercolor.
Set the renderamt.
  • DisableShadow
Turn shadow off.
  • EnableShadow
Turn shadow on.
  • 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 physcannon.
  • DisablePhyscannonPickup
Makes the breakable not able to picked up by the physcannon.
Changes the entity's parent in the movement hierarchy.
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the Parent's Origin and Angles at the time it is attached.
Removes this entity from its current movement hierarchy.
  • EnableDamageForces
Damaging the entity applies physics forces to it.
  • DisableDamageForces
Damaging the entity does *not* apply physics forces to it.
  • DisableShadow
Turn shadow off.
  • EnableShadow
Turn shadow on.

Outputs

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator
  • OnBreak
Fired when this breakable breaks.
!activator = breaker
  • OnHealthChanged <float>
Fired when the health of this breakable changes, passing the new value of health as a percentage of max health, from [0..1].
  • OnPhysCannonDetach
Fired when the physcannon has ripped this breakable off of the wall. Only fired if ACT_PHYSCANNON_DETACH is defined in the model this breakable is using.
  • OnPhysCannonAnimatePreStarted [Episode One Update]
Fired when this prop starts playing the Pre physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE_PRE activity is defined in the model this breakable is using.
  • OnPhysCannonAnimatePullStarted [Episode One Update]
Fired when this prop starts playing the physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE activity is defined in the model this breakable is using. If the prop has Pre pull anim, this will be fired after the Pre anim has finished playing.
  • OnPhysCannonPullAnimFinished [Episode One Update]
Fired when this prop has finished playing the physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE activity is defined in the model this breakable is using. If the prop has Pre & Post pull anims, this will be fired after the Post anim has finished playing.
  • OnPhysCannonAnimatePostStarted [Episode One Update]
Fired when this prop starts playing the Post physcannon-pull activity. Only fired if the ACT_PHYSCANNON_ANIMATE_POST activity is defined in the model this breakable is using.