CBaseCombatCharacter: Difference between revisions

From SigMod
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:


'''Source Location : [https://github.com/sreechar/TF2-Source-Code/blob/master/tf2_src/game/server/basecombatcharacter.h /game/server/basecombatcharacter.h]'''
'''Source Location : [https://github.com/sreechar/TF2-Source-Code/blob/master/tf2_src/game/server/basecombatcharacter.h /game/server/basecombatcharacter.h]'''
'''VScript : [https://developer.valvesoftware.com/wiki/Team_Fortress_2/Scripting/Script_Functions#CBaseCombatCharacter Script_Functions#CBaseCombatCharacter]'''


==[[Classes|Class Structure]]==
==[[Classes|Class Structure]]==
Line 29: Line 31:
| style="width: 15%;" |Float
| style="width: 15%;" |Float
| style="width: 35%;" |A timestamp for when this entity is ready to attack. (Weapon switches modify this time.)
| style="width: 35%;" |A timestamp for when this entity is ready to attack. (Weapon switches modify this time.)
|-
| colspan="3" style="padding: 0 auto; margin: 0 auto;" |
{| class="wikitable" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="3" style="background-color: rgb(45, 62, 97)" |
|}
|}
|}
|-
|-
Line 230: Line 237:
|Integer
|Integer
|
|
|-
| colspan="3" style="padding: 0 auto; margin: 0 auto;" |
{| class="wikitable" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="3" style="background-color: rgb(45, 62, 97)" |
|}
|}
|}
|}
|}
Line 241: Line 253:
|-
|-
| style="width: 50%;" |'''InputKilledNPC'''
| style="width: 50%;" |'''InputKilledNPC'''
| style="width: 15%;" |
| style="width: 15%;" |Input (Void)
| style="width: 35%;" |
| style="width: 35%;" |
|-
|-
| style="width: 50%;" |'''m_CurrentWeaponProficiency'''
| style="width: 50%;" |'''m_CurrentWeaponProficiency'''
| style="width: 15%;" |
| style="width: 15%;" |Integer
| style="width: 35%;" |
| style="width: 35%;" |Used in HL2 to determine how "good" this entity is at using it's weapon. (It affects bullet spread)
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
[https://github.com/sr2echa/TF2-Source-Code/blob/master/tf2_src/game/shared/weapon_proficiency.h#L20 /game/shared/weapon_proficiency.h#L20]
* <span style="color: #66b1fa">0</span> - WEAPON_PROFICIENCY_POOR
* <span style="color: #66b1fa">1</span> - WEAPON_PROFICIENCY_AVERAGE
* <span style="color: #66b1fa">2</span> - WEAPON_PROFICIENCY_GOOD
* <span style="color: #66b1fa">3</span> - WEAPON_PROFICIENCY_VERY_GOOD
* <span style="color: #66b1fa">4</span> - WEAPON_PROFICIENCY_PERFECT
|}
|-
|-
| style="width: 50%;" |'''m_HackedGunPos'''
| style="width: 50%;" |'''m_HackedGunPos'''
| style="width: 15%;" |
| style="width: 15%;" |Vector
| style="width: 35%;" |
| style="width: 35%;" |
|-
|-
| style="width: 50%;" |'''m_LastHitGroup'''
| style="width: 50%;" |'''m_LastHitGroup'''
| style="width: 15%;" |
| style="width: 15%;" |Integer
| style="width: 35%;" |
| style="width: 35%;" |The last body region that took damage.
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
[https://github.com/sr2echa/TF2-Source-Code/blob/master/tf2_src/game/shared/shareddefs.h#L335 /game/shared/shareddefs.h#L335]
* <span style="color: #66b1fa">0</span> - HITGROUP_GENERIC
* <span style="color: #66b1fa">1</span> - HITGROUP_HEAD
* <span style="color: #66b1fa">2</span> - HITGROUP_CHEST
* <span style="color: #66b1fa">3</span> - HITGROUP_STOMACH
* <span style="color: #66b1fa">4</span> - HITGROUP_LEFTARM
* <span style="color: #66b1fa">5</span> - HITGROUP_RIGHTARM
* <span style="color: #66b1fa">6</span> - HITGROUP_LEFTLEG
* <span style="color: #66b1fa">7</span> - HITGROUP_RIGHTLEG
* <span style="color: #66b1fa">10</span> - HITGROUP_GEAR
|}
|-
|-
| style="width: 50%;" |'''m_Relationship'''
| style="width: 50%;" |'''m_Relationship'''
| style="width: 15%;" |
| style="width: 15%;" |Array (Handle)
| style="width: 35%;" |
| style="width: 35%;" |Array of Relationships.
|-
|-
| style="width: 50%;" |'''m_RelationshipString'''
| style="width: 50%;" |'''m_RelationshipString'''
| style="width: 15%;" |
| style="width: 15%;" |String
| style="width: 35%;" |
| style="width: 35%;" |Used to load relationship keyvalues
|-
|-
| style="width: 50%;" |'''m_bForceServerRagdoll'''
| style="width: 50%;" |'''m_bForceServerRagdoll'''
| style="width: 15%;" |
| style="width: 15%;" |Boolean
| style="width: 35%;" |
| style="width: 35%;" |
|-
|-
Line 273: Line 311:
|-
|-
| style="width: 50%;" |'''m_bloodColor'''
| style="width: 50%;" |'''m_bloodColor'''
| style="width: 15%;" |
| style="width: 15%;" |Integer
| style="width: 35%;" |
| style="width: 35%;" |The color of this entity's blood particles.
|-
|-
| style="width: 50%;" |'''m_eHull'''
| style="width: 50%;" |'''m_eHull'''
| style="width: 15%;" |
| style="width: 15%;" |Integer
| style="width: 35%;" |
| style="width: 35%;" |Nav hull type.
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
[https://github.com/sr2echa/TF2-Source-Code/blob/master/tf2_src/game/server/ai_hull.h#L14 /game/server/ai_hull.h#L14]
* <span style="color: #66b1fa">0</span> - HULL_HUMAN (Combine, Stalker, Zombie...)
* <span style="color: #66b1fa">1</span> - HULL_SMALL_CENTERED (Scanner)
* <span style="color: #66b1fa">2</span> - HULL_WIDE_HUMAN (Vortigaunt)
* <span style="color: #66b1fa">3</span> - HULL_TINY (Headcrab)
* <span style="color: #66b1fa">4</span> - HULL_WIDE_SHORT (Bullsquid)
* <span style="color: #66b1fa">5</span> - HULL_MEDIUM (Cremator)
* <span style="color: #66b1fa">6</span> - HULL_TINY_CENTERED (Manhack)
* <span style="color: #66b1fa">7</span> - HULL_LARGE (Antlion Guard)
* <span style="color: #66b1fa">9</span> - HULL_LARGE_CENTERED (Mortar Synth)
* <span style="color: #66b1fa">10</span> - HULL_MEDIUM_TALL (Hunter)
* <span style="color: #66b1fa">12</span> - HULL_NONE (No Hull (appears after num hulls as we don't want to count it))
|}
|-
|-
| style="width: 50%;" |'''m_flDamageAccumulator'''
| style="width: 50%;" |'''m_flDamageAccumulator'''
| style="width: 15%;" |
| style="width: 15%;" |Float
| style="width: 35%;" |
| style="width: 35%;" |So very small amounts of damage do not get lost.
|-
|-
| style="width: 50%;" |'''m_flFieldOfView'''
| style="width: 50%;" |'''m_flFieldOfView'''
| style="width: 15%;" |
| style="width: 15%;" |Float
| style="width: 35%;" |
| style="width: 35%;" |Cosine of field of view for this character.
|-
|-
| style="width: 50%;" |'''m_flNextAttack'''
| style="width: 50%;" |'''m_flNextAttack'''
Line 301: Line 356:
|-
|-
| style="width: 50%;" |'''m_iAmmo'''
| style="width: 50%;" |'''m_iAmmo'''
| style="width: 15%;" |
| style="width: 15%;" |Array (Integer)
| style="width: 35%;" |
| style="width: 35%;" |Array of ammo amounts for each ammo type
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
[https://github.com/sr2echa/TF2-Source-Code/blob/master/tf2_src/game/shared/tf/tf_shareddefs.h#L351 /game/shared/tf/tf_shareddefs.h#L351]
* <span style="color: #66b1fa">0</span> - TF_AMMO_DUMMY
* <span style="color: #66b1fa">1</span> - TF_AMMO_PRIMARY
* <span style="color: #66b1fa">2</span> - TF_AMMO_SECONDARY
* <span style="color: #66b1fa">3</span> - TF_AMMO_METAL
* <span style="color: #66b1fa">4</span> - TF_AMMO_GRENADES1 (Sandman / Wrap Assassin balls)
* <span style="color: #66b1fa">5</span> - TF_AMMO_GRENADES2 (Cleavers)
* <span style="color: #66b1fa">6</span> - TF_AMMO_GRENADES3
* <span style="color: #66b1fa">7</span> - TF_AMMO_COUNT
|}
|-
|-
| style="width: 50%;" |'''m_iDamageCount'''
| style="width: 50%;" |'''m_iDamageCount'''
Line 309: Line 378:
|-
|-
| style="width: 50%;" |'''m_impactEnergyScale'''
| style="width: 50%;" |'''m_impactEnergyScale'''
| style="width: 15%;" |
| style="width: 15%;" |Float
| style="width: 35%;" |
| style="width: 35%;" |Scale the amount of energy used to calculate damage this entity takes due to physics
|}
|}

