prop_physics
| CPhysicsProp |
prop_physics is a model entity available in all
Source games. It is used to add rigid, VPhysics-simulated models to the world.
The only value required for prop_physics to work is a path to a model. As long as that model is physics-enabled, the correct data will be loaded from it when the map starts. It is possible to change any embedded physics data with the "Override Parameters" keyvalue.
Physics objects like prop_physics can be parented, though it is not in the default FGD and may not function correctly. It is recommended to instead use dynamic physics constraints. See Physics Entity Overview for more information.
physics_prop. The classname is always changed to prop_physics on spawn. Consistency
Consistency becomes a large problem when dealing with the many prop models that the Source engine provides. From a player's perspective, object interactivity should remain consistent across all the levels of your game / mod, as players will often have a hard time solving puzzles or making quick decisions if the prop's behaviour is different in only one specific instance. To enforce this, the game-related data of props is stored within the model itself.
For example, imagine you have a crate that is immovable for the entirety of your game and the player has gotten used to that crate being static. However, in one specific instance, this crate is not moveable and required to be moved to proceed. This can cause lots of irritation and confusion, and therefore is why consistency is necessary. Oftentimes, developers will use different skins or models to convey differences in behaviour and keep consistency.
Models that are meant to be physically simulated (chairs, tables, wooden planks, etc) will remove themselves if they are placed as prop_static or prop_dynamic entities (You can still use these as static props using the entity prop_dynamic_override). Other game-related data, such as mass, "health", gib amount & models, and so on are all stored inside the prop model as well.
The method by which they are stored, and guidelines for how to set it up, can be found in the Prop Data section of the model's QC file.
Keyvalues
parentname or target).Also displayed in Hammer's 2D views and Entity Report.
BasePropPhysics:
Physics Impact Damage Scale (physdamagescale) <float>
Impact damage type (Damagetype) <boolean>
Damaging it Doesn't Push It (nodamageforces) <boolean>
Scale Factor For Inertia (inertiascale) <float>
Mass Scale (massscale) <float>
Override Parameters (overridescript) <string>
key,value,key,value,….Health Level to Override Motion (damagetoenablemotion) <integer>
Physics Impact Force to Override Motion (forcetoenablemotion) <float>
BreakableProp:
Explosion Damage (ExplodeDamage) <float>
Explosion Radius (ExplodeRadius) <float>
Break Model Message (BreakModelMessage) <string> (only in
)
Breakable (common):
Performance Mode (PerformanceMode) <choices>
Choices - 0: Normal
- 1: No Gibs
- 2: Full Gibs on All Platforms (Xbox 360, PS3, etc)
- 3: Reduced gibs
Min Damage to Hurt (minhealthdmg) <integer>
Pressure Delay (PressureDelay) <float>
Health (health) <integer>
Maximum Health (max_health) <integer>
Physics Impact Damage Scale (physdamagescale) <float>
Who can break this? - 0: Everyone
- 1: All Infected
- 2: Only Tanks
|
Enable Explosion Override (explosion_override) <choices> (only in Enable/disable explosion parameters override (explosion_particle, explosion_particle_liquid, explosion_attachment, explosion_soundscript and explosion_soundscript_liquid).
A particle system to use when this entity explodes.
A particle system to use when this entity explodes in water.
An attachment point to use for custom explosion particle system.
A sound script to use when this entity explodes.
|
GMODSandbox:
Allow Physics Gun (gmod_allowphysgun) <boolean> (only in
)
Sandbox Tool Whitelist (gmod_allowtools) <string> (only in
)
.lua files of those tools. This also includes the context menu properties!World Model (model) <model path>
Skin (skin) <integer>
Model Scale (modelscale) <float>
Bodygroup (body / SetBodyGroup) <integer>
body and SetBodyGroup are present (even if set to 0), body will be prioritized.
Lighting Origin (lightingorigin) <targetname>
Shadow:
Disable Shadows (disableshadows) <boolean>
Disable Receiving Shadows (disablereceiveshadows) <boolean>
|
$reflectonlymarkedentities) and in the world impostor pass.Flags
BasePropPhysics:
- Start Asleep : [1]
- Don't take physics damage : [2]
- Debris : [4]
- Don't collide with the player or other debris.
- Motion Disabled : [8]
- Starts with motion disabled until sent EnableMotion.
- Enable motion when grabbed by gravity gun : [64]
- Not affected by rotor wash : [128]
- Generate output on
+use: [256] - Whether to generate
OnPlayerUseoutput
- Prevent pickup : [512]
- Prevent motion enable on player bump. : [1024]
- Has Attached Ragdolls : [2048] !FGD
- Set by the game when ragdolls are attached, detaches them when prop moves
Note:Used solely by props with the "impale" prop interaction (PROPINTER_PHYSGUN_FIRST_IMPALE), such as the harpoons in Half-Life 2 (not to be confused with the crossbow bolts, which use a different method for pinning ragdolls). It is best not to assign this spawnflag manually.
- Debris with trigger interaction. : [4096]
Note:Does not enable Debris behavior on its own. Needs to be used together with the Debris spawnflag or with the PROPINTER_PHYSGUN_CREATE_FLAREprop interaction.
- Force server-side : [8192]
- Multiplayer only; see
sv_pushaway_clientside_size.
- Radius Pickup : [16384] !FGD
- Makes objects easier to grab
- Gravity gun can ALWAYS pick up. No matter what. : [1048576]
- Allow this prop to be picked up by the standard gravity gun, even it its $mass exceeds
physcannon_maxmass(default 250 kg). Unused in games without weapon_physcannon.
- No Collisions : [2097152] !FGD
- Disable collisions on spawn
- Gib : [4194304] !FGD
- If debris, remove when stuck in a collision
- Zombies can't swat : [8388608] (only in
) - Zombies will ignore this prop when looking for an object to swat at the enemy.
BreakableProp:
- Break on Touch : [16]
- Break on Pressure : [32]
- Will break after being stood on for
PressureDelayseconds.
Note:Some models will break instantly if this is or isn't set. (e.g. militiawindow02_breakable.mdl,window_industrial.mdl)
Inputs
BasePropPhysics:
- Sleep
- Tell the prop 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 when it is no longer moving a noticeable amount.
- Wake
- If the object was told to sleep, tell it to start moving again.
- DisableMotion
- Tell 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, tell it to resume movement as usual. This will also
Wakethe object, if it isSleeping.
- DisableFloating
- If the object would normally float when in water, tell it not to float. There seems to be no way to re-enable floating behavior, but programming a method to do this should be fairly simple (
CALLBACK_DO_FLUID_SIMULATION).
BreakableProp:
- Break
- Breaks the breakable.
- 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.
- RemoveHealth <integer>
- Removes health from the breakable.
- physdamagescale <float>
- Sets Physics Impact Damage Scale. 0 means this feature is disabled for backwards compatibility.
- EnablePhyscannonPickup
- Makes the breakable able to picked up by the gravity gun.
- DisablePhyscannonPickup
- Makes the breakable not able to picked up by the gravity gun.
- EnablePuntSound (in all games since
) - Allow this prop from playing its Punt Sound sound when punted by the gravity gun.
- DisablePuntSound (in all games since
) - Prevent this prop from playing its Punt Sound sound when punted by the gravity gun.
Outputs
- OnMotionEnabled
- !activator = !caller = this entity
Fired when motion has been enabled on the prop, either via the Health Level to Override Motion keyvalue or from theEnableMotioninput.
- OnAwakened
- !activator = !caller = this entity
Fired when the prop has woken (force has been applied to it while it was asleep, or theWakeinput has been called).
- OnOutOfWorld
- !activator = !caller = this entity
Fired whenever the object is detected to be outside the world. Specifically, it checks if the object is outside of the world's bounding box or if the object is traveling at over 2000 units per second in any cardinal direction.
- OnPlayerUse
- !activator = !caller = this entity
Fired when the player has+used the prop.
- OnPhysGunDrop
- !activator = the player
!caller = this entity
Fired when the player has dropped the prop (from either+useor the gravity gun).
- OnPlayerPickup
- !activator = the player
!caller = this entity
Fired when the player has picked the prop up with+useor the gravity gun (in Half-Life 2).
- OnPhysGunOnlyPickup (in all games since
) - !activator = the player
!caller = this entity
Fired when the player has picked the prop up with the gravity gun specifically.
- OnHitByTank (only in
) - !activator = !caller = this entity
Fired when the prop has been punched by a Tank boss infected.
BreakableProp:
- OnBreak
- !activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
- OnHealthChanged <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. - OnTakeDamage
- !activator = entity that caused the damage
!caller = this entity
Fired when damage is taken. - OnPhysCannonAnimatePreStarted
- !activator = none
!caller = this entity
Fired when prop starts itsACT_PHYSCANNON_ANIMATE_PREactivity. Caused by the object being picked up by the gravity gun.
- OnPhysCannonAnimatePullStarted
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_ANIMATEactivity.ACT_PHYSCANNON_ANIMATE_PREplays once, thenACT_PHYSCANNON_ANIMATEstarts looping.
- OnPhysCannonDetach
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_DETACHactivity (caused by the gravity gun ripping it from a wall).
- OnPhysCannonAnimatePostStarted
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_ANIMATE_POSTactivity (caused by the player letting the prop go from the gravity gun).
- OnPhysCannonPullAnimFinished
- !activator = none
!caller = this entity
Fired when prop has finished all gravity gun-related animations.