CBaseObject: Difference between revisions

From SigMod
Jump to navigation Jump to search
No edit summary
No edit summary
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Overview ==
== Overview ==
...
The base class for place-able objects.


'''Source location : /game/shared/tf2/baseobject_shared.h'''
'''Source location : [https://github.com/sreechar/TF2-Source-Code/blob/master/tf2_src/game/shared/tf/baseobject_shared.h /game/shared/tf/baseobject_shared.h]'''


==[[SendProps|Class Structure]]==
==[[Classes|Class Structure]]==
*'''[[CBaseEntity]]'''
*'''[[CBaseEntity]]'''
**'''[[CBaseAnimating]]'''
**'''[[CBaseAnimating]]'''
Line 13: Line 13:


== SendProps ==
== SendProps ==
{| class="wikitable sortable" style="margin: 0 auto; width: 100%; padding: 0;"
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
|+CBaseObject
|+CBaseObject
! style="width: 50%; background-color: #303030; color: white" |Name  
! style="width: 50%; background-color: #303030; color: white" |Name  
Line 21: Line 21:
|'''m_iHealth'''
|'''m_iHealth'''
|Integer
|Integer
|
|The current health of this object
|-
|-
|'''m_iMaxHealth'''
|'''m_iMaxHealth'''
|Integer
|Integer
|
|The maximum health this object can have in it's current state
|-
|-
|'''m_bHasSapper'''
|'''m_bHasSapper'''
|Boolean
|Boolean
|
|Whether or not this object has a sapper on it
|-
|-
|'''m_iObjectType'''
|'''m_iObjectType'''
|Integer
|Integer
|What type of object this entity is
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
|
* 0 - OBJ_DISPENSER
* 1 - OBJ_TELEPORTER
* 2 - OBJ_SENTRYGUN
* 3 - OBJ_ATTACHMENT_SAPPER
|}
|-
|-
|'''m_bBuilding'''
|'''m_bBuilding'''
|Boolean
|Boolean
|
|Whether or not this object is currently under construction
|-
|-
|'''m_bPlacing'''
|'''m_bPlacing'''
|Boolean
|Boolean
|Whether or not this object is staged to be constructed / placed
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Usage
|-
|
|
For engineers, this means they have selected the building on their construction PDA, it is irrelevant as to whether or not they are actually allowed to place the building in the spot they are looking at. For spies, this simply means they have their sapper out, it doesn't need to be ready to place on a building
|}
|-
|-
|'''m_bCarried'''
|'''m_bCarried'''
|Boolean
|Boolean
|
|Whether or not an engineer is carrying this building '''after''' placing it
|-
|-
|'''m_bCarryDeploy'''
|'''m_bCarryDeploy'''
Line 53: Line 68:
|'''m_bMiniBuilding'''
|'''m_bMiniBuilding'''
|Boolean
|Boolean
|Whether or not this object is a mini building
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Usage
|-
|
|
Changing this value to 1 will add '''Mini-''' to the beginning of the building's name, regardless of the building type. It's advised to only change this value while the engineer is placing the building (m_bPlacing = 1), as changing it during other periods of time lead to different unintended consequences. (For example you cannot pick up a building that was above level 1 if you make it a mini building, it's model will also not update.) Sentries which have been changed from normal to mini sentries will '''not''' automatically update their size to that of a mini sentry, however every other difference between them does change properly (Damage, firing speed, health, sound)
|}
|-
|-
|'''m_flPercentageConstructed'''
|'''m_flPercentageConstructed'''
|Float
|Float
|
|The percentage value denoting how close this object is to finishing construction. (0 - 1, 1 being completely constructed)
|-
|-
|'''m_fObjectFlags'''
|'''m_fObjectFlags'''
|Integer
|Integer
|Bit flags for this object
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
|
* 1 - OF_ALLOW_REPEAT_PLACEMENT
* 2 - OF_MUST_BE_BUILT_ON_ATTACHMENT
* 4 - OF_DOESNT_HAVE_A_MODEL
* 8 - OF_PLAYER_DESTRUCTION
|}
|-
|-
|'''m_hBuiltOnEntity'''
|'''m_hBuiltOnEntity'''
|Integer
|Integer
|The building which this sapper object is sapping / targeting
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Usage
|-
|
|
The sapper does not have to actually be applied to a building for this to have a value. Along with the sapper being applied and destroying the building, this SendProp will also be populated with a value when a spy hovers over the building with their sapper and the sapper outline appears on the building indicating it is ready for placement
|}
|-
|-
|'''m_bDisabled'''
|'''m_bDisabled'''
|Boolean
|Boolean
|
|Whether or not this building object is being sapped
|-
|-
|'''m_hBuilder'''
|'''m_hBuilder'''
|Integer
|Integer
|
|The owner of the object. The object does not have to be constructed or placed for this value to be populated
|-
|-
|'''m_vecBuildMaxs'''
|'''m_vecBuildMaxs'''
|Vector
|Vector
|
|The positive point to determine the object size
|-
|-
|'''m_vecBuildMins'''
|'''m_vecBuildMins'''
|Vector
|Vector
|
|The negative point to determine the object size
|-
|-
|'''m_iDesiredBuildRotations'''
|'''m_iDesiredBuildRotations'''
Line 93: Line 129:
|'''m_iUpgradeLevel'''
|'''m_iUpgradeLevel'''
|Integer
|Integer
|
|The upgrade level of this building object (1 - 3). Changing this value does nothing
|-
|-
|'''m_iUpgradeMetal'''
|'''m_iUpgradeMetal'''
|Integer
|Integer
|
|The amount of metal put towards upgrading the building object to the next level. Setting this at or above m_iUpgradeMetalRequired will require a swing of a wrench to upgrade the building
|-
|-
|'''m_iUpgradeMetalRequired'''
|'''m_iUpgradeMetalRequired'''
|Integer
|Integer
|
|The amount of metal required to upgrade the building object to the next level
|-
|-
|'''m_iHighestUpgradeLevel'''
|'''m_iHighestUpgradeLevel'''
|Integer
|Integer
|
|Despite the name, this is the current upgrade level of this building object. Unlike m_iUpgradeLevel however, changing this value does change the building's level
|-
|-
|'''m_iObjectMode'''
|'''m_iObjectMode'''
|Integer
|Integer
|This object's mode
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;"
! colspan="1" |Values
|-
|
|
* 0 - MODE_TELEPORTER_ENTRANCE
* 1 - MODE_TELEPORTER_EXIT
* 0 - MODE_SENTRYGUN_NORMAL
* 1 - MODE_SENTRYGUN_DISPOSABLE // The MvM upgrade sentries
* 0 - MODE_SAPPER_NORMAL
* 1 - MODE_SAPPER_ANTI_ROBOT
* 2 - MODE_SAPPER_ANTI_ROBOT_RADIUS
|}
|-
|-
|'''m_bDisposableBuilding'''
|'''m_bDisposableBuilding'''
|Boolean
|Boolean
|
|Whether or not this object is a disposable building (from the MvM upgrade)
|-
|-
|'''m_bWasMapPlaced'''
|'''m_bWasMapPlaced'''
|Boolean
|Boolean
|
|Whether or not this object was spawned by the map (it was in the .vmf)
|-
|-
|'''m_bPlasmaDisable'''
|'''m_bPlasmaDisable'''
|Boolean
|Boolean
|
|Whether or not this building object has been temporarily disabled by the Cow Mangler 5000
|}
== Entity DataMaps ==
{| class="wikitable sortable mw-collapsible mw-collapsed" style="margin: 0 auto; width: 100%; padding: 0;
|+CBaseObject
! style="width: 50%; background-color: #303030; color: white" |Name
! style="width: 15%; background-color: #303030; color: white" |Type
! style="width: 35%; background-color: #303030; color: white" |Description
|-
| style="width: 50%;" |'''CBaseObjectUpgradeThink'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputAddHealth'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputDisable'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputEnable'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputHide'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputRemoveHealth'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputSetBuilder'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputSetHealth'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputSetSolidToPlayer'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''InputShow'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnBecomingDisabled'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnBecomingReenabled'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnDamaged'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnDestroyed'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnObjectHealthChanged'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_OnRepaired'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_SolidToPlayers'''
| style="width: 15%;" |
| style="width: 35%;" |
|-
| style="width: 50%;" |'''m_nDefaultUpgradeLevel'''
| style="width: 15%;" |
| style="width: 35%;" |
|}
|}

Latest revision as of 00:49, 13 November 2022

Overview[edit | edit source]

The base class for place-able objects.

Source location : /game/shared/tf/baseobject_shared.h

Class Structure[edit | edit source]

SendProps[edit | edit source]

CBaseObject
Name Type Description
m_iHealth Integer The current health of this object
m_iMaxHealth Integer The maximum health this object can have in it's current state
m_bHasSapper Boolean Whether or not this object has a sapper on it
m_iObjectType Integer What type of object this entity is
Values
  • 0 - OBJ_DISPENSER
  • 1 - OBJ_TELEPORTER
  • 2 - OBJ_SENTRYGUN
  • 3 - OBJ_ATTACHMENT_SAPPER
m_bBuilding Boolean Whether or not this object is currently under construction
m_bPlacing Boolean Whether or not this object is staged to be constructed / placed
Usage

For engineers, this means they have selected the building on their construction PDA, it is irrelevant as to whether or not they are actually allowed to place the building in the spot they are looking at. For spies, this simply means they have their sapper out, it doesn't need to be ready to place on a building

m_bCarried Boolean Whether or not an engineer is carrying this building after placing it
m_bCarryDeploy Boolean
m_bMiniBuilding Boolean Whether or not this object is a mini building
Usage

Changing this value to 1 will add Mini- to the beginning of the building's name, regardless of the building type. It's advised to only change this value while the engineer is placing the building (m_bPlacing = 1), as changing it during other periods of time lead to different unintended consequences. (For example you cannot pick up a building that was above level 1 if you make it a mini building, it's model will also not update.) Sentries which have been changed from normal to mini sentries will not automatically update their size to that of a mini sentry, however every other difference between them does change properly (Damage, firing speed, health, sound)

m_flPercentageConstructed Float The percentage value denoting how close this object is to finishing construction. (0 - 1, 1 being completely constructed)
m_fObjectFlags Integer Bit flags for this object
Values
  • 1 - OF_ALLOW_REPEAT_PLACEMENT
  • 2 - OF_MUST_BE_BUILT_ON_ATTACHMENT
  • 4 - OF_DOESNT_HAVE_A_MODEL
  • 8 - OF_PLAYER_DESTRUCTION
m_hBuiltOnEntity Integer The building which this sapper object is sapping / targeting
Usage

The sapper does not have to actually be applied to a building for this to have a value. Along with the sapper being applied and destroying the building, this SendProp will also be populated with a value when a spy hovers over the building with their sapper and the sapper outline appears on the building indicating it is ready for placement

m_bDisabled Boolean Whether or not this building object is being sapped
m_hBuilder Integer The owner of the object. The object does not have to be constructed or placed for this value to be populated
m_vecBuildMaxs Vector The positive point to determine the object size
m_vecBuildMins Vector The negative point to determine the object size
m_iDesiredBuildRotations Integer
m_bServerOverridePlacement Boolean
m_iUpgradeLevel Integer The upgrade level of this building object (1 - 3). Changing this value does nothing
m_iUpgradeMetal Integer The amount of metal put towards upgrading the building object to the next level. Setting this at or above m_iUpgradeMetalRequired will require a swing of a wrench to upgrade the building
m_iUpgradeMetalRequired Integer The amount of metal required to upgrade the building object to the next level
m_iHighestUpgradeLevel Integer Despite the name, this is the current upgrade level of this building object. Unlike m_iUpgradeLevel however, changing this value does change the building's level
m_iObjectMode Integer This object's mode
Values
  • 0 - MODE_TELEPORTER_ENTRANCE
  • 1 - MODE_TELEPORTER_EXIT
  • 0 - MODE_SENTRYGUN_NORMAL
  • 1 - MODE_SENTRYGUN_DISPOSABLE // The MvM upgrade sentries
  • 0 - MODE_SAPPER_NORMAL
  • 1 - MODE_SAPPER_ANTI_ROBOT
  • 2 - MODE_SAPPER_ANTI_ROBOT_RADIUS
m_bDisposableBuilding Boolean Whether or not this object is a disposable building (from the MvM upgrade)
m_bWasMapPlaced Boolean Whether or not this object was spawned by the map (it was in the .vmf)
m_bPlasmaDisable Boolean Whether or not this building object has been temporarily disabled by the Cow Mangler 5000

Entity DataMaps[edit | edit source]

CBaseObject
Name Type Description
CBaseObjectUpgradeThink
InputAddHealth
InputDisable
InputEnable
InputHide
InputRemoveHealth
InputSetBuilder
InputSetHealth
InputSetSolidToPlayer
InputShow
m_OnBecomingDisabled
m_OnBecomingReenabled
m_OnDamaged
m_OnDestroyed
m_OnObjectHealthChanged
m_OnRepaired
m_SolidToPlayers
m_nDefaultUpgradeLevel