From SigMod
Revision as of 20:18, 29 July 2023 by Seelpit (talk | contribs) (Page created.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 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:

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


Extra Attributes that can be applied to bots, akin to the vanilla Attributes keyvalue.

// 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

Homing Rockets

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

Despite the name, also allows other projectiles (such as arrows) to home in on enemies. Alternatively, use the "mod projectile heat" set of custom attributes.


Taunt [$SIGSEGV]  //Taunt periodically
	Delay 10					//Time before the first taunt starts (Default: 10)
	Cooldown 1					//Time between each taunt (Default: 10)
	Repeats 1					//How many times the bot should taunt in total (Default: 0 - Infinite)
	Duration 5					//Duration of a looping taunt (Default: 0.1)
	Name "Taunt: Kazotsky Kick" //If set, uses this item taunt instead of default

Note that "Name" requires the name of the item that you equip to use the taunt. This name can be found in items_game.txt, 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

VoiceCommand [$SIGSEGV]  //Periodically uses voice commands
	Delay 8			//Time before the first voice command starts (Default: 10)
	Cooldown 5		//Time between each voice command (Default: 10)
	Repeats 55		//How many times should bot use the voice command in total (Default: 0 - Infinite)
	Type "Medic"	//Type of voice command. Possible values:
		//Move up
		//Activate Charge
		//Charge Ready
		//Battle cry
		//Sentry here
		//Dispenser here
		//Teleporter here
		//Good job
		//Sentry ahead
		//Nice shot


ChangeAttributes [$SIGSEGV]  //Periodically changes bot attributes, defined in EventChangeAttributes{}
	Delay 10		//Time before the first bot attribute change (Default: 10)
	Cooldown 10		//Time between each bot attribute change (Default: 10)
	Repeats 1		//How many times should bot change attributes in total (Default: 0 - Infinite)
	Name "Attr1"	//Name of the bot attributes block listed in EventChangeAttributes{}

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 [$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
	Delay 1 		//Time before the first execution of the task (Default: 10)
	Cooldown 5 		//Time between each execution of the task (Default: 10)
	Repeats 12 		//How many times should the task be executed in total (Default: 0 - Infinite)


WeaponResist [$SIGSEGV] //Multiplies damage received from weapons listed below

Accepts both weapon classnames (such as tf_weapon_flamethrowerapplying to all regular flamethrowers) and individual weapon names.


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:
		//Ball O' Bats
		//Healing Aura
		//Pumpkin MIRV
		//Tesla Bolt
		//Summon Monoculus
		//Meteor Shower
		//Summon Skeletons

For bots to use Spells, they must have a Spellbook item equipped, and no WeaponRestrictions active.


A defunct keyvalue in vanilla. Works correctly on servers with our mods.

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

Custom weapon model

CustomWeaponModel [$SIGSEGV] //Sets custom weapon model
	Slot 1 //Valid loadout positions:
	Model "models/weapons/w_models/w_minigun.mdl"

Alternatively, use "custom item model" as a custom attribute. The model has to be precached if it isn't part of the base game.

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.