Yes. You can use the <classname>.cfg
files, where <classname>
is the name of the class (in all lowercase.)
For example, to disguise as a friendly Pyro when you spawn as Spy, you could place this in spy.cfg
(under <Path to TF2>/tf/cfg/
):
disguise 7 -1
which would immediately disguise you when you spawn.
You could also use it for special binds (an automatic "move forward and spin minigun" key for Heavy). Place this in your heavy.cfg
file:
alias +SpinAndMove "+attack2; +forward"
alias -SpinAndMove "-attack2; -forward"
bind "]" "+SpinAndMove"
which causes you to spin your minigun and move forward when you press the ] key.
Keep in mind that binds will overwrite any command already assigned to that key, and that they stick around even after the game exits. As Richard suggested in the comments, you can have a default.cfg
file with all the default binds, and then exec default
at the top of every class config file.