tank_boss

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png

Stub

This article or section is a stub. You can help by adding to it.

The MvM tank.
Tank falling through a grating (gif, needs to be opened to show)

tank_boss is a point entity available in Team Fortress 2 Team Fortress 2.

Icon-Bug.pngBug:If there are no path_tracks present in the map, the game will crash.
Icon-Bug.pngBug:Tanks pass through any walls with a transparent texture (grates, glass, etc.) or tool textures but not tools/toolsblack, tools/toolsnodraw and tools/toolsskybox. Tying the wall into an entity doesn't prevent this. (Except for func_detail.)
In code, it is represented by theCTFTankBossclass, defined in thetf_tank_boss.cppfile.

Entity description

The tank deploying its bomb at the hatch.

The tank used in Mann vs Machine missions. When spawned in by a popfile, it will start at the path_track entity specified by the popfile and continue until it reaches the end of the path, where it will deploy the bomb. When destroyed, it creates a tank_destruction entity.

Note.pngNote:When spawned using ent_create, the tank will attempt to travel in a straight line toward the bomb hatch from the point it was spawned at.

Keyvalues

Health (???) <integer>
Health of the tank.
Model (???) <string>
Model the tank uses.
Speed (???) <integer>
Speed the tank travels at, higher speeds can cause the tank to clip through geometry.
Start Disabled (???) <boolean>
Start disabled.
TeamNum (???) <choices>
Team.

BaseFadeProp:

Start Fade Dist (fademindist) <float>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <float>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <float>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Source 2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.

Base:
Name (targetname) <string>
The name that other entities use to refer to this entity.
Parent (parentname) <targetname>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngTip:Entities transition to the next map with their parents
Tip.pngTip:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Note.pngNote:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.pngNote:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <string> !FGD
Determines the characteristics of the entity before it spawns.
Tip.pngTip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> !FGD
Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
Effects (effects) <flags> !FGD
Combination of effect flags to use.
Entity Scripts (vscripts) <scriptlist> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. Scripts executed on the worldspawn entity will be placed in root scope.
Think function (thinkfunction) <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since Left 4 Dead 2) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since Counter-Strike: Global Offensive) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.

Inputs

SetSpeed
Set the speed of the tank. Must be a positive value.
Note.pngNote:High values will cause the tank to have difficulties navigating the path_tracks.
SetHealth
Set the tank's health.
SetMaxHealth
Set the tank's max health.
AddHealth
Add health to the tank.
RemoveHealth
Remove health from the tank.
Icon-Bug.pngBug:Changes to the tank's health will not be reflected in the HUD until the tank is damaged by a player.
DestroyIfAtCapturePoint
Destructs the tank if it reached its final path_track node.
AddCaptureDestroyPostfix
Sets the tank's destruction animation name's postfix. Can be used for these destruction animations.
SetTeam <integer>
Changes the entity's team.
0: Any
2: Red
3: Blue
Ignite
Ignite, burst into flames.
IgniteLifetime <float>
Ignite with the given lifetime.
Blank image.pngTodo: Before the flames extinguish, or before health reaches zero?
IgniteNumHitboxFires <integer>
Ignite with the given number of hitbox fires.
IgniteHitboxFireScale <float>
Ignite with the given hitbox fire scale.

Base:
AddContext <string>
Adds to the entity's list of response contexts. See Context.
AddOutput <string>
Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"

// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
ClearContext
Removes all contexts from this entity's list.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1 to FireUser4
Fires the respectiveOnUseroutputs; see User Inputs and Outputs.
Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKillinput.
RemoveContext <string>
Remove a context from this entity's list. The name should match the key of an existing context.
SetParent <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Use  !FGD
Same as a player invoking +use; no effect in most cases.
DispatchResponse <string> !FGD
Dispatches a response to the entity. See Response and Concept.
DispatchEffect <string> (removed since Left 4 Dead) !FGD
Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since Left 4 Dead.
RunScriptFile <script> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Icon-Bug.pngBug:In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.
Note.pngFix:Remove the string argument manually with a text editor.
Note.pngNote:Team Fortress 2 Backtick characters ` are replaced with quotation marks at runtime, allowing quotation marks to be used when normally not possible.
CallScriptFunction <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2) !FGD
Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope  (only in Team Fortress 2) !FGD
Destroys the script scope of the receving entity.
SetLocalOrigin <coordinates> (in all games since Alien Swarm) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <angles> (in all games since Alien Swarm) !FGD
Set this entity's angles.

Outputs


BaseBoss:
OnHealthBelow90Percent
Fired when the tank's health drops below 90 percent.
OnHealthBelow80Percent
Fired when the tank's health drops below 80 percent.
OnHealthBelow70Percent
Fired when the tank's health drops below 70 percent.
OnHealthBelow60Percent
Fired when the tank's health drops below 60 percent.
OnHealthBelow50Percent
Fired when the tank's health drops below 50 percent.
OnHealthBelow40Percent
Fired when the tank's health drops below 40 percent.
OnHealthBelow30Percent
Fired when the tank's health drops below 30 percent.
OnHealthBelow20Percent
Fired when the tank's health drops below 20 percent.
OnHealthBelow10Percent
Fired when the tank's health drops below 10 percent.
OnKilled
Fired when the tank's health drops to 0.

Studiomodel:
OnIgnite
Fired when this object catches fire.

Base:

OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.