Func breakable surf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Templated a value.)
(Inserted breakablebrush, removed renderfields...)
Line 9: Line 9:


==Keyvalues==
==Keyvalues==
*{{kv targetname}}
* {{kv targetname}}
*{{kv parentname}}
* {{kv breakablebrush}}
*{{kv renderfields}}
* {{kv shadow}}
*{{kv damagefilter}}
*{{kv shadow}}
 
*'''ExplodeDamage'''
: <float> If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also ''ExplodeRadius''.
*'''ExplodeRadius'''
: <float> If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also ''ExplodeDamage''.
*'''PerformanceMode'''
: <choices> Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
*'''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.
*'''propdata'''
: <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.
*'''health'''
: <integer> The amount of damage the surface takes before breaking.
*'''material'''
: <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.
*'''explosion'''
: <choices> Used to decide which direction to throw gibs when broken.
*'''gibdir'''
: <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'''
: <choices> 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.
*'''explodemagnitude'''
: <integer> 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).
*'''disablereceiveshadows'''
*'''disablereceiveshadows'''
: {{boolean}}
: {{boolean}}

Revision as of 21:04, 13 March 2006

Template:Wrongtitle

Description

A breakable surface, for partially breakable glass / tile / etc. All faces but the desired visible one must be marked as tools/toolsnodraw and that face must have exactly four sides. The material applied to the visible face must be set up to be breakable.

Textures

The following standard textures are meant to work with this entity:

  • glass/glasswindowbreak070a (but not glass/glasswindowbreak070b!)

Keyvalues

<boolean>
  • fragility
<integer> If surfacetype is set to "Glass", this value sets how fragile the glass pieces are after the surface has been broken.
  • surfacetype
<choices>

Inputs

Sets the entity to use as damage filter. Pass in an empty string to clear the damage filter.
Breaks the breakable completely. This will make the entity act like a normal func_breakable. If you wish to maintain the shattering behaviour/appearance, consider using the Shatter input below with a large radius value.
  • 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.
  • EnableDamageForces
Damaging the entity applies physics forces to it.
  • DisableDamageForces
Damaging the entity does not apply physics forces to it.
  • Shatter <vector>
Shatter the window. The input parameter, which must be provided, is a vector. The first two coordinates are the X,Y center of the shattering (as values from from 0-1). The third coordinate is the radius of the shatter, in inches. The format is simply x y z.

Outputs

Fired when this breakable breaks.
  • 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.

See also