Latest revision as of 19:31, 7 October 2023

Overview[edit | edit source]

Contains functionality common between NPCs and players.

Source Location : /game/server/basecombatcharacter.h

VScript : Script_Functions#CBaseCombatCharacter

Class Structure[edit | edit source]

SendProps[edit | edit source]

CBaseCombatCharacter
Name Type Description
m_bGlowEnabled Boolean Whether or not to render a team colored outline around this entity.
bcc_localdata
m_flNextAttack Float A timestamp for when this entity is ready to attack. (Weapon switches modify this time.)
m_hActiveWeapon Handle The weapon this entity is currently using.
m_hMyWeapons
000 Integer An array of weapon handles this entity posesses
001 Integer
002 Integer
003 Integer
004 Integer
005 Integer
006 Integer
007 Integer
008 Integer
009 Integer
010 Integer
011 Integer
012 Integer
013 Integer
014 Integer
015 Integer
016 Integer
017 Integer
018 Integer
019 Integer
020 Integer
021 Integer
022 Integer
023 Integer
024 Integer
025 Integer
026 Integer
027 Integer
028 Integer
029 Integer
030 Integer
031 Integer
032 Integer
033 Integer
034 Integer
035 Integer
036 Integer
037 Integer
038 Integer
039 Integer
040 Integer
041 Integer
042 Integer
043 Integer
044 Integer
045 Integer
046 Integer
047 Integer

