CBreakableProp

From Source Entities
Jump to navigation Jump to search

Code classes:

CBreakableProp is a code class inherited by breakable prop entities. When a breakable is broken, it will usually spawn "gibs" - small objects representing the broken pieces. Gibs are most commonly spawned with the gib entity. To do: Describe the conditions needed for a model to be breakable, and how health is set.

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
breakable_disable_gib_limit00 disables, 1 enablesTo do: Effects cannot be observed without at least two people on a multiplayer server.
breakable_multiplayer10 disables, 1 enablesTo do: Effects cannot be observed without at least two people on a multiplayer server.
prop_active_gib_limit999999Arbitrary numberNumber of gibs that may be present at once.
prop_active_gib_max_fade_time999999SecondsGibs will be forced to fade away after being present for this long, if not already fading for any other reason.

Flags[edit | edit source]

  • 16: Break on Touch
  • 32: Break on Pressure (breaks whenever put under any pressure e.g. being stood on)

Keyvalues[edit | edit source]

Health (health) <integer>
How close the prop is to breaking. The entity classname has to be prop_physics_override or prop_dynamic_override to use, otherwise the health is defined through the model's QC file.
Explosion Damage (ExplodeDamage) <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 (ExplodeRadius) <float>
If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also Explosion Damage.
Min Damage to Hurt (minhealthdmg) <integer>
If a single hit to the object doesn't do at least this much damage, the prop won't take any of the damage from that hit.
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
Break Model Message (BreakModelMessage) <string> (only available in Hl2.pngP1.pngCss.pngDods.pngTf2.png)
"If set, will use this break model message instead of the normal break behavior." To do: More info...
Sound to make when puntedHl2.png (puntsound) <sound>
Sound to make when punted by gravity gun.
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.

Inputs[edit | edit source]

physdamagescale <float>
Sets Physics Impact Damage Scale.
EnablePhyscannonPickupHl2.png
Makes the prop able to picked up by the gravity gun.
DisablePhyscannonPickupHl2.png
Makes the prop not able to picked up by the gravity gun.
EnablePuntSoundHl2.png
Allow this prop to play the Sound to make when punted.
DisablePuntSoundHl2.png
Do not allow this prop to play the Sound to make when punted.
Break
Breaks the prop.
SetHealth <integer>
Sets a new value for the prop's health. If the prop's health reaches zero it will break. Works even if not using an _override entity.
AddHealth <integer>
Adds health to the prop.
RemoveHealth <integer>
Removes health from the prop.

Outputs[edit | edit source]

OnPhysCannonAnimatePreStartedHl2.png
Fired when prop starts its ACT_PHYSCANNON_ANIMATE_PRE activity. Caused by the object being picked up by the gravity gun.
OnPhysCannonAnimatePullStartedHl2.png
Fired when prop has started its ACT_PHYSCANNON_ANIMATE activity. ACT_PHYSCANNON_ANIMATE_PRE plays once, then ACT_PHYSCANNON_ANIMATE starts looping.
OnPhysCannonDetachHl2.png
Fired when prop has started its ACT_PHYSCANNON_DETACH activity (caused by the gravity gun ripping it from a wall).
OnPhysCannonAnimatePostStartedHl2.png
Fired when prop has started its ACT_PHYSCANNON_ANIMATE_POST activity (caused by the player letting the prop go from the gravity gun).
OnPhysCannonPullAnimFinishedHl2.png
Fired when prop has finished all gravity gun-related animations.
OnBreak
Fired when this object breaks. Activator is whatever breaks the object.
OnHealthChanged <float>
Fired whenever the health of the prop has increased or decreased. Automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) as the input parameter, unless overridden by the mapper.