Team Fortress 2 Bot Command Guide

Have you ever wanted to make a Team Fortress 2 video, but your asshole friends didn’t want to help you? Well it looks like bots may be your answer!*

*Bots aren’t really the answer. They are very limited in what they can do, and were only designed to the simplest of things for the commentary. So don’t be disappointed if your grand TF2 video cannot come into fruition due to lack of versatility and/or friends.

For the Faceposing tutorial for Team Fortress 2, I am going to refer you to Katana314’s excellent video tutorial

Just to let people know, I found how to use some of these commands by studying the TF2 commentary scripts, which can be extracted using GCFScape. They are located within the tf/maps directory of the “Team Fortress 2 Content.gcf”. There are 3 scrips for the 3 different commentary maps with the commentary suffix. You will see that these scripts simply execute console commands, most of which control the bots. If you want to know how to do something not listed here, I would suggest looking how to do it yourself from those examples. (Or get some friends.) You can also discover majority of the bot commands yourself, by entering 'bot’ into the console, it will list all the commands specific to the bots, of which most are self explanatory.

Before you start, you’re going to have to modify your server to support bots. This is achieved by:

  1. Starting a server, being a listen or dedicated one, with admin privileges
  2. Setting sv_cheats 1
  3. Setting mp_autoteambalance 0
  4. setting mp_teams_unbalance_limit 0

Great. Now you’re going to have to make some bots. The “bot” command by itself isn’t very useful, but you can add parameters to increase it’s effectiveness.
(when typing the commands in the console, replace “(x)” with the parameter)

  • The -team (x) parameter lets you define the team of the next bot being created. This can either be red or blu. (You must use ‘blu’ to assign the bot to the blue team)
  • The -class (x) parameter allows you to define the class of the bot. This is simply done by typing the class as scout, or whatever as the parameter.
  • The -name parameter allows you to set the bot’s name. This is not necessary, but is useful when you begin to set the bots for whatever you are doing.
  • For example, if you wanted to make a blue sniper named george, you would type:

bot -team blu -class sniper -name george

When you create bots, they will either spawn at their corresponding team’s spawn area, or at the map’s origin (0,0,0), if you are loading a custom map which was not made for tf2. Whichever the case, chances are these are not the places you want your bots to be, so you’re going to have to move them manually. This is achieved using the bot_teleport command.
This command works in the following way:

bot_teleport [bot name] [position x] [position y] [position z] [pitch] [yaw] [roll]

You can easily find coordinates by walking and aiming in the desired location and typing “getpos” in the console. This will output your current location and aim into the console:

setpos 0.000000 0.000000 -4177.020508;setang 34.234196 7.207201 0.005997

simply remove the “;setang” and “setpos” from the message and paste the coordinates in front of the bot_teleport command.
Alternatively, you can manually set the coordinates for the teleport by filling in the numbers yourself. Just remember that setting a parameter for the roll does nothing, so just keep that zero. To alter the direction your bot is looking, enter a number between 0 360 into the yaw parameter. Do the same is can be applied to the pitch.
For example:

bot_teleport george 235 1058 -4177 34 7 0

To force your bots to fire their weapons, you are quite limited on what you can do. The way it works is by entering the bot_forcefireweapon , x being the weapon you want the bots to start firing. So if you want your spy to start shooting is pistol, you would enter:

bot_forcefireweapon tf_weapon_revolver

you must enter the weapon code such as the one above to force the bots to start shooting, as ‘pistol’ doesn’t work. To see a full list of all the tf2 weapons, refer to the tf/scripts directory within the 'team fortress 2 content.gcf"
Upon entering the bot_forcefirweapon command, the bot will automatically switch to the weapon and begin shooting and reloading, until they run out of ammo (To give bots more ammo, use the “bot_refill” command)
To stop the bot from firing their weapon, simply enter the bot_forcefireweapon command, but with a false weapon:

bot_forecefireweapon ^^

This forces the bot to try fire a non-existent weapon, so as a result, they stop shooting.
You may have noticed a pretty large flaw with this command, and that this command is global. For example, by entering “bot_forcefireweapon tf_weapon_shotgun_pyro”, you are basically telling all bots, regardless of their class, to start shooting the pyro shotgun. This results in all your pyros to start shooting their shotgun, and all other classes to try and shoot the pyro shotgun, which they do not have, so they do nothing.
This basically means that you can only have one specific weapon firing at one time in a controlled manner. Which sucks.

To make bots taunt:

bot_command [bot name] taunt

To make a bot do a voice command:

tf_testrr [bot name] TLK_PLAYER_BATTLECRY

TLK_PLAYER_BATTLECRY is used as an example. I’m not entirely sure what the rest of the emotes are.

To make engineers build stuff:

bot_command [Engineer name] build [x]
bot_forcefirweapon tf_weapon_builder

Replace with a number from 0-3 to select which structure he builds

To make bots mimic everything you do:

bot_mimic 1

This is not the most useful command, but it can be fun if you’re just messing around.

This should give you guys a basic idea on how to make the bots do your bidding. This is not a complete list, as I only listed things which I definitely know how to do. (using the bot_forceattack2 command is a bit tricky.) It is pretty much down to experimentation from this point. Just bear in mind that the syntax may vary. For example, I don’t think specifying a bot name is necessary for the “Bot_command” command.
Phew, I hope this helps, and I hope you guys can post your findings here too.

Thank you, SO MUCH.

Is it possible to make ALL bots taunt at the same time? (sorry for bumping :|)

i tried but it keeps saying it failed to create bot
can you help me

You can create a bot, but you can’t make him fight.

Add this to the tut:
If you want to use bots for getting achievements (like backstab 1000 people), type sv_cheats 0 and then retry in console.

(User was banned for this post ("Another stupid bump" - SilverHammer))

Oops, didn’t see the last posting date…

I can’t get the engi to place his building. He holds his toolbox, but won’t place anything down :frowning:

who… would be awesome if this was possible in gmod (i have HL2:DM, DoD:S, Gmod 11… not TF2…)

This is AWESOME! Thanks a lot everyone!

Why is everyone bumping old threads?

There are newer threads permalinking to older ones, I would like to assume.

Love the tut, except I can’t run faceposer. :frowning: It keeps crashing.


bot_command taunt bot01; bot_command taunt bot02 etc.

Do you knoww how to give weapons to bots?

I get a stroke from this bump.

Ooho-hoo, that’s clever.