CObjectSentrygun: Difference between revisions

From SigMod
Jump to navigation Jump to search
No edit summary
No edit summary
Line 69: Line 69:
|'''m_hEnemy'''
|'''m_hEnemy'''
|Integer
|Integer
|
|The target of this sentry's fire. When the sentry is uncontrolled this will be the player it is attempting to fire at. When the sentry is controlled by a Wrangler it will be the env_laser used by the weapon
|-
|-
|'''m_hAutoAimTarget'''
|'''m_hAutoAimTarget'''
|Integer
|Integer
|
|The aim assisted player target used by the Wrangler. When aiming near an enemy and a positive vector trace is established the env_laser will lock on to the target player, and this value (m_hAutoAimTarget) will be set to that enemy
|-
|-
| colspan="3" style="padding: 0; margin: 0;" |
| colspan="3" style="padding: 0; margin: 0;" |

Revision as of 15:11, 13 November 2022

Overview

Placed and carried sentry guns are instances of this class.

Source location : /game/server/tf2/tf_obj_sentrygun.h

Linked entity : obj_sentrygun

Class Structure

SendProps

CObjectSentrygun
Name Type Description
m_iAmmoShells Integer
m_iAmmoRockets Integer
m_iState Integer What this sentrygun is currently doing
Values
  • 0 - SENTRY_STATE_INACTIVE // Carried or being constructed
  • 1 - SENTRY_STATE_SEARCHING // Active and sweeping for targets
  • 2 - SENTRY_STATE_ATTACKING // Rotating to fire, or actively firing on an enemy
  • 3 - SENTRY_STATE_UPGRADING
m_bPlayerControlled Boolean Whether or not this sentry is being controlled by a player with the Wrangler
m_nShieldLevel Integer The shielding level for this sentry
Values
  • 0 - SHIELD_NONE
  • 1 - SHIELD_NORMAL
  • 2 - SHIELD_MAX
Usage
  • SHIELD_NONE (0) is the normal non shielded state for a sentry
  • SHIELD_NORMAL (1) is applied when the Wrangler is actively controlling the sentry, reducing damage by 66%
  • SHIELD_MAX (2) is applied when an übercharge canteen is used by the engineer, reducing damage by 90% and applying a temporarily shield to the sentrygun. This will NOT happen however if the engineer has the Wrangler out, m_nShieldLevel will remain SHIELD_NORMAL.
m_hEnemy Integer The target of this sentry's fire. When the sentry is uncontrolled this will be the player it is attempting to fire at. When the sentry is controlled by a Wrangler it will be the env_laser used by the weapon
m_hAutoAimTarget Integer The aim assisted player target used by the Wrangler. When aiming near an enemy and a positive vector trace is established the env_laser will lock on to the target player, and this value (m_hAutoAimTarget) will be set to that enemy
SentrygunLocalData
m_iKills Integer
m_iAssists Integer