This article's documentation is for anything that uses the Source engine. Click here for more information.

Prop physics override: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Cleanup)
m (Classifying as model entity)
 
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{base point|prop_physics_override}} A prop type that will override the properties built into its model, making it work like a <code>[[prop_physics]]</code> entity. The health of props can also be overridden by using this entity.
{{CD|CPhysicsProp|file1=props.cpp}}
{{this is a|model entity|name=prop_physics_override}} A prop type that will override the properties built into its model, making it work like a <code>[[prop_physics]]</code> entity. The health of props can also be overridden by using this entity.
 
{{note|Models must have a collision wireframe, or they will not work. If you intend to use a collision-less model as a physics object, make it a [[prop_dynamic]] and parent it to a nodrawn [[func_physbox]].}}


Generally, if a <code>prop_physics</code> in your map has been removed because its model wasn't meant to be a physics prop, you can use this entity to still make it a <code>prop_physics</code>, without any drawbacks.
Generally, if a <code>prop_physics</code> in your map has been removed because its model wasn't meant to be a physics prop, you can use this entity to still make it a <code>prop_physics</code>, without any drawbacks.
Line 7: Line 10:
* [[Prop Types Overview]]
* [[Prop Types Overview]]
* [[Prop Footsteps]] - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.
* [[Prop Footsteps]] - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.
 
{{important|Spawned entity's classname in-game is automatically changed to <code>prop_physics</code>}}
{{in code|class=class_c_physics_prop.html CPhysicsProp|file=props_8cpp-source.html props.cpp}}


== Keyvalues ==
== Keyvalues ==
{{KV|Health|integer|Number of points of damage to take before breaking. 0 means don't break.}}
{{KV|Health|intn=health|integer|Number of points of damage to take before breaking. 0 means don't break.
{{KV BasePropPhysics}}
:{{otherKIO|2=Regular prop_physics cannot override health but prop_physics_override can. All other|1=prop_physics}}}}


== Flags ==
== See Also ==
{{Fl BasePropPhysics}}
* {{ent|prop_data}}
 
* [[Prop Types Overview]]
== Inputs ==
** {{ent|prop_physics_multiplayer}}
{{IO|Ignite|Ignite, burst into flames.}}
** {{ent|prop_physics_respawnable}}
{{IO|IgniteLifetime|<code>Ignite</code> with the given lifetime. {{todo|Before the flames extinguish, or before health reaches zero?}}|param=float}}
** {{ent|prop_physics}}
{{IO|IgniteNumHitboxFires|<code>Ignite</code> with the given number of hitbox fires.|param=integer}}
** {{ent|prop_sphere}}
{{IO|IgniteHitboxFireScale|<code>Ignite</code> with the given hitbox fire scale.|param=float}}
** {{ent|prop_dynamic}}
{{I BasePropPhysics}}
** {{ent|prop_static}}
 
** {{ent|prop_ragdoll}}
== Outputs ==
{{O BasePropPhysics}}


[[Category:Physics]]
[[Category:Physics]]
[[Category:Prop entities|physics override]]

Latest revision as of 04:34, 19 May 2025

C++ Class hierarchy
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
C++ props.cpp

prop_physics_override is a model entity available in all Source Source games. A prop type that will override the properties built into its model, making it work like a prop_physics entity. The health of props can also be overridden by using this entity.

Note.pngNote:Models must have a collision wireframe, or they will not work. If you intend to use a collision-less model as a physics object, make it a prop_dynamic and parent it to a nodrawn func_physbox.

Generally, if a prop_physics in your map has been removed because its model wasn't meant to be a physics prop, you can use this entity to still make it a prop_physics, without any drawbacks.

Although this entity provides the freedom of turning any prop into a physics prop, be aware of that players will rely on the behavior of props to be more or less consistent with other maps, and even other Source games.

Icon-Important.pngImportant:Spawned entity's classname in-game is automatically changed to prop_physics

Keyvalues

Health (health) <integer>
Number of points of damage to take before breaking. 0 means don't break.
Note.pngNote:Regular prop_physics cannot override health but prop_physics_override can. All other Keyvalues / Inputs / Outputs are same as prop_physics.

See Also