Entity DataMaps[edit | edit source]

CBaseCombatCharacter
Name Type Description
InputKilledNPC Input (Void)
m_CurrentWeaponProficiency Integer Used in HL2 to determine how "good" this entity is at using it's weapon. (It affects bullet spread)
Values

/game/shared/weapon_proficiency.h#L20

  • 0 - WEAPON_PROFICIENCY_POOR
  • 1 - WEAPON_PROFICIENCY_AVERAGE
  • 2 - WEAPON_PROFICIENCY_GOOD
  • 3 - WEAPON_PROFICIENCY_VERY_GOOD
  • 4 - WEAPON_PROFICIENCY_PERFECT
m_HackedGunPos Vector
m_LastHitGroup Integer The last body region that took damage.
Values

/game/shared/shareddefs.h#L335

  • 0 - HITGROUP_GENERIC
  • 1 - HITGROUP_HEAD
  • 2 - HITGROUP_CHEST
  • 3 - HITGROUP_STOMACH
  • 4 - HITGROUP_LEFTARM
  • 5 - HITGROUP_RIGHTARM
  • 6 - HITGROUP_LEFTLEG
  • 7 - HITGROUP_RIGHTLEG
  • 10 - HITGROUP_GEAR
m_Relationship Array (Handle) Array of Relationships.
m_RelationshipString String Used to load relationship keyvalues
m_bForceServerRagdoll Boolean
m_bPreventWeaponPickup Boolean Is this entity allowed to acquire weapons? For players this doesn't just include picking up weapons off the ground, but also prevents weapons from being assigned on spawn or resupply.
m_bloodColor Integer The color of this entity's blood particles.
m_eHull Integer Nav hull type.
Values

/game/server/ai_hull.h#L14

  • 0 - HULL_HUMAN (Combine, Stalker, Zombie...)
  • 1 - HULL_SMALL_CENTERED (Scanner)
  • 2 - HULL_WIDE_HUMAN (Vortigaunt)
  • 3 - HULL_TINY (Headcrab)
  • 4 - HULL_WIDE_SHORT (Bullsquid)
  • 5 - HULL_MEDIUM (Cremator)
  • 6 - HULL_TINY_CENTERED (Manhack)
  • 7 - HULL_LARGE (Antlion Guard)
  • 9 - HULL_LARGE_CENTERED (Mortar Synth)
  • 10 - HULL_MEDIUM_TALL (Hunter)
  • 12 - HULL_NONE (No Hull (appears after num hulls as we don't want to count it))
m_flDamageAccumulator Float So very small amounts of damage do not get lost.
m_flFieldOfView Float Cosine of field of view for this character.
m_flNextAttack Float A timestamp for when this entity is ready to attack. (Weapon switches modify this time.)
m_hActiveWeapon Handle The weapon this entity currently has equipped
m_hMyWeapons Array (Handle) An array of weapons this entity possesses
m_iAmmo Array (Integer) Array of ammo amounts for each ammo type
Values

/game/shared/tf/tf_shareddefs.h#L351

  • 0 - TF_AMMO_DUMMY
  • 1 - TF_AMMO_PRIMARY
  • 2 - TF_AMMO_SECONDARY
  • 3 - TF_AMMO_METAL
  • 4 - TF_AMMO_GRENADES1 (Sandman / Wrap Assassin balls)
  • 5 - TF_AMMO_GRENADES2 (Cleavers)
  • 6 - TF_AMMO_GRENADES3
  • 7 - TF_AMMO_COUNT
m_iDamageCount Integer How many times this entity has taken damage
m_impactEnergyScale Float Scale the amount of energy used to calculate damage this entity takes due to physics