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

Prop data: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(63 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== Setting up a prop model ==
{{LanguageBar}}
Once you've built your prop model, you need to setup the prop data that should be enforced. Prop data is embedded into the <code>[[$keyvalues]]</code> section of the model's [[QC Commands|.QC]] file.  
{{toc-right}}
{{this is a|[[QC]] [[$keyvalues|keyvalue]]|name=prop_data}} It is used to specify specific data about a prop. It can be used to make a model:


First, you need to decide how the prop should be simulated. For HL2, Valve tried to follow these general rules:
* {{↓|Options|Physical}} (by default models with <code>prop_data</code> cannot be [[prop_static|static]])
* If it's going to attach to, or act as a support for a non moving thing, it should be static.
* {{↓|Damage modifiers|Breakable}} (with {{↓|Gibs|gibs}})
* If it generates light, it should be static.
* {{↓|Flammable props|Flammable}}
* If it's really big and the player can't possibly move it, it should be static.
* {{↓|Exploding props|Explosive}}
* Otherwise, it should be physically simulated.


'''If you want your prop to be static''', then you're done. Any model without a prop_data section in its <code>$keyvalues</code> section will be forced to be static. If a level designer places it as a <code>prop_physics</code> entity, it will be removed during BSP compile and a warning will be displayed in the compiler log.
It is a [[KeyValues]] block embedded with the QC command <code>[[$keyvalues]]</code>.


'''If you want your prop to be physically simulated''', then you need to add a prop_data block into <code>$keyvalues</code> section to the model's .QC file, unless it's there already. An example <code>$keyvalues</code> entry would look something like this:
{{note|The properties of a model's ''surface'' are defined by <code>[[$surfaceprop]]</code>.}}
{{note|Models for use with [[prop_physics]] will also need <code>[[$staticprop]]</code>.}}
 
== Example ==


  [[$keyvalues]]
  [[$keyvalues]]
Line 16: Line 19:
  prop_data
  prop_data
  {
  {
  base Wooden.Small
  base Wooden.Small  
  dmg.bullets 0
  dmg.bullets 0  
  explosive_damage 100
  explosive_damage 100
  explosive_radius 100
  explosive_radius 50
  }
  }
  }
  }
This example prop_data entry tells the prop to derive all of its data from the base class "<code>Wooden.Small</code>" entry in the <code>propdata.txt</code> file. It then goes on to override several values, making the model immune to bullet damage but creating an explosion when the model breaks.
To find the best prop_data base class for your model, see [[prop_data base material guidelines]]. If you are modelling for a mod that doesn't use the default propdata.txt, open up the <code>mod/scripts/propdata.txt</code> file and find the entry that best matches the prop you've built. Make sure you choose a "<code><material>.<size></code>" entry, not the "<code><material>.Base</code>" entry that simply sets damage modifiers for the material type.
{{tip|When compiling your model's prop_data, you can help your game / mod to be consistent by following these tips:}}
* You don't need to override anything at all if you don't want to. Just use <code>base</code> and you've got a working physics prop.
* Don't override health levels in all your props. Instead, use the base prop classes and let them set the health. This way you won't have one chair that takes twice as much health as every other chair.
* Whenever possible, avoid mixing material types inside the same prop. i.e. don't make half-metal, half-wood props.
* Follow the HL2 rules unless you have good reason to change them: metal & plastic are invulnerable. Everything else breaks.
* Avoid collecting multiple objects into the same prop, especially if we individually simulate identical looking objects elsewhere.
* Avoid moving parts & materials we don't simulate, i.e. don't hang coats from a coat rack.
== prop_data keyvalues ==
; base <[[prop_data_base_material_guidelines|choices]]> : Defines the main breakable properties of the prop according to the material from which it is made.
* The parameter must be the name of a prop_data base class.
* For your convenience, here is [[Prop_data_base_material_guidelines|a list of the Source SDK Base prop_data base classes for use with models]].
* If specified, this prop will inherit its prop_data from the base class. Further prop_data key/values will override any "base class" values.
* Your mod's quirky prop_data "base classes" will be defined in <code>game_dir/scripts/propdata.txt</code>.


; allowstatic <[[boolean]]> : An override to allow this prop to be a prop_static as well as a prop_physics.
Here we derive prop_data from the generic base_type "Wooden.Small". Then we use additional keyvalues to give the model three special characteristics: it will be bulletproof, but when it breaks it will explode and cause up to 100 damage to entities within a 50 unit radius.
* In general, this should not be used.


==Tips==


; physicsmode <[[physicsmode choices|choices]]> : Sets the physics mode used by the [[prop_physics_multiplayer]].  
;You don't need to override anything at all if you don't want to
{{physicsmode choices}}
:Just set a <code>base</code> and you've got a working physics prop.
* {{ep2 add|The model's physicsmode may be overriden the [[prop_physics_multiplayer]] entity properties.}}
;Don't override health levels in all your props
:Instead, let the base types set the health. This way you won't have one chair that takes twice as much damage as every other chair.
;Whenever possible, avoid mixing material types inside the same prop
:Don't make half-metal, half-wood props.
;Avoid collecting multiple objects into the same prop
:Especially if you or Valve individually simulate identical-looking objects elsewhere.
;Avoid moving parts and materials Source doesn't simulate
:Don't put water in a physical fish tank.


=== Should my model be physical? ===


; blockLOS <[[boolean]]> : Used to override whether this prop should block NPC's [[LOS|Line of Sight]].
In Half-Life 2, Valve tried to follow these general rules:
* If unspecified, the game engine will decide whether it blocks NPC LOS based on the model size.
* Use this to enforce a desired sight blocking behaviour.


;If it's going to attach to or act as a support for a non-moving thing...
:It should be static.
;If it generates static light...
:It should be static.
;If it's really big and the player couldn't possibly move it...
:It should be static.
;Otherwise...
:It should be physical.


; AIWalkable <[[boolean]]> : Used to set whether AI should consider this prop as a floor candidate.
Additionally, Valve consider metal and plastic invulnerable but everything else breakable.


=== breakable props ===
== Options ==


Primarily, the <code>health</code> of the model determines if and when the model will break into gibs and/or explode.
=== Base type ===
* If model's health is set to "0" or "" (null), it will not take damage and is not breakable and cannot explode.
* All prop_data "base classes" define the health of models based on them and, by default, only models based on Metal, Plastic or Item "base classes" are unbreakable.


; <code>base <[[string]]></code>
: Gives the model a [[prop_data base types|predefined prop_data type]], providing in one motion all the data the engine needs to make the model both physical and breakable. Most other commands in a prop_data block are overrides of values inherited from here.


; health <integer> : The amount of damage this prop should take before breaking.
===General===
* If set to "0" or "", this prop will not take damage and is not breakable.
* This value is inherited from all "base classes". Specify only to override.


; <code>health <[[int]]></code>
: The amount of damage this prop should take before breaking. 0 means don't break.
; <code>allowstatic <[[bool]]></code>
: Allows the model to be used with [[prop_static]]. This is disabled by default to enforce consistency.<br>As this is only checked by the compilers and by not the engine, modified [[VBSP|BSP]] compilers (ex: {{slammin}}{{gmod}}) can be used to compile physics props as static regardless of this variable.
; <code>physicsmode <choices></code>
: Sets the physics mode used by [[prop_physics_multiplayer]]. Can be overridden by the entity in the Orange Box.
{{physicsmode choices}}
; <code>blockLOS <bool></code>
: Overrides whether the prop should block NPC [[line of sight]]. If unspecified, the game engine will decide based on the model's dimensions.
; <code>AIWalkable <bool></code>
: Should NPCs try walking over this prop? {{todo|Does prop type matter?}}


==== damage modifiers ====
=== Damage modifiers ===


''Use damage modifiers to reflect differences between the amount of damage that an object takes from different attacks. '''Don't''' use them to reflect overall damage strength. (e.g. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.)''


; damage_table <[[damage_table choices|choices]]> : The name of the Damage Table to use for this prop.
; <code>dmg.bullets</code> <float> : Modifies damage done by bullets.
{{damage_table choices}}
:* Paper, Cloth and Glass = 0.5
* Only props with the Glass and Pottery "base class" inherit a damage_table ("glass").
:* Wood = 0.75
* Use <code> damage_table "" </code> to ignore a damage_table inherited from "base" class
:* Flesh = 1.25.
* Damage tables are defined in code (physics_impact_damage.cpp). Only the stock tables are mentioned here.
; <code>dmg.club</code> <float> : Modifies damage done by blunt impacts.
:* Cloth = 0.75
:* Paper and Pottery = 1.25
:* Wood = 2.0
; <code>dmg.explosive</code> <float> : Modifies damage done by explosions.
:* Paper, Cloth, Pottery, Flesh and Wood = 1.5
; <code>damage_table</code> <choices>
: [[Impact Damage Table]]s are defined in C++ code (in physics_impact_damage.cpp), and contain very detailed information about what damage a prop should take from different directions and forces. Only Glass and Pottery base_types inherit one. {{tip|Use <code> damage_table "" </code> to ignore an inherited table.}}
:; <code>glass</code>
:: Extremely fragile, will break just by being dropped.
:; <code>player</code>
:: {{todo}}
:; <code>player_vehicle</code>
:: {{todo}}
:; <code>npc</code>
:: {{todo}}


=== Flammable props ===


; dmg.bullets <float> : Modifies damage done by bullets to this prop.
See [[Prop interactions#Fire interactions|fire_interactions]]
* For most "base classes" this is set to "1.0" but Paper, Cloth & Glass Window = "0.5", Wood = "0.75", and Flesh = "1.25".


=== Exploding props ===


; dmg.club <float> : Modifies damage done by clubs to this prop.
''If these two fields are specified for a prop, and it is given health so that it can be damaged, then it will explode when it breaks.''
* For most "base classes" this is set to "1.0" but Cloth = "0.75", Paper & Pottery = "1.25", Wood = "2.0".


; <code>explosive_damage <float></code>
: The amount of explosive damage.
; <code>explosive_radius <float></code>
: The radius of the explosion. Damage falls off as distance from the origin increases.


; dmg.explosive <float> : Modified damage done by explosives to this prop.
''See the "explode_fire" [[Prop interactions|prop interaction]] for explosions that only ignite entities''
* Use damage modifiers to reflect differences between the amount of damage that an object takes from different damage types. Don't use them to reflect overall damage strength. i.e. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.
* For most "base classes" this is set to "1.0" but Paper, Cloth, Pottery, Flesh & Wood = "1.5".


=== Interactions ===


==== flammable props ====
Prop interactions are technically part of prop_data and can be used in base types and even within prop_data's $keyvalues section, but they are usually used separately and can be embedded in a model as independent blocks without the direct use of prop_data at all. They are used to serve specific functions like sticking to a wall when launched by the gravity gun or igniting when at half-health.


Read more about them [[Prop interactions|here]].


'''fire_interactions''' is a sub-set of the prop_data $keyvalues that defines flammability. There are currently only 3 known parameters.
=== Gibs ===
* {{todo|confirm : conceivably unbreakable props might still be flammable ...}}
* QC syntax example :
[[$keyvalues]] {
    prop_data {
      fire_interactions {
          '''ignite "halfhealth"''' // This prop will ignite itself when its health falls below half its starting health.
          '''explosive_resist "yes"''' // This reduces blast damage to the prop so it ignites instead of breaking.
          '''flammable "yes"''' // This prop can be ignited by nearby fires & "explode_fire" physgun missiles.
      }
    }
}


;ignite <choices>
''The prop_data system handles generic [[Wikipedia:Gibs|gibs]]. Generic gibs are used for any breakable object that doesn't have [[Creating Custom Breakable Gibs|custom gibs]].''
:{|
! Literal Value || Description
|-
| halfhealth || This prop will ignite itself when its health falls below half its starting health.
|}
;explosive_resist <choices>
:{|
! Literal Value || Description
|-
| yes || This sets a special behavior on the prop that reduces blast damage it takes. If the prop is about to take blast damage that would kill it, it will reduce the damage enough to not die, and then ignite itself instead.
|}
;flammable <choices>
:{|
! Literal Value || Description
|-
| yes || This prop can be ignited by ignition damage (such as nearby fires & props marked with the "explode_fire" physcannon interaction. This was unused in HL2, and hence unsupported as this time.
|}


; <code>breakable_model <choices></code>
: Defines the set of generic gibs (as defined in <code>scripts\propdata.txt</code>) this prop should break into. Props with a wooden base type gib in this manner already. See also [[Creating Custom Breakable Gibs|creating custom gibs]].
:* <code>WoodChunks</code>
:* <code>GlassChunks</code>
:* <code>ConcreteChunks</code>
:* <code>MetalChunks</code>
; <code>breakable_count <int></code>
: The number of generic breakable gibs to break into. If this is not specified, the engine will generate a sensible number based on the gibs' and model's sizes.
; <code>breakable_skin <int></code>
: Allows you to specify a skin to use on the gib models, which is useful for matching the original prop's skin.
: Only props with Wooden base_types inherit a gib skin (skin 0).
; <code>multiplayer_break <choices></code>
: {{confirm|Determines where the gibs from a [[prop_physics_multiplayer]] are simulated.}}
:* <code>both</code>
:* <code>server</code>
:* <code>client</code> (default)


==== gibs ====
* {{todo|Confirm whether breakable_count, breakable_skin and multiplayer_break do not affect custom gibs.}}
* {{todo|Confirm whether multiplayer_break is set for the breakable model rather than each individual gib itself.}}


== Creating new base types ==


The prop_data system handles generic [[Wikipedia:Gibs|gibs]]. Generic gibs are used for any breakable object that doesn't have [[Creating Custom Breakable Gibs|custom gibs]]. Custom gibs are assigned to a model using the [[$collisiontext]] QC command.  
All base types are defined in <code>scripts\propdata.txt</code>. If you edit a base type in this file, you will affect the behaviour of all models using it (that do not have their own overrides).


The format of the file is:


; breakable_model <[[breakable_model choices|choices]]> : Defines the set of generic gibs this prop should break into.  
<source lang=cpp>
:{{breakable_model choices}}
PropData.txt
* Only props with the Wood "base class" inherit a gibset (WoodChunks).
{
* This is only necessary if the prop doesn't have [[Creating Custom Breakable Gibs|custom gibs]]. In general custom gibs are far superior to generic ones, but of course, there's a limit to how many custom gibs you can fit into memory.
<base type name>
* Generic Gibsets are defined at the bottom of <code>mod/scripts/propdata.txt</code>.
{
<any number of the prop_data KVs listed above>
}
}
</source>


Valve generally only use their base types to set health and damage modifiers.


; breakable_count <integer> : The number of generic breakable gibs to break into. Required for gibs to appear.
=== Creating generic gibs ===
* This allows you to hard-code the number gibs yourself. By default the game engine will attempt to attribute a sensible number of generic gib models within the volume of the breaking object, based upon their (and its) size.
* Only props with the Wood "base class" inherit a gib count - ranging from Wood.Tiny = 0 through to Wood.Huge =10.


Generic gibsets are also defined in propdata.txt. Valve have only four, and only one (<code>WoodChunks</code>) is assigned to a base type - most models instead specify theirs directly, with <code>breakable_model</code>.


; breakable_skin <integer> : The skin to use on the generic breakable models.
Defining a new gibset is easy as most of the work is done by the engine:
* Allows you to specify a skin to use on the gib models, which is useful for matching the original prop's material.
* Only props with the Wood "base class" inherit a gib skin (skin 0).
 
 
; multiplayer_break <[[multiplayer_break choices|choices]]> : Determines whether the gibs from a [[prop_physics_multiplayer]] are simulated on the Client or Server or both.
: {{multiplayer_break choices}}
* Usually small gibs have no significant collision effect that might influence in-game events, so these are handled clientside rather than using up client-server connection bandwidth.
* {{todo|confirm that multiplayer_break is set for the breakable model rather than each individual gib itself.}}
 
 
==== exploding props ====
 
 
If these two fields are specified for a prop, then the prop will create an explosion with the specified values when it breaks.
[[$keyvalues]] {
    prop_data {
      health 1 // health must be >0 for the prop to be breakable.
      '''explosive_damage <float>''' // The amount of explosive damage done by this prop when it breaks.
      '''explosive_radius <float>''' // The radius of the explosion caused by this prop when it breaks.
    }
}
 
== physgun_interactions ==
The physgun_interactions $keyvalues set affects how props are handled, etc by the [[weapon_physcannon|physcannon]]. Note that they are not part of the prop_data block : example QC syntax:
 
[[$keyvalues]] {
    physgun_interactions {
      preferred_carryangles "0 0 0"
      onworldimpact "stick"
      onfirstimpact "break"
      onfirstimpact "paintsplat"
    // onfirstimpact "impale"
    // onlaunch "spin_none"
      onlaunch "spin_zaxis"
      onbreak "explode_fire"
      damage "none"
    }
}
 
;preferred_carryangles <[[angles]]>
:Sets the angles, relative to the player's orientation, at which the prop will be held when carried.
* This is used, for example, with the sawblades and propellers in [[Ravenholm]], as well as the turret NPCs in [[Nova Prospekt]].
 
;onworldimpact <choices>
:{|
! Literal Value || Description
|-
| stick || Prop will embed itself into the world if it hits it after being launched.
|}
;onfirstimpact <choices>
:{|
! Literal Value || Description
|-
| break || Prop should always break on colliding with anything after being launched.
|-
| paintsplat || Prop applies paint decals to the first thing it hits after being launched.
|-
| impale || Prop impales whatever it first collides with after being launched. Not used in HL2, and hence unsupported at this time.
|}
;onlaunch <choices>
:{|
! Literal Value || Description
|-
| spin_none || Prop does not spin when launched. By default, the physgun applies random angular velocity to objects it launches.
|-
| spin_zaxis || Prop should spin around the Z axis when launched by the physcannon.
|}
;onbreak <choices>
:{|
! Literal Value || Description
|-
| explode_fire || Prop ignites nearby enemies when it explodes on breaking.
|}
;damage <choices>
:{|
! Literal Value || Description
|-
| none || Prop does not move when 'attacked' with the physgun. It may still take damage, but it won't move due to the impact.
|}
 


<source lang=cpp>
PropData.txt
{
BreakableModels
{
WoodChunks
{
// Smallest to largest:
models\Gibs\wood_gib01e.mdl 1
models\Gibs\wood_gib01d.mdl 1
models\Gibs\wood_gib01c.mdl 1
models\Gibs\wood_gib01b.mdl 1
models\Gibs\wood_gib01a.mdl 1
}
}
}
</source>


== Prototyping models ==
== Prototyping models ==
Line 237: Line 193:
When working on prototypes, or when you don't have modellers handy, it's useful to be able to work around the prop data system's enforcement. To do this, use the [[prop_physics_override]] and [[prop_dynamic_override]] entities instead of [[prop_physics]] and [[prop_dynamic]]. A [[prop_physics_override]] entity will not remove itself if it is assigned a model that wants to be static (i.e. has no "prop_data" entry in its <code>$keyvalues</code> .[[qc|QC]] section). It will also allow the level designer to set its "health".
When working on prototypes, or when you don't have modellers handy, it's useful to be able to work around the prop data system's enforcement. To do this, use the [[prop_physics_override]] and [[prop_dynamic_override]] entities instead of [[prop_physics]] and [[prop_dynamic]]. A [[prop_physics_override]] entity will not remove itself if it is assigned a model that wants to be static (i.e. has no "prop_data" entry in its <code>$keyvalues</code> .[[qc|QC]] section). It will also allow the level designer to set its "health".


The override entities allow you to temporarily use models incorrectly while prototyping, or waiting for a modeller to finish up a new model that has the properties you desire. '''It is highly recommended''' that you use Hammer's [[Hammer Entity Report Dialog|Entity Report]] feature to check each of your maps to ensure you have no override entities left when you ship them. Otherwise you may be shipping physics inconsistencies, and players are extremely quick to notice them (the orange bucket won't move when I shoot it on this level, but it did on the previous one).
The override entities allow you to temporarily use models incorrectly while prototyping, or waiting for a modeller to finish up a new model that has the properties you desire. '''It is highly recommended''' that you use Hammer's [[Hammer Entity Report Dialog|Entity Report]] feature to check each of your maps to ensure you have no override entities left when you ship them. Otherwise you may be shipping physics inconsistencies, and players are extremely quick to notice them.


== propdata.txt ==
See also [[func_physbox]] for brush-based physics objects.


The purpose of the '''Prop Data''' system is to ensure that the interactive behavior of prop models stays consistent across all the levels in your game / mod. The three core prop entities ([[prop_static]], [[prop_dynamic]], and [[prop_physics]]) all use the prop data system to load game-related data from the model they're set to use. This section will explain how you can edit it in your mod.
== See also ==
 
The Prop Data system stores data hierarchically. The prop_data base classes are defined inside the <code>mod\scripts\propdata.txt</code> file. Wherever possible, models use one of these classes instead of defining their own class. This ensures a reasonable level of consistency in physics with models, and makes it easier to apply tweaks to the entire set of prop models without having to recompile each mdl. For example, in response to Half-Life 2 playtests, Valve tweaked the overall amount of health for all wooden objects in the game several times.
 
The <code>propdata.txt</code> format is a KeyValue formatted data file, where each entry matches the following format:


<material_type>.<size_description> // Suggested format; you can actually call it anything you like (but avoid spaces)
* [[prop_data base types]]
{
key "value x or y" // If there is a space or tab character within a key or value, you need quote marks around it
(...)
}
 
== See also ==
* [[prop_static]], [[prop_dynamic]], [[prop_physics]] - common prop entities.
* [[prop_static]], [[prop_dynamic]], [[prop_physics]] - common prop entities.
* [[Prop Types Overview]] - an article describing various prop types.
* [[Prop Types Overview]] - an article describing various prop types.
* [[Prop interactions]] - a group of QC $keyvalues blocks that handles some interactions with outside forces and defines other properties


{{otherlang:en}}
{{otherlang:en:jp|Prop data:jp}}
[[Category:Level Design]]
[[Category:Modeling]]
[[Category:Modeling]]
[[Category:QC Keyvalues]]
[[Category:English]]

Latest revision as of 04:44, 30 March 2025

English (en)日本語 (ja)Русский (ru)Translate (Translate)

prop_data is a QC keyvalue available in all Source Source games. It is used to specify specific data about a prop. It can be used to make a model:

It is a KeyValues block embedded with the QC command $keyvalues.

Note.pngNote:The properties of a model's surface are defined by $surfaceprop.
Note.pngNote:Models for use with prop_physics will also need $staticprop.

Example

$keyvalues
{
	prop_data
	{
		base			Wooden.Small 
		dmg.bullets		0 
		explosive_damage	100
		explosive_radius	50 
	}
}

Here we derive prop_data from the generic base_type "Wooden.Small". Then we use additional keyvalues to give the model three special characteristics: it will be bulletproof, but when it breaks it will explode and cause up to 100 damage to entities within a 50 unit radius.

Tips

You don't need to override anything at all if you don't want to
Just set a base and you've got a working physics prop.
Don't override health levels in all your props
Instead, let the base types set the health. This way you won't have one chair that takes twice as much damage as every other chair.
Whenever possible, avoid mixing material types inside the same prop
Don't make half-metal, half-wood props.
Avoid collecting multiple objects into the same prop
Especially if you or Valve individually simulate identical-looking objects elsewhere.
Avoid moving parts and materials Source doesn't simulate
Don't put water in a physical fish tank.

Should my model be physical?

In Half-Life 2, Valve tried to follow these general rules:

If it's going to attach to or act as a support for a non-moving thing...
It should be static.
If it generates static light...
It should be static.
If it's really big and the player couldn't possibly move it...
It should be static.
Otherwise...
It should be physical.

Additionally, Valve consider metal and plastic invulnerable but everything else breakable.

Options

Base type

base <string>
Gives the model a predefined prop_data type, providing in one motion all the data the engine needs to make the model both physical and breakable. Most other commands in a prop_data block are overrides of values inherited from here.

General

health <int>
The amount of damage this prop should take before breaking. 0 means don't break.
allowstatic <bool>
Allows the model to be used with prop_static. This is disabled by default to enforce consistency.
As this is only checked by the compilers and by not the engine, modified BSP compilers (ex: Slammin' Source Map ToolsGarry's Mod) can be used to compile physics props as static regardless of this variable.
physicsmode <choices>
Sets the physics mode used by prop_physics_multiplayer. Can be overridden by the entity in the Orange Box.
Number Name Description
1 Solid, Server-side Solid, pushes the player away.
2 Non-Solid, Server-side Non-solid, but gets pushed away by the player.
3 Non-Solid, Client-side Non-solid, clientside simulated only.
blockLOS <bool>
Overrides whether the prop should block NPC line of sight. If unspecified, the game engine will decide based on the model's dimensions.
AIWalkable <bool>
Should NPCs try walking over this prop?
Todo: Does prop type matter?

Damage modifiers

Use damage modifiers to reflect differences between the amount of damage that an object takes from different attacks. Don't use them to reflect overall damage strength. (e.g. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.)

dmg.bullets <float>
Modifies damage done by bullets.
  • Paper, Cloth and Glass = 0.5
  • Wood = 0.75
  • Flesh = 1.25.
dmg.club <float>
Modifies damage done by blunt impacts.
  • Cloth = 0.75
  • Paper and Pottery = 1.25
  • Wood = 2.0
dmg.explosive <float>
Modifies damage done by explosions.
  • Paper, Cloth, Pottery, Flesh and Wood = 1.5
damage_table <choices>
Impact Damage Tables are defined in C++ code (in physics_impact_damage.cpp), and contain very detailed information about what damage a prop should take from different directions and forces. Only Glass and Pottery base_types inherit one.
Tip.pngTip:Use damage_table "" to ignore an inherited table.
glass
Extremely fragile, will break just by being dropped.
player
[Todo]
player_vehicle
[Todo]
npc
[Todo]

Flammable props

See fire_interactions

Exploding props

If these two fields are specified for a prop, and it is given health so that it can be damaged, then it will explode when it breaks.

explosive_damage <float>
The amount of explosive damage.
explosive_radius <float>
The radius of the explosion. Damage falls off as distance from the origin increases.

See the "explode_fire" prop interaction for explosions that only ignite entities

Interactions

Prop interactions are technically part of prop_data and can be used in base types and even within prop_data's $keyvalues section, but they are usually used separately and can be embedded in a model as independent blocks without the direct use of prop_data at all. They are used to serve specific functions like sticking to a wall when launched by the gravity gun or igniting when at half-health.

Read more about them here.

Gibs

The prop_data system handles generic gibs. Generic gibs are used for any breakable object that doesn't have custom gibs.

breakable_model <choices>
Defines the set of generic gibs (as defined in scripts\propdata.txt) this prop should break into. Props with a wooden base type gib in this manner already. See also creating custom gibs.
  • WoodChunks
  • GlassChunks
  • ConcreteChunks
  • MetalChunks
breakable_count <int>
The number of generic breakable gibs to break into. If this is not specified, the engine will generate a sensible number based on the gibs' and model's sizes.
breakable_skin <int>
Allows you to specify a skin to use on the gib models, which is useful for matching the original prop's skin.
Only props with Wooden base_types inherit a gib skin (skin 0).
multiplayer_break <choices>
Confirm:Determines where the gibs from a prop_physics_multiplayer are simulated.
  • both
  • server
  • client (default)
  • Todo: Confirm whether breakable_count, breakable_skin and multiplayer_break do not affect custom gibs.
  • Todo: Confirm whether multiplayer_break is set for the breakable model rather than each individual gib itself.

Creating new base types

All base types are defined in scripts\propdata.txt. If you edit a base type in this file, you will affect the behaviour of all models using it (that do not have their own overrides).

The format of the file is:

PropData.txt
{
	<base type name>
	{
		<any number of the prop_data KVs listed above>
	}
}

Valve generally only use their base types to set health and damage modifiers.

Creating generic gibs

Generic gibsets are also defined in propdata.txt. Valve have only four, and only one (WoodChunks) is assigned to a base type - most models instead specify theirs directly, with breakable_model.

Defining a new gibset is easy as most of the work is done by the engine:

PropData.txt
{
	BreakableModels
	{
		WoodChunks
		{
			// Smallest to largest:
			models\Gibs\wood_gib01e.mdl	1
			models\Gibs\wood_gib01d.mdl	1
			models\Gibs\wood_gib01c.mdl	1
			models\Gibs\wood_gib01b.mdl	1
			models\Gibs\wood_gib01a.mdl	1
		}
	}
}

Prototyping models

When working on prototypes, or when you don't have modellers handy, it's useful to be able to work around the prop data system's enforcement. To do this, use the prop_physics_override and prop_dynamic_override entities instead of prop_physics and prop_dynamic. A prop_physics_override entity will not remove itself if it is assigned a model that wants to be static (i.e. has no "prop_data" entry in its $keyvalues .QC section). It will also allow the level designer to set its "health".

The override entities allow you to temporarily use models incorrectly while prototyping, or waiting for a modeller to finish up a new model that has the properties you desire. It is highly recommended that you use Hammer's Entity Report feature to check each of your maps to ensure you have no override entities left when you ship them. Otherwise you may be shipping physics inconsistencies, and players are extremely quick to notice them.

See also func_physbox for brush-based physics objects.

See also