Editing
TFBot
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Listed below are all of the custom keyvalues accepted in the '''TFBot{}''' block by our server mods. Examples of these additions can be found in the [https://testing.potato.tf/mvm_bigrock_sigdemo.pop demonstrative SigMod popfile]. == Global keyvalues for custom blocks == Various custom blocks accept a variety of keyvalues to specify when they should perform their action. The following keyvalues should be usable in all of these blocks:<syntaxhighlight> Delay 10 //Time before the task starts (Default: 10) Cooldown 1 //Time between each execution of the task (Default: 10) Repeats 1 //How many times the bot should perform the task in total (Default: 0 - Infinite) IfSeeTarget 1 //When set to 1, this task activates only when the bot can see a target (Default: 0 - Always activate) IfNoTarget 1 //When set to 1, this task activates only when the bot does not have a target (Default: 0 - Always activate) IfHealthBelow 100 //When set, the task activates only when the bot health is below specified value IfHealthAbove 100 //When set, the task activates only when the bot health is above specified value MaxTargetRange 150 //If set, the task activates only when the target is within specified units away MinTargetRange 50 //If set, the task activates only when the target is more than specified units away </syntaxhighlight> == SpawnTemplate == <syntaxhighlight> SpawnTemplate [$SIGSEGV] //Spawn custom player template { Name "Sentry" Bone "bip_head" //Bone name where the template should be attached to //Some bone names are listed here: //bip_head //bip_spine_2 - used by flag //bip_hand_L //bip_hand_R //weapon_bone_R //weapon_bone_L //bip_foot_L //bip_foot_R } </syntaxhighlight>Allows you to spawn [https://steamcommunity.com/sharedfiles/filedetails/?id=2289315026 PointTemplates], which will automatically be parented on the bot this block is on. Does <u>not</u> support global keyvalues. Bone names can also be found using HLMV, which is available by default in your Team Fortress 2/bin folder (which is "above" your tf/ folder). == ExtAttr == Extra Attributes that can be applied to bots, akin to the vanilla Attributes keyvalue.<syntaxhighlight> // Aim behavior. MedicLookAtThreats //If the bot is a Medic: can turn around to look at threats TargetStickies //Target and destroy stickies IgnoreBuildings //Ignore buildings IgnorePlayers //Ignore players (including bots) IgnoreBots //Ignore bots IgnoreRealPlayers //Ignore non-bot players IgnoreNPC //Ignore NPCs such as Tanks, skeletons, and halloween bosses // Attacking behavior. AlwaysFireWeaponAlt //Always use secondary fire SuppressCanteenUse //If set, the bot will not automatically activate canteens when looking at an enemy JumpStomp //Try to jump over and stomp obstracles // Engineer-only. BuildDispenserAsTeleporter //Builds dispenser instead of teleporter BuildDispenserAsSentryGun //Builds dispenser instead of sentry gun // Misc. DisableSpawnProtectionFix //Disables a fix where a medic activating ubercharge inside spawn will not be invulnerable when exiting spawn </syntaxhighlight> == Homing Rockets == <syntaxhighlight> HomingRockets [$SIGSEGV] { IgnoreDisguisedSpies 1 //Ignore Spies that are disguised? IgnoreStealthedSpies 1 //Ignore Spies that are cloaked? RocketSpeed 0.25 //Multiplier of rocket speed. 1 for default speed TurnPower 90 //How fast should the rocket rotate to face the target MaxAimError 360 //Max angle between rocket and the target } </syntaxhighlight>Allows rockets (''but no other projectiles'') to home in on enemies. For making most projectiles home in on enemies, use the "mod projectile heat" set of [[List of custom attributes|custom attributes]]. == Taunt == <syntaxhighlight> Taunt [$SIGSEGV] //Taunt periodically { Duration 5 //Duration of a looping taunt (Default: 0.1) Name "Taunt: Kazotsky Kick" //If set, uses this item taunt instead of default } </syntaxhighlight>Note that "Name" requires the ''name of the item that you equip to use the taunt''. This name can be found in <code>items_game.txt</code>, with most newer taunts being prefixed with "Taunt: ", or having "Taunt" elsewhere in their name. Weapon-specific taunts can only be done if the bot is currently holding that weapon. == Voice Command == <syntaxhighlight> VoiceCommand [$SIGSEGV] //Periodically uses voice commands { Type "Medic" //Type of voice command. Possible values: //Medic //Help //Go //Move up //Left //Right //Yes //No //Activate Charge //Charge Ready //Incoming //Spy //Thanks //Jeers //Battle cry //Cheers //Sentry here //Dispenser here //Teleporter here //Good job //Sentry ahead //Positive //Negative //Nice shot } </syntaxhighlight> == ChangeAttributes == <syntaxhighlight> ChangeAttributes [$SIGSEGV] //Periodically changes bot attributes, defined in EventChangeAttributes{} { Name "Attr1" //Name of the bot attributes block listed in EventChangeAttributes{} } </syntaxhighlight>Note that bots will automatically start out in any attributes block named "Default". Maps with a gate will force bots to change to their "RevertGateBotsBehavior" block, if they have one. == ClientCommand == <syntaxhighlight> ClientCommand [$SIGSEGV] // Executes client commands, also known as console commands { Name "build 0" // Name of the client command, notable examples: // "build 0/1/2/3" - Build dispenser / teleporter entrance / sentry / teleporter exit // "destroy 0/1/2/3" - Destroy dispenser / teleporter entrance / sentry / teleporter exit } </syntaxhighlight> == WeaponResist == <syntaxhighlight> WeaponResist [$SIGSEGV] //Multiplies damage received from weapons listed below { "TF_WEAPON_KNIFE" 0.1 "TF_WEAPON_MINIGUN" 10 } </syntaxhighlight>Accepts both weapon classnames (such as <code>tf_weapon_flamethrower</code>applying to all regular flamethrowers) and individual weapon names. == Spell == <syntaxhighlight> Spell [$SIGSEGV] //Gives specified spell to bots. { Delay 1 //Time before the first spell charges are given (Default: 10) Cooldown 5 //Time between each spell changes (Default: 10) Repeats 12 //How many times should spell charges be given in total (Default: 0 - Infinite) Charges 1 //How many spell charges to give every time the spell is given (Default: 1) Limit 1 //How many spell charges the bot can store (Default: Same as charges given) Type "All" //Spell name. Possible values: //Fireball //Ball O' Bats //Healing Aura //Pumpkin MIRV //Superjump //Invisibility //Teleport //Tesla Bolt //Minify //Summon Monoculus //Meteor Shower //Summon Skeletons //Common //Rare //All } </syntaxhighlight>For bots to use Spells, they must have a '''Spellbook item''' equipped, and ''no'' WeaponRestrictions active. == Action == A defunct keyvalue in vanilla. Works correctly on servers with our mods.<syntaxhighlight> Action FetchFlag [$SIGSEGV] //Overrides default bot AI. Possible values: //Default - Default action //FetchFlag - Uses generic bomb fetching AI, default action for most bots except Spy, Medic, Engineer or Mission bots //EscortFlag - As above, but ignores bot escort limit //PushToCapturePoint - Pushes to capture point (or hatch in MvM). Similar to BehaviorModfiers Push and its aliases. //Mobber - Chases down random player targets //Spy - Uses spy AI, teleports behind players, but does not use disguises or cloak. //Sniper - Uses mission sniper AI //SuicideBomber - Uses sentry buster AI, but targets players instead. Might crash servers //Idle - Sit in spawn and wait //Passive - Sit at spawn position, until an active threat is in vision //Medic - Use medic AI </syntaxhighlight> == Custom weapon model == <syntaxhighlight> CustomWeaponModel [$SIGSEGV] //Sets custom weapon model { Slot 1 //Valid loadout positions: //0 - LOADOUT_POSITION_PRIMARY //1 - LOADOUT_POSITION_SECONDARY //2 - LOADOUT_POSITION_MELEE //3 - LOADOUT_POSITION_UTILITY //4 - LOADOUT_POSITION_BUILDING //5 - LOADOUT_POSITION_PDA //6 - LOADOUT_POSITION_PDA2 Model "models/weapons/w_models/w_minigun.mdl" } </syntaxhighlight>Alternatively, use "custom item model" as a [[List of custom attributes|custom attribute]]. The model has to be precached if it isn't part of the current map. Double-check this if you end up with ERROR models. == FireWeapon == <syntaxhighlight> FireWeapon [$SIGSEGV] //Periodically fires weapon { Duration 0.5 //How long should the button be pressed (Default: 0.1) Type "Secondary" // Type of fire input, Possible values: //Primary //Secondary //Special - MOUSE3 //Reload //Jump //Crouch - requires NoCrouchButtonRelease 1 in TFBot //Action } </syntaxhighlight>A FireWeapon{} block with <code>Type "Action"</code> can be paired with <code>ExtAttr SuppressCanteenUse</code> to time canteen usage. A FireWeapon{} block with <code>Type "Primary"</code> can be paired with <code>Attributes SuppressFire</code> to control when a bot attacks. == ItemColor == <syntaxhighlight> ItemColor [$SIGSEGV] //Set item color { ItemName "The Gunboats" Red 255 Green 0 Blue 0 } </syntaxhighlight>Note: global keyvalues may not work in this block. == AddCond == <syntaxhighlight> AddCond [$SIGSEGV] //Adds conditions to bots { Name "TF_COND_REPROGRAMMED" // Condition to apply. //Index 43 //Condition index can be used instead Delay 3 // Delay before the condition activates (Default: 0) Duration 99 // Duration of the condition effect (Default: -1 - infinite duration) } </syntaxhighlight>Note that the default Delay value is 0. Available condition values and names can be found on the [https://wiki.teamfortress.com/wiki/Cheats#addcond TF2 wiki]. == DamageAppliesCond == <syntaxhighlight> DamageAppliesCond [$SIGSEGV] //Adds conditions to players on hit { Name "TF_COND_URINE" // Condition to apply. //Index 43 //Condition index can be used instead Duration 3 // Duration of the condition effect (Default: -1 - infinite duration) } </syntaxhighlight>Available condition values and names can be found on the [https://wiki.teamfortress.com/wiki/Cheats#addcond TF2 wiki]. Alternatively, use the "add cond on hit" set of [[List of custom attributes|custom attributes]], which can be specified per weapon. == Stripping items == <syntaxhighlight> StripItemSlot 1 [$SIGSEGV] //If set, weapon in specified slot is stripped //Valid loadout positions: //0 - LOADOUT_POSITION_PRIMARY //1 - LOADOUT_POSITION_SECONDARY //2 - LOADOUT_POSITION_MELEE //3 - LOADOUT_POSITION_UTILITY //4 - LOADOUT_POSITION_BUILDING //5 - LOADOUT_POSITION_PDA //6 - LOADOUT_POSITION_PDA2 StripItem "Zombie Spy" [$SIGSEGV] // Remove item by name. This can be used to remove cosmetics including zombie cosmetics </syntaxhighlight> == FireInput == <syntaxhighlight> FireInput [$SIGSEGV] // Fires an input to an entity. Target !self and !activator refer to target the bot this block is on. { Target "random_color_case*" //Entity name to use Action "PickRandom" //Input to fire Param "" //Parameter to use } </syntaxhighlight>Keep in mind that <code>Repeats</code> defaults to 0, infinite. Specify it as 1 to only fire an input once. The bot will be considered the !activator. == Add- & RemoveAttribute == <syntaxhighlight> AddAttribute [$SIGSEGV] { Item "TF_WEAPON_KNIFE" // Item name to which add the attribute, or Player for player attribute, or Active for active weapon Name "damage bonus" // Attribute name Value 2 // Attribute value } RemoveAttribute [$SIGSEGV] { Item "TF_WEAPON_KNIFE" // Item name from which remove the attribute, or Player for player attribute, or Active for active weapon Name "damage bonus" // Attribute name } </syntaxhighlight>If multiple attributes should be added or removed at once, it may be preferable to use <code>EventChangeAttributes{}</code> with <code>ChangeAttributes{}</code> instead. == Message == <syntaxhighlight> Message //Displays message in the chat { Name "{red}Hello!" //Message in the chat displayed } </syntaxhighlight>Text colour can also accept hex codes without #, such as <code>FF0000</code> for red. == Sequence == <syntaxhighlight> Sequence [$SIGSEGV] // Display a sequence animation with a name. Not every animation is supported { Name "Run_MELEE" // Name of the sequence } </syntaxhighlight>Sequence names can be found using HLMV, which is available by default in your Team Fortress 2/bin folder (which is "above" your tf/ folder), or in the Hammer++ Model Browser tool. == WeaponSwitch == <syntaxhighlight> WeaponSwitch [$SIGSEGV] //Periodically switches weapon { Type "Primary" // Weapon slot, possible values: //Primary //Secondary //Melee //PDA //Building } </syntaxhighlight> == Visual changes == UseBusterModel 1 [$SIGSEGV] //Use buster model Skin 4 [$SIGSEGV] // Force the bot to use specified model skin == Misc. keyvalues == NoBombUpgrades 1 [$SIGSEGV] //If set, the bomb carrier will not upgrade over time PainSound "=70|GoldPipe_MissionIntro.mp3" [$SIGSEGV] //Override pain sound. The value after = is sound level in DB, applicable for all custom mission sounds DeathSound "GoldPipe_MissionIntro.mp3" [$SIGSEGV] //Override death sound. DesiredAttackRange 100 [$SIGSEGV] // How close to the target the bot should want to move when trying to attack. For melee weapons, default is 100. For other weapons except sniper rifles, default is 500 MoveBehindEnemy 1 [$SIGSEGV] // Should the bot try to get behind the target, similar to how the Spy bot behaves. Instead of 1 you can also specify custom distance at which the bot will start strafing around the target (default: 0) == Additions to existing keyvalues == WeaponRestrictions now also supports '''PDAOnly''' and '''BuildingOnly'''.
Summary:
Please note that all contributions to SigMod are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
SigMod:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
Edit source
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information