Bot manipulation using the console in TF2

team-fortress-2

When in offline practice, how can you manipulate bots so that they will follow rules when picking their classes (and thus allowing the player to enable / disable classes etc)
Namely I'm wanting:

To be able to "toggle" (or turn on / off) some classes i.e disable medic class for bots

and

To force at least X number of bots to be Y class i.e forcing the bots to always have at least 1 spy

Best Answer

In console, type tf_bot_add <count> <class> <team> <difficulty>.

Example: tf_bot_add 2 demoman red normal

All substitutions should be self explanatory. Difficulty is easy, normal, hard, advanced, or expert. If you wish to spawn a Heavy, you'll have to use heavyweapons, there is no special class command for any of the others. Team is red or blue.

As for forcing them to have no medics, and one spy, the best thing to do is set up the teams with the previous command, then type tf_bot_keep_class_after_death 1. Which will prevent bots from changing classes.

To get rid of bots, type tf_bot_kick <name>. Ex: tf_bot_kick foo if a bot's name is foo.