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:
- Starting a server, being a listen or dedicated one, with admin privileges
- Setting sv_cheats 1
- Setting mp_autoteambalance 0
- 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.
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:
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:
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:
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.