func_physbox
From Valve Developer Community
This is a brush entity available in all Source games.
Contents |
Entity description
A brush entity that is treated as a physics object.
- See also Collapsing_tower - a prefab that demonstrates some creative usage of func_physboxes.
- See also Prop Footsteps - a tutorial on the subject, demonstrating essential code for when players walk on entities like this (it's not ignored during footstep sound computation).
Keyvalues
-
Origin:
- Origin
<origin> - The position of this entity's center in the world. Rotating entities typically rotate around their origin.
-
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. 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
<int> - The damage to take before breaking. The brush will not break from damage if this is 0.
- Material Type
<choices> - Decides what sounds to make when damaged, and what gibs to produce when broken.
- Glass
- Wood
- Metal
- Flesh
- CinderBlock
- Ceiling Tile
- Computer
- Unbreakable Glass
- Rocks
- Gibs Direction
<choices> - Which direction to throw gibs in 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
<bool> - When enabled the brush will move in response to damage.
- Spawn On Break
<choices> - When broken, an entity of the selected type will be created.
- item_battery
- item_healthkit
- item_ammo_pistol
- item_ammo_pistol_large
- item_ammo_smg1
- item_ammo_smg1_large
- item_ammo_ar2
- item_ammo_ar2_large
- item_box_buckshot
- item_smg1_grenade
- item_box_sniper_rounds
- weapon_stunstick
- weapon_ar2
- weapon_smg1
- weapon_slam
- weapon_shotgun
- item_dynamic_resupply
- Explode Magnitude
<int> - 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 global names matching entities in the previous map will have the previous map's state copied over to them.
Parentname:
- Parent
<targetname> - Specifies the targetname of this entity's movement parent. Entities with parents move with their parent.
Breakable:
- Explosion Damage
<float> - Explosion Radius
<float> - If both values are non-zero, when the entity breaks it will create an explosion causing the specified amount of damage over the specified radius.
- Performance Mode
<choices> - Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
- Normal
- Limit Gibs
- Full Gibs on All Platforms
DamageFilter:
- Damage Filter
<targetname> - Name of the filter_damage_type that controls what damages this entity.
Shadow:
- Disable shadows
<bool> - Prevent the entity from creating cheap render-to-texture shadows. Does not affect shadow mapping.
Targetname:
- Name <string>
- The targetname other entities refer to this entity by.
- _minlight
- <integer> The minimum level of ambient light that hits this brush.
- Damagetype
- <boolean> If set, damage type is sharp, otherwise blunt
- massScale
- <float> A scale multiplier for the object's mass.
- overridescript
- <string> A list of physics key/value pairs that are usually in a physics prop .qc file. Format is 'key,value,key,value,etc'.
- damagetoenablemotion
- <integer> If specified, this object will start motion disabled. Once its health has dropped below this specified amount, it will enable motion.
- forcetoenablemotion
- <float> If specified, this object will start motion disabled. Any impact that imparts a force greater than this value on the physbox will enable motion.
- preferredcarryangles
- <vector> If the 'Use Preferred Carry Angles' spawnflag is set, this angle is the angle which the object should orient to when the player picks it up, with the physgun or +USE.
- notsolid
- <boolean> Not solid to world
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.
- 4096 : Start Asleep
- 8192 : Ignore +USE for Pickup
- 16384 : Debris - Don't collide with the player or other debris
- 32768 : Motion Disabled
- 65536 : Use Preferred Carry Angles
- 131072 : Enable motion on Physcannon grab
- 262144 : Not affected by rotor wash
- 524288 : Generate output on +USE
- 1048576 : Physgun can ALWAYS pick up. No matter what.
- 2097152 : Physgun is NOT allowed to pick this up.
- 4194304 : Physgun is NOT allowed to punt this object.
Inputs
-
EnableDamageForces -
DisableDamageForces - Whether damaging the entity applies physics forces to it.
Breakable:
-
Break - Removes the entity from the server and creates its gibs on the client.
-
SetHealth <int> - Sets the breakable's health (zero means break).
-
AddHealth <int> -
RemoveHealth <int> - Adds to/removes from the breakable's health.
-
EnablePhyscannonPickup -
DisablePhyscannonPickup - Allows/prevents the Gravity Gun to pick the breakable up.
-
SetMass <float> - Set mass of this object.
To do: In what unit?
DamageFilter:
-
SetDamageFilter <targetname> - Sets the entity to use as damage filter. Pass an empty string ("") to clear.
Shadow:
- EnableShadow
- DisableShadow
- Control the entity's cheap render-to-texture shadow. Does not affect shadow mapping.
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> -
FireUser1toFireUser4 - Fire the
OnUseroutputs; see User Inputs and Outputs.
Parentname:
-
SetParent <targetname> - Move with this entity. See Entity Hierarchy (parenting).
-
SetParentAttachment <string> - Attach to a named attachment on the current parent. The entity will teleport so that the position of its root bone matches that of the attachment.
-
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 its current movement hierarchy.
RenderFields:
- Wake
- Wake up this physics object, if it is sleeping.
- Sleep
- Put this physics object to sleep. It will wake if given the Wake input, or if force is applied to it. Note that physics objects go to sleep automatically after coming to rest for a while, so you don't really need to use this.
- EnableMotion
- Enable physics motion/collision response.
- DisableMotion
- Disable physics motion/collision response.
- ForceDrop
- If this object is being carried by a player, with the physgun or +USE, force it to be dropped.
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_DETACHactivity (caused by the gravity gun ripping it from a wall). -
OnPhysCannonAnimatePreStarted -
OnPhysCannonAnimatePullStarted - Prop has started its
ACT_PHYSCANNON_ANIMATE_PREorACT_PHYSCANNON_ANIMATEactivities. Both are caused by the player trying to grab the prop with the gravity gun;ANIMATE_PREplays once, thenANIMATEstarts looping. -
OnPhysCannonAnimatePostStarted - Prop has started its
ACT_PHYSCANNON_ANIMATE_POSTactivity (caused by the player letting the prop go from the gravity gun). -
OnPhysCannonPullAnimFinished - Prop has finished all gravity gun-related animations.
Targetname:
-
OnUser1toOnUser4 - Fired in response to the
FireUserinputs; see User Inputs and Outputs. -
OnKilled(New with Left 4 Dead) - Fired when the entity is killed and removed from the game.
- OnDamaged
- Fired when this entity is damaged.
- OnAwakened
- Fired when this entity becomes awake (collision/force is applied).
- OnMotionEnabled
- Fired when motion is enabled due to damage/physcannon/force.
- OnPhysGunPickup
- Fired when a player picks this object up, either with the physgun or +USE.
- OnPhysGunDrop
- Fired when a player drops this object.
- OnPlayerUse
- Fired when the player tries to +USE the physbox. This output will fire only if the Generate output on +USE spawnflag is set.
- OnPhysGunOnlyPickup
- Fired when a player picks this object up WITH THE PHYSGUN. +USE pickups do not fire this output.
