This article relates to the game "Team Fortress 2". Click here for more information.

Base boss: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created base_boss page. [Information from the 2018 source code leak of TF2 along with some testing. PLEASE FACT CHECK THIS PAGE!])
 
m (Article is a bit awkward here)
 
(21 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{tf2 point|base_boss}} It is the base entity for [[tank_boss]] in [https://wiki.teamfortress.com/wiki/Mann_vs._Machine Mann vs. Machine]. This entity will destroy engineer buildings comes into collision with it.
{{LanguageBar}}{{TF2 topicon}}
 
{{CD|CTFBaseBoss|file1=tf/player_vs_environment/tf_base_boss.cpp|base=NextBotCombatCharacter}}
{{code class|CTFBaseBoss|tf_base_boss.cpp}}
{{this is a|model entity|name=base_boss|game=Team Fortress 2}}
It is the entity that the {{ent|tank_boss}} entity uses as a base and thus shares a lot of its behaviors. A few examples include:
* Crushes engineer buildings that collide with it
* TFBots treat this entity as an enemy
* Drops currency pack on death
* Plays sounds to client when it gets damaged
{{ent|base_boss}} itself was originally intended for the now-scrapped {{tfwiki|Raid}} gamemode. By itself, it is static and does not perform anything; however, it is still of use in setting up a custom hitbox for any custom static NPC bosses.
{{tip|This entity can be used for a moving bot template via [[VScript]], see [[Team_Fortress_2/Scripting/VScript_Examples#Creating_Bots_That_Use_the_Navmesh|example]].}}
{{warning|The default step height of this entity is 100, so if driven by NextBot locomotion it can have issues with elevations. This can be fixed by lowering the height via <code>SetStepHeight</code> input.}}


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|health|int|Determines the initial health.}}
{{KV|health|int|Determines the initial health.}}
{{KV|model|string|Filepath to the model this entity will use.}}
{{KV|model|string|Filepath to the model this entity will use. Will use the model bounding box to determine its hitbox and collision}}
{{KV|speed|float|The speed that this entity moves.}}
{{KV|speed|float|The speed that this entity moves.}}
{{KV|start_disabled|int|Start the entity disabled.}}
{{KV EnableDisable}}
{{KV Targetname}}
{{KV Parentname}}
{{KV BaseEntity|base=1}}


==Inputs==
==Inputs==
{{IO|Enable|Enables the entity.}}
{{I|SetHealth|Sets the entity's health to this value.|param=int}}
{{IO|Disable|Disables the entity.}}
{{I|SetMaxHealth|Sets the entity's maximum health to this value.|param=int}}
{{IO|SetHealth|Sets the entity's health to this value.|param=int}}
{{I|AddHealth|Add this amount of health to the entity.|param=int}}
{{IO|SetMaxHealth|Sets the entity's maximum health to this value.|param=int}}
{{I|RemoveHealth|Subtract this amount of health from the entity.|param=int}}
{{IO|AddHealth|Add this amount of health to the entity.|param=int}}
{{I|SetSpeed|Sets this entity's speed to this value.|param=int}}
{{IO|RemoveHealth|Subtract this amount of health from the entity.|param=int}}
{{I|SetStepHeight|Sets maximum height of steps that the entity can climb|param=float}}
{{IO|SetSpeed|Sets this entity's speed to this value.|param=int}}
{{I|SetMaxJumpHeight|Sets maximum height this entity can jump|param=float}}
{{I Targetname}}
{{note|[[Team_Fortress_2/Scripting/Script_Functions#CTFBaseBoss|SetResolvePlayerCollisions]] is also available as a VScript method.}}
{{I BaseEntity|base=1}}
{{I EnableDisable}}


==Outputs==
==Outputs==
{{IO|OnHealthBelow90Percent|to=OnHealthBelow10Percent|Fires when the entity's health goes below X percent of its maximum health.}}
{{O|OnHealthBelow90Percent|to=OnHealthBelow10Percent|Fires when the entity's health goes below X percent of its maximum health.}}
{{IO|OnKilled|Fired when the entity is killed.}}
{{O|OnKilled|Fired when the boss is killed.}}
{{O BaseEntity|base=1}}
 
==See also==
* {{ent|tank_boss}}

Latest revision as of 15:14, 7 July 2025

English (en)Translate (Translate)
C++ Class hierarchy
CTFBaseBoss
NextBotCombatCharacter
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ tf_base_boss.cpp

base_boss is a model entity available in Team Fortress 2 Team Fortress 2. It is the entity that the tank_boss entity uses as a base and thus shares a lot of its behaviors. A few examples include:

  • Crushes engineer buildings that collide with it
  • TFBots treat this entity as an enemy
  • Drops currency pack on death
  • Plays sounds to client when it gets damaged

base_boss itself was originally intended for the now-scrapped Tfwiki favicon.png Raid gamemode. By itself, it is static and does not perform anything; however, it is still of use in setting up a custom hitbox for any custom static NPC bosses.

Tip.pngTip:This entity can be used for a moving bot template via VScript, see example.
Warning.pngWarning:The default step height of this entity is 100, so if driven by NextBot locomotion it can have issues with elevations. This can be fixed by lowering the height via SetStepHeight input.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

health ([todo internal name (i)]) <integer>
Determines the initial health.
model ([todo internal name (i)]) <string>
Filepath to the model this entity will use. Will use the model bounding box to determine its hitbox and collision
speed ([todo internal name (i)]) <float>
The speed that this entity moves.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

SetHealth <integerRedirectInput/integer>
Sets the entity's health to this value.
SetMaxHealth <integerRedirectInput/integer>
Sets the entity's maximum health to this value.
AddHealth <integerRedirectInput/integer>
Add this amount of health to the entity.
RemoveHealth <integerRedirectInput/integer>
Subtract this amount of health from the entity.
SetSpeed <integerRedirectInput/integer>
Sets this entity's speed to this value.
SetStepHeight <floatRedirectInput/float>
Sets maximum height of steps that the entity can climb
SetMaxJumpHeight <floatRedirectInput/float>
Sets maximum height this entity can jump
Note.pngNote:SetResolvePlayerCollisions is also available as a VScript method.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnHealthBelow90Percent to OnHealthBelow10Percent
Fires when the entity's health goes below X percent of its maximum health.
OnKilled
Fired when the boss is killed.

See also