Prop physics: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Keyvalues: or = then)
(Templated all keyvalues. I KNOW this template doesn't quite agree with reality, but I'm investigating the matter now - be patient for 24 hours.)
Line 12: Line 12:


==Keyvalues==
==Keyvalues==
 
*{{kv BasePropPhysics}}
* {{kv targetname}}
* {{kv angles}}
* {{kv global}}
 
*'''physdamagescale'''
: <float> Physics Impact Damage Scale - Scales damage energy when this object is hit by a physics object. NOTE: 0 means this feature is disabled for backwards compatibility.
: Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.
 
*'''inertiaScale'''
: <?> Scale Factor For Inertia - Scales the angular mass of an object. Used to hack angular damage and collision response.
 
*'''fademindist'''
: <float> Start Fade Dist - Distance at which the prop starts to fade. (-1 = use fademaxdist)
 
*'''fademaxdist'''
: <float> End Fade Dist - Max fade distance at which the prop is visible. (0 = Don't fade out.)
 
*'''fadescale'''
: <float> fade scale - If you specify a fade in the worldspawn, or if the engine is running under dx7, then the engine will forcibly fade out props even if ''fademindist''/''fademaxdist'' isn't specified. This scale factor gives you some control over the fade. Using 0 here turns off the forcible fades. Numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances.
 
*'''model'''
: <studio> World Model
 
* '''skin'''
: <integer> Some models have multiple versions of their textures, called skins. Set this to a number other than 0 to use that skin instead of the default.
 
* '''disableshadows'''
: {{boolean}} Used to disable dynamic shadows on this entity.
 
* {{kv damagefilter}}
 
*'''ExplodeDamage'''
: <float> Explosion Damage - If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also ''Explosion Radius''.
 
*'''ExplodeRadius'''
: <float> Explosion Radius - If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also ''Explosion Damage''.
 
*'''PerformanceMode'''
: <choices> Performance Mode - Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
 
*'''pressuredelay'''
: <float> Pressure Delay - Delay, in seconds, after 'broken' by pressure before breaking apart (allows for sound to play before breaking apart).
 
* {{kv dxlevelchoice}}
 
*'''minhealthdmg'''
: <integer> Min Damage to Hurt - The prop will ignore any damage events if the damage is less than this amount.
 
*'''shadowcastdist'''
: <?> Shadow Cast Distance - Use this to override how far this object casts shadows. 0 = default distance.
 
*'''Damagetype'''
: {{boolean}} Impact damage type - If set, damage type is sharp, otherwise blunt.
 
*'''nodamageforces'''
: <choices? boolean?> Damaging it Doesn't Push It - Used to determine whether or not damage should cause the brush to move.
 
*'''massScale'''
: <float> Mass Scale - A scale multiplier for the object's mass.
 
*'''overridescript'''
: <string> Override Parameters - 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> Health Level to Override Motion - If specified, this object will start motion disabled. Once its health has dropped below this specified amount, it will enable motion.
 
*'''forcetoenablemotion'''
: <float> Physics Impact Force to Override Motion - If specified, this object will start motion disabled. Any impact that imparts a force greater than this value on the physbox will enable motion.


==Flags==
==Flags==

Revision as of 05:28, 12 March 2006

Template:Wrongtitle

Entity Description

A prop_physics is an entity which, when placed in a map and set with a model, creates a physics object. Physics objects can be picked up with the grav gun, according to their weight, and fully interact with their world in terms of collision, gravity, and world effects. If you have played a source game in any form you have definitely seen one in action. Additional settings in the entity include a multiplayer for weight, name field for I/O interactions, damage type (sharp or blunt), etc. Entities can be flagged to start motion disabled (think saw-blades), and additionally flagged to allow or disallow gravity gun pickup, etc.

If you are creating a multiplayer map, you should use a prop_physics_multiplayer for most objects instead of a prop_physics. Prop_physics is ideal for single-player maps, where accuracy of interactions has no network overhead to worry about. The detail going into the interaction between objects in multiplayer results in an undesirably large network overhead and thus requires the detail of the interactive aspects of the objects be simplified. To solve this, Valve created prop_physics_multiplayer, which uses a much simpler structure of the model to do physics interactions, resulting in much better network play. Extremely simple models (simple being anything "boxy" [computer cases, keyboards, small jars, etc.]) will not have prop_physics_multiplayer settings, but this is fine because those models are so simple that making them prop_physics will not have an adverse effect on network traffic. If you are having a problem in a multiplayer map with a small object that is behaving strongly as a prop_physics_multiplayer, try making it a prop_physics.

If you are making a multiplayer map and want your breakable objects to come back after a while, use a prop_physics_respawnable.

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. To enforce this, the game-related data of props is stored within the model itself. 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. 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.

Keyvalues

Flags


Inputs

  • Break
Breaks the breakable completely. This will make the entity act like a normal func_breakable. If you wish to maintain the shattering behaviour/appearance, consider using the Shatter input below with a large radius value.
  • 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. If the breakable's health reaches zero it will break.
  • RemoveHealth <integer>
Removes health from the breakable. If the breakable's health reaches zero it will break.
  • EnablePhyscannonPickup
Makes the breakable able to picked up by the physcannon.
  • DisablePhyscannonPickup
Makes the breakable not able to picked up by the physcannon.
  • Ignite
Ignite the target entity.


Outputs


See Also