CPhysBox
(Redirected from Func physbox)
Jump to navigation
Jump to search
Code classes:
CPhysBox
CBreakable
CBaseEntity
(all ents)
CPhysBox
is a code class available in every Source game.
Classnames:
func_brush
- Brush that's free to move around like aprop_physics
.
Flags[edit | edit source]
- 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
- 262144: Not affected by rotor wash
- 524288: Generate output on +USE (OnPlayerUse)
- 8388608: Prevent motion enable on player bump
Keyvalues[edit | edit source]
- Mass Scale
(massScale)
<float>
- A scale multiplier for the object's mass. Use the convar
sv_massreport 1
to see the actual mass of the object ingame. - Impact Damage Type
(Damagetype)
<choices>
- Sets the "sharpness" of the brush. Sharp objects are far more damaging.
- 0: Blunt
- 1: Sharp
- Override Parameters
(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'.
- Health Level to Override Motion
(damagetoenablemotion)
<integer>
- If specified, this object will start motion disabled. Once its health has dropped below this specified amount, it will enable motion.
- Physics Impact Force to Override 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.
- Strength
(health)
<integer>
- Number of points of damage to take before breaking. 0 means don't break.
- Preferred Player-carry Angles
(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.
- Not solid to world
(notsolid)
<choices>
- If set, the object will pass through world geometry.
- 0: Solid to World
- 1: Passes through World
- Shadows (Not in FGD)
(vrad_brush_cast_shadows)
<choices>
- Determines if this entity will cast lightmap shadows.
- 0: No shadows
- 1: Cast shadows
- Render Mode
(rendermode)
<choices>
- A special rendering mode to use on this entity.
- Render Amount/Transparency
(renderamt)
<integer>
- Transparency amount, requires a Render Mode
(rendermode)
other than Normal. 0 is invisible, 255 is fully visible.
- Render Color (R G B)
(rendercolor)
<color255>
- Color channel filter to add to this entity's texture(s). Bug: Broken for brush entities.
- Render FX
(renderfx)
<choices>
- Preset appearance effects. Partially supported in , completely non-functional in . Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
- Minimum Light
(_minlight)
<float>
- Minimum amount of light to hit this brush. 0 is none, 1 is "fullbright". Useful because the lightmaps will not update as the entity moves.
- Render in Fast Reflections
(drawinfastreflection)
<boolean>
(available in all games since ) - Makes the entity be rendered in reflections from water materials using
$reflectonlymarkedentities
. Exploitable by Player(ExploitableByPlayer)
<choices>
(available in all games since )- No effect.
Inputs[edit | edit source]
- Sleep
- Tells the brush to quit moving. Any physics forces (excluding gravity and water buoyancy) will cause the object to resume moving as usual. Sleeping also occurs automatically when the object has no physics forces to keep it awake, and is no longer moving a noticeable amount.
- Wake
- If the object was told to sleep, tells it to start moving again.
- DisableMotion
- Tells the object to stop moving completely. No physics forces will re-enable motion, not even Wake.
- EnableMotion
- If the object's motion has been disabled entirely, tells it to resume movement as usual. This will also Wake the object, if it is Sleeping.
- DisableFloating
- If the object would normally float when in water, tells it to not float. There seems to be no way to re-enable floating behavior, but programming a method to do this should be fairly simple.
- ForceDrop
- If this object is being carried by a player, forces it to be dropped.
- Alpha
<integer>
- Sets Render Amount/Transparency
(renderamt)
.
- Color
<color255>
- Sets the Render Color
(rendercolor)
.
- EnableDrawInFastReflection (available in all games since )
- Sets Render in Fast Reflections to true.
- DisableDrawInFastReflection (available in all games since )
- Sets Render in Fast Reflections to false.
- BecomeDebris (available in all games since )
- Changes the collision to act like debris (does not collide with most objects, ignored by some entities).
- Enable (available in all games since )
- Makes the object visible and solid (doesn't override Not solid to world).
- Disable (available in all games since )
- Makes the object invisible and untouchable.
Outputs[edit | edit source]
- OnDamaged
- Fires when this entity is damaged.
- OnAwakened
- Fires when this entity becomes awake (collision/force is applied).
- OnMotionEnabled
- Fires when motion is sent EnableMotion.
- OnPhysGunPickup
- Fires when a player picks this object up, either with the physgun or +USE.
- OnPhysGunPunt (only available in )
- Fires when a player punts this object with the physgun.
- OnPhysGunOnlyPickup (only available in )
- Fires when a player picks this object up with the physgun. +USE pickups do not fire this output.
- OnPhysGunDrop
- Fires when a player drops this object, either with the physgun or +USE.
- OnPlayerUse
- Fires when the player tries to +USE the physbox. This output will fire only if the Generate output on +USE spawnflag is set.