CBreakable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 34: Line 34:
{{DEFINE_KEYFIELD|m_PerformanceMode|FIELD_INTEGER|PerformanceMode}}
{{DEFINE_KEYFIELD|m_PerformanceMode|FIELD_INTEGER|PerformanceMode}}


== Keyvalues ==
=== Keyvalues ===
{{note|Those defined in [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/func_break.cpp#L193 CBreakable::KeyValue] function that may have custom behavior set instead of just setting a single field, {{cmd|ent_dump}} won't show these}}
{{note|Those defined in [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/func_break.cpp#L193 CBreakable::KeyValue] function that may have custom behavior set instead of just setting a single field, {{cmd|ent_dump}} won't show these}}
{{KV|material|intn=0|int|Sets m_Material to values 0 up 3 (0:glass, 1:metal, 2:flesh, 3:wood), if value outside this range is used it will be set to 0}}
{{KV|material|intn=0|int|Sets m_Material to values 0 up 3 (0:glass, 1:metal, 2:flesh, 3:wood), if value outside this range is used it will be set to 0}}

Revision as of 04:34, 20 September 2024

C++ Class hierarchy
CBreakable
CBaseEntity
C++ func_break.cpp

Entities linked to this class

Fields

m_Material <FIELD_INTEGER>

m_hBreaker <FIELD_EHANDLE>

m_angle <FIELD_FLOAT>

m_iszGibModel <FIELD_STRING>

m_iszSpawnObject <FIELD_STRING>

m_bTookPhysicsDamage <FIELD_BOOLEAN>

m_iszPropData <FIELD_STRING>

m_flDmgModBullet <FIELD_FLOAT>

m_flDmgModClub <FIELD_FLOAT>

m_flDmgModExplosive <FIELD_FLOAT>

m_iszPhysicsDamageTableName <FIELD_STRING>

m_iszBreakableModel <FIELD_STRING>

m_iBreakableSkin <FIELD_INTEGER>

m_iBreakableCount <FIELD_INTEGER>

m_iMaxBreakableSize <FIELD_INTEGER>

m_iszBasePropData <FIELD_STRING>

m_iInteractions <FIELD_INTEGER>

m_explodeRadius <FIELD_FLOAT>

m_iszModelName <FIELD_STRING>

m_hPhysicsAttacker <FIELD_EHANDLE>

m_flLastPhysicsInfluenceTime <FIELD_TIME>


Keyfields

m_ExplosionMagnitude <FIELD_INTEGER> (explodemagnitude)

m_flPressureDelay <FIELD_FLOAT> (PressureDelay)

m_iMinHealthDmg <FIELD_INTEGER> (minhealthdmg)

m_Explosion <FIELD_INTEGER> (explosion)

m_GibDir <FIELD_VECTOR> (gibdir)

m_PerformanceMode <FIELD_INTEGER> (PerformanceMode)


Keyvalues

Note.pngNote:Those defined in CBreakable::KeyValue function that may have custom behavior set instead of just setting a single field, ent_dump won't show these
material <integer>
Sets m_Material to values 0 up 3 (0:glass, 1:metal, 2:flesh, 3:wood), if value outside this range is used it will be set to 0
deadmodel
Does nothing
shards
Does nothing
lip
Does nothing
gibmodel <string>
Sets m_iszGibModel
spawnobject <integer>
Takes index to array of strings pSpawnObjects and sets m_iszSpawnObject to the chosen element
propdata <integer>
Takes index to array of strings pFGDPropData and sets m_iszPropData to the chosen element. Gives Warning("func_breakable with invalid propdata %d.\n", pdata ); if value out of range given

Inputs

m_impactEnergyScale <FIELD_FLOAT> (physdamagescale)


Input functions

Break <FIELD_VOID> linked function: InputBreak

description todo

SetHealth <FIELD_INTEGER> linked function: InputSetHealth

description todo

AddHealth <FIELD_INTEGER> linked function: InputAddHealth

description todo

RemoveHealth <FIELD_INTEGER> linked function: InputRemoveHealth

description todo

SetMass <FIELD_FLOAT> linked function: InputSetMass

description todo

Touch think function

BreakTouch <FIELD_VOID>

Has checks for 'Break on Touch', 'Break on Pressure' flags

Think function

Die <FIELD_VOID>

Used as think function for delaying breaking of breakable by PressureDelay after it was stood on

Outputs

m_OnBreak
OnBreak
m_OnHealthChanged
OnHealthChanged

See Also