Func physbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:
== Entity description ==
== Entity description ==
A [[brush entity]] that is treated as a physics object.
A [[brush entity]] that is treated as a physics object.
{{brushmodel}}


* See also [[Collapsing_tower]] - a prefab that demonstrates some creative usage of func_physboxes.
* See also [[Collapsing_tower]] - a prefab that demonstrates some creative usage of func_physboxes.

Revision as of 17:10, 10 May 2008

Template:Wrongtitle Template:Base brush

Entity description

A brush entity that is treated as a physics object. Template:Brushmodel

  • 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

<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

  • Breakable (brush):
Only Break on Trigger : [1]
Break on Touch : [2]
Break on Pressure : [4]
Break immediately on Physics : [512]
Don't take physics damage : [1024]
Don't allow bullet penetration : [2048]
  • 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
  • Template:Ep1 add
  • Template:Ep1 add
  • Template:Ep1 add

Inputs

  • BreakableBrush:
Break
Breaks the breakable.
SetHealth <integerRedirectInput/integer>
Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
AddHealth <integerRedirectInput/integer>
Adds health to the breakable.
RemoveHealth <integerRedirectInput/integer>
Removes health from the breakable.
SetMass <floatRedirectInput/float>
Damaging the entity applies physics forces to it.
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

  • BreakableBrush:
OnBreak
!activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
OnHealthChanged <floatRedirectOutput/float>
!activator = entity that caused the health change
!caller = this entity
Fired whenever the health of the breakable has increased or decreased. This output automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) into the parameter box for inputs, if the mapper does not override the parameter with something else.
  • 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.
Fired when a player picks this object up WITH THE PHYSGUN. +USE pickups do not fire this output.