Moving, interactive object properties.
More...
|
enum | propinfo_t {
PROPINFO_HEALTH
, PROPINFO_FLAGS
, PROPINFO_DMG_BULLET
, PROPINFO_DMG_MELEE
,
PROPINFO_DMG_EXPLOSIVE
, PROPINFO_EXPLOSIVE_DMG
, PROPINFO_EXPLOSIVE_RADIUS
, PROPINFO_BREAKMODEL
,
PROPINFO_BREAKCOUNT
, PROPINFO_SKIN
, PROPINFO_MASS
, PROPINFO_DAMPING_LINEAR
,
PROPINFO_DAMPING_ANGULAR
, PROPINFO_INERTIA
, PROPINFO_VOLUME
, PROPINFO_SURFACEPROP
} |
|
Moving, interactive object properties.
Prop data
The prop data system was introduced in Source Engine 2004, it's been integrated into Nuclide and supported in a few different ways.
Overview
It allows you to easily create, without any programming knowledge, breakable props and entities.
That way, when you place prop_dynamic entities into the world for example, they will all have the same material, health and behavior when being interacted with.
Other entities, such as func_breakable can also take advantage of them.
Specs
According to Source SDK's propdata.txt we've got a kinda sorta hacky definition table for this stuff:
"PropData.txt"
{
"sometype"
{
"health" "10"
"breakable_model" "somematerial"
}
"BreakableModels"
{
"somematerial"
{
"foo.vvm" "2.5"
"foo.mdl#submodels=9" "5.0"
}
}
}
The idea is that props specify the type of prop they are ("sometype") and it defines a set of sensible defaults.
However, props can override any parts of this inside the model data itself. Currently no model format FTEQW supports allows for reading of said propdata. However we'll be loading "foobar.vvm.propdata" to remedy this for those.
Usage
Any entity in Nuclide that inherits NSSurfacePropEntity can take advantage of the propdata features.
Either the entity inside the map defines which propdata definition it wants to use (via the .propdata string field), or the model file has a text definition alongside as mentioned above.
Map entity key
An example for the example specification listed above would be a propdata key/value pair as part of the entity definition:
{
"classname" "func_wall"
"model" "*42"
"propdata" "sometype"
}
Model propdata definition
If you had a model, e.g. located at models/foobar.vvm
then if you were to place a file named models/foobar.vvm.propdata
alongside it with the following contents:
PropData.txt
{
prop_data
{
"health" "30"
"breakable_model" "somematerial"
"breakable_count" "10"
}
}
This registers an internal propdata definition with the name models/foobar.vvm.propdata** that would correspond to the above contents. You have to absolutely make sure that the model's .propdata file calls the data structure prop_data however, like described above.
You don't have to do anything else in the entity, the prop model will now have health of 30 and break into 'somematerial' upon its destruction.
Commands
- base <string>: Which propdata fields to inherit.
- blockLOS <bool>: Will this prop break the line-of-sight of NPCs?
- AIWalkable <bool>: Can AI walk over this?
- allow_static <bool>: Will static props use this definition?
- dmg.bullets <float>: Damage multiplier for bullets.
- dmg.club <float>: Damage multiplier for melee weapons.
- dmg.explosive <float>: Damage multiplier for explosive weapons.
- health <int>: Absolute amount of health on spawn.
- explosive_damage <int>: Makes the entity explosive, with <int> specifying the max amount of damage.
- explosive_radius <float>: Sets the explosion radius in q units. Is 2.5 times the damage by default.
- breakable_particle <string>: Which particle effect to play when this entity breaks.
- breakable_model <string>: Which models to spawn when it breaks.
- breakable_count <int>: The amount of models it'll spawn upon breaking.
- surfaceprop <string>: Surfaceprop override for the object.
Physics Object Commands
These are only relevant for when you want to use a phyics object, or rather an object that's handled by NSPhysicsEntity, such as prop_physics.
- mass <float>: Mass of the object, in kilograms.
- volume <float>: Volume of the object, in cubic meters.
- inertia <float>: Inertia multiplier.
- damping <float>: Linear movement damping multiplier.
- rotdamping <float>: Angular movement damping multiplier.
◆ propinfo_t
Enumerator |
---|
PROPINFO_HEALTH | |
PROPINFO_FLAGS | |
PROPINFO_DMG_BULLET | |
PROPINFO_DMG_MELEE | |
PROPINFO_DMG_EXPLOSIVE | |
PROPINFO_EXPLOSIVE_DMG | |
PROPINFO_EXPLOSIVE_RADIUS | |
PROPINFO_BREAKMODEL | |
PROPINFO_BREAKCOUNT | |
PROPINFO_SKIN | |
PROPINFO_MASS | |
PROPINFO_DAMPING_LINEAR | |
PROPINFO_DAMPING_ANGULAR | |
PROPINFO_INERTIA | |
PROPINFO_VOLUME | |
PROPINFO_SURFACEPROP | |
◆ BreakModel_Receive()
◆ BreakModel_ReceiveClientData()
void BreakModel_ReceiveClientData |
( |
void |
| ) |
|
◆ BreakModel_SpawnID()
void BreakModel_SpawnID |
( |
vector |
smins, |
|
|
vector |
smaxs, |
|
|
vector |
dir, |
|
|
float |
speed, |
|
|
int |
count, |
|
|
int |
index |
|
) |
| |
◆ Prop_GetInfo()
__variant Prop_GetInfo |
( |
int |
i, |
|
|
int |
type |
|
) |
| |
◆ PropData_Finish()
int PropData_Finish |
( |
void |
| ) |
|
◆ PropData_ForModel()
int PropData_ForModel |
( |
string |
modelname | ) |
|
◆ PropData_Init()
◆ PropData_Load()
int PropData_Load |
( |
string |
type | ) |
|
◆ PropData_SetStage()
◆ PropData_Shutdown()
◆ enumflags
Initial value:{
PDFL_BLOCKLOS,
PDFL_AIWALKABLE,
PDFL_ALLOWSTATIC
} propdataFlag_t
◆ g_breakmodel
◆ g_breakmodel_count
◆ g_breakmodel_end
◆ g_curPropData
◆ g_hashbreakmodel
var hashtable g_hashbreakmodel |
◆ g_hashpropdata
var hashtable g_hashpropdata |
◆ g_propdata
◆ g_propdata_count