bot_controller

From Valve Developer Community
Jump to navigation Jump to search

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

Entity description

An entity used to create a bot, and then issue commands to it.

Keyvalues

targetname:
Name ([todo internal name (i)]) <string>
The targetname that other entities refer to this entity by.
TeamNum:
Team ([todo internal name (i)]) <choices>
Team
  • 2 : Red
  • 3 : Blue
bot_class:
Class ([todo internal name (i)]) <choices>
The class the bot will spawn as.
  • 0 : Random
  • 1 : Scout
  • 2 : Sniper
  • 3 : Soldier
  • 4 : Demoman
  • 5 : Medic
  • 6 : Heavy
  • 7 : Pyro
  • 8 : Spy
  • 9 : Engineer
bot_name:
Name of the bot. ([todo internal name (i)]) <string>
most likely the name displayed in-game

Inputs

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput <stringRedirectInput/string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
CreateBot
Create the bot for this controller.
RespawnBot
Force the bot to respawn.
AddCommandMoveToEntity <targetnameRedirectInput/string>
Add a command to the bot's queue, telling it to move to the specified entity.
AddCommandAttackEntity <targetnameRedirectInput/string>
Add a command to the bot's queue, telling it to attack the specified entity.
AddCommandSwitchWeapon <integerRedirectInput/integer>
Add a command to the bot's queue, telling it to switch to the specified weapon slot.
AddCommandDefend <floatRedirectInput/float>
Add a command to the bot's queue, telling it to defend the position it's standing at. The parameter specifies the distance from the point that the Bot is allowed to move to fight enemies.
SetIgnoreHumans <integerRedirectInput/integer>
Set whether or not the Bot should ignore human players. 1 The expression {{=}} is used to insert a = character into a template or table where it would otherwise affect or break the formatting of the template/table instead of displaying the character. It is most likely to be used in conjunction with templates like {{Note}} or the {{Key}} template. See its documentation for further information.
Tip.pngTip:Instead of having to "escape" every single occurrence of an equals sign with {{=}} in an unnamed parameter of a template call, it may be easier to use the unnamed parameter like a named parameter.

Both of the following deliver if (i == 0) return count == 0;:

  • {{Code|if (i {{=}}{{=}} 0) return count {{=}}{{=}} 0;}}
  • {{Code|1=if (i == 0) return count == 0;}}
Note.pngNote:MediaWiki doesn't use this page. The wikitext {{=}} is no longer a template call but instead a magic word since MediaWiki 1.39. We're above that since 2024-11-28. Deleting this page would have no impact, except for new editors trying to search it and not finding the above information.

ignore, 0 The expression {{=}} is used to insert a = character into a template or table where it would otherwise affect or break the formatting of the template/table instead of displaying the character. It is most likely to be used in conjunction with templates like {{Note}} or the {{Key}} template. See its documentation for further information.

Tip.pngTip:Instead of having to "escape" every single occurrence of an equals sign with {{=}} in an unnamed parameter of a template call, it may be easier to use the unnamed parameter like a named parameter.

Both of the following deliver if (i == 0) return count == 0;:

  • {{Code|if (i {{=}}{{=}} 0) return count {{=}}{{=}} 0;}}
  • {{Code|1=if (i == 0) return count == 0;}}
Note.pngNote:MediaWiki doesn't use this page. The wikitext {{=}} is no longer a template call but instead a magic word since MediaWiki 1.39. We're above that since 2024-11-28. Deleting this page would have no impact, except for new editors trying to search it and not finding the above information.

don't ignore.

PreventMovement <integerRedirectInput/integer>
Set whether or not the Bot is allowed to move. 1 The expression {{=}} is used to insert a = character into a template or table where it would otherwise affect or break the formatting of the template/table instead of displaying the character. It is most likely to be used in conjunction with templates like {{Note}} or the {{Key}} template. See its documentation for further information.
Tip.pngTip:Instead of having to "escape" every single occurrence of an equals sign with {{=}} in an unnamed parameter of a template call, it may be easier to use the unnamed parameter like a named parameter.

Both of the following deliver if (i == 0) return count == 0;:

  • {{Code|if (i {{=}}{{=}} 0) return count {{=}}{{=}} 0;}}
  • {{Code|1=if (i == 0) return count == 0;}}
Note.pngNote:MediaWiki doesn't use this page. The wikitext {{=}} is no longer a template call but instead a magic word since MediaWiki 1.39. We're above that since 2024-11-28. Deleting this page would have no impact, except for new editors trying to search it and not finding the above information.

prevent movement, 0 The expression {{=}} is used to insert a = character into a template or table where it would otherwise affect or break the formatting of the template/table instead of displaying the character. It is most likely to be used in conjunction with templates like {{Note}} or the {{Key}} template. See its documentation for further information.

Tip.pngTip:Instead of having to "escape" every single occurrence of an equals sign with {{=}} in an unnamed parameter of a template call, it may be easier to use the unnamed parameter like a named parameter.

Both of the following deliver if (i == 0) return count == 0;:

  • {{Code|if (i {{=}}{{=}} 0) return count {{=}}{{=}} 0;}}
  • {{Code|1=if (i == 0) return count == 0;}}
Note.pngNote:MediaWiki doesn't use this page. The wikitext {{=}} is no longer a template call but instead a magic word since MediaWiki 1.39. We're above that since 2024-11-28. Deleting this page would have no impact, except for new editors trying to search it and not finding the above information.

allow movement.

ClearQueue
Clear the bot's command queue.

Outputs

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.
OnForceRespawn
Sent when the entity respawns the players.