Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How To Create Custom FPS and Taunt Animations - A Tutorial for Team Fortress 2.

I am going to assume you already are familiar with SourceFilmmaker and have a very basic understanding of Blender so that I don't waste your time.

In order to follow this tutorial you will need the following programs:

  • Source Filmmaker
  • Blender
  • Blender SourceTools (https://developer.valvesoftware.com/wiki/Blender_Source_Tools)
  • GCFScape (http://nemesis.thewavelength.net/index.php?p=26) [get the most recent]
  • SourceSDK Content (Can get on Steam) [it's under tools]


Now for the tutorial bits

Making First Person Animations

STEP 1: make your animation in sfm


STEP 2: cut to the precise amount of frames you need (enough so that the animation loops just once) and right click the model the animation is for and export\animation


STEP 3: select the trim frames option


STEP 4: import your new dmx file to Blender (requires Blender Source Tools) and set the ending frame to the last frame of the animation


STEP 5: ORIENT THE ANIMATION MODEL BELOW AND IN FRONT OF THE REFERENCE PLANE (THIS IS CRUCIAL FOR MAKING SURE THE ANIMATION WILL BE IN FRAME WHEN YOU PUT IT IN GAME)


STEP 6: on the top right corner of blender there is a small drop-down menu. click it and select the properties function.Then mouse over to the icon with the three shapes and click it


STEP 7: this opens the exporting window for source-tools. Select SMD (you may have to scroll down) and have the upaxis centered on Z


STEP 8: export the file


STEP 9:    decompile the desired mdl file in crowbar after you have aquired it from GCFScape (make sure you decompile it with a qc file and with $definebones checked!)


STEP 10: find the animation you want to replace and copy its name


STEP 11: name the animation you exported from Blender to the animation you want to replace and replace the file in the folder you decompiled the mdl file to


STEP 12: Navigate to common\TeamFortress2\bin and locate studiomdl.exe


STEP 13: take the qc file from the animation file you decompiled (it will be a text file with the file type "QC" in the decompiled mdl file folder) and drag and drop it over studiomdl.exe. (A command prompt should briefly appear if you did it right)


STEP 14: the file will be sent to common\TeamFortress2\tf\models

(if it isn't there that means studiomdl.exe encountered an error while compiling which means you probably messed something up along the way)


STEP 15: grab the new compiled file and create a folder hierarchy

Ex. - models\player\*class\*your_modded_file*


STEP 16: once the hierarchy destination is complete, go back to the "bin" folder and drop the parent folder in the hierarchy into vpk.exe


STEP 17: drop the new vpk into tf\custom

Test in Game





Making Third Person (taunt) Animations

1: Create your desired animation in SFM


2: Remove any rigs from the model


3: Right click the model and choose Export\Taunt Animation


4: Rename the file after the taunt you want to replace


5: Create a Text File and paste in the following script - IMPORTANT

// defining the upaxis is needed for Source Filmmaker exports
$upaxis Y
$modelname player/*class*_animations.mdl

$includemodel player/*class*_animations2.mdl

$definevariable infoNode "*class*Info"
$include "*class*_definebones.qci"

// include the file that sets up the ikchains
$include "../../TF_animation_rules/ruleshierarchy.qci"
$include "../../TF_animation_rules/TF_macros_list.qci"

$pushd "../animations"

$sequence *taunt_name* "*taunt_name*" snap fps 30 {
    event AE_WPN_HIDE *startframe*
    event AE_WPN_UNHIDE *endframe*
}




6: Fill in the *class* and *taunt_name* boxes with the taunt, class, and *start/endframe* info you want to replace
NOTE - DON'T INCLUDE THE STARS! *********


7: rename the file *class*_animations2.qc and make sure to save it as all files instead of .txt


8: Use GCFScape to rip out the class's base animations mdl file (*class*_animations.mdl)


9: rename it to *class*_animations2.mdl [add a 2]


10: move your qc file to this destination C:\\ProgramFiles(x86)\Steam\steamapps\common\sourcesdk_content\tf\modelsrc\player\*class*\scripts


11: move your DMX file to this destination C:\\ProgramFiles(x86)\Steam\steamapps\common\sourcesdk_content\tf\modelsrc\player\*class*\animations [DON'T PUT IT IN THE FOLDER CALLED DMX THOUGH!]


12: open *class*_animations2.qc in Crowbar and compile it. Set the output to Subfolder (of QC input) [it will have a name like compiled 0.*number*]


13: Check the compile window for any errors and retrieve the new compiled mdl file at this destination:
   
    C:\\ProgramFiles(x86)\Steam\steamapps\common\sourcesdk_content\tf\modelsrc\player\*class*\scripts\compiled 0.*number*

14: place both files [*class*_animations.mdl (the new compiled file) and *class*_animations2.mdl] in folders layed out like this:

my_custom_stuff\models\player


15: place the my_custom_stuff folder in this file location:


    C:\\ProgramFiles(x86)\Steam\steamapps\common\Team Fortress 2\tf\custom

Test the Mod!


I hope you found this tutorial helpful. If you have any questions, feel free to message me on GB or ask in the comments. I will try and clear up confusion people may have.



ALSO, HERE'S A VIDEO SUMMING UP CUSTOM TAUNT ANIMATION MODS - note however, that there is a bit of confusion towards the end when the author is explaining that both *class_animations.mdl and *class animations2.mdl need to go in the same folder for the mod to work.

Lastly, credit to Josh Griffin for the paste-able QC code.