Welcome to FOoM's TeamFortress Files
Weapon Scripts

These are weapon scripts. Some you will put in your tfc/autoexec.cfg or Steam's userconfig.cfg - others in the individual class configs. You may change the bind lines to include your own key choices, for best results manually write the bind lines in your config.cfg.



Grenade Primers


Old school style. No reset for held grens. (Don't let this script mystify you, it works)

//Gren Primer - hit key to prime, hit again to throw
bind "f" "throwgren;primeone"
bind "g" "throwgren;primetwo"


Grenade script2 - hit key to prime, then hit either gren key to throw your gren. This one is flawless, never misses, but will require resetting for held grens.

//gren primer - hit key to prime, hit again to throw
alias prime1 "primeone;alias grens1 throw;alias grens2 throw"
alias prime2 "primetwo;alias grens1 throw;alias grens2 throw"
alias throw "throwgren;alias grens1 prime1;alias grens2 prime2"
alias grens1 prime1
alias grens2 prime2
bind mouse4 grens1
bind mouse3 grens2

Grenade scripts are also used for grenade timer sounds. If you want to change the built-in grenade timer sound see this page, Grenade Timers.




Reload Scripts, several methods

Reload script #1.


//Reloads from respawning
//put in autoexec.cfg.
//constant reload animation
alias "rreload" "+reload;bind r rrespawn"
alias "rrespawn" "-reload; -attack; -right; wait; +right; -right; wait; wait; wait; rreload"
bind "r" "rreload"


Reload script #2.

//Attack and reload
//constant reload animation
bind mouse1 "+attkreld"
alias +attkreld "+attack;wait;-reload;wait"
alias -attkreld "-attack;wait;+reload;wait"


Reload script #3 - this one won't have the endless animation. I recommend that you only use the reload on two movement axis - or else the reload command may interfere with shot timing.

//New reloader
//put in autoexec.cfg - pick your own keys
bind w "+f"
bind s "+b"
bind a "+l"
bind d "+r"
alias +f "+forward; +reload"
alias -f "-forward; +reload;wait; -reload"
alias +b "+back; +reload"
alias -b "-back; +reload;wait; -reload"
alias +l "+moveleft; +reload"
alias -l "-moveleft; +reload;wait; -reload"
alias +r "+moveright; +reload"
alias -r "-moveright; +reload;wait; -reload"





Weapon switchers - 3 kinds

//#1 -Hold to fire
//This one switches to supershotgun, and fires continually if you hold the key down.
//When you let go of the key it stops firing and returns to your previous weapon.
//quick switch and fire shotgun
alias +qfire "use tf_weapon_supershotgun;wait;wait; +attack"
alias -qfire "-attack;lastinv"
bind w +qfire

//#2 - Hit key to fire, hit again to go back to regular weapon
//quick switch and fire shotgun toggler
alias gunon "use tf_weapon_supershotgun; wait; wait; +attack;+attack; bind w gunoff"
alias gunoff "-attack; -attack; lastinv; bind w shgunon"
bind w shgunon

//#3 - Simple weapon switcher
// Quick Weapon
alias qwik1 "tf_weapon_supershotgun;wait;alias qwchanger qwik2"
alias qwik2 "lastinv;wait;alias qwchanger qwik1"
alias qwchanger qwik1
bind q qwchanger

You can substitute any TFC weapon into the scripts. Just pick from this list:
tf_weapon_ac, tf_weapon_autorifle, tf_weapon_axe, tf_weapon_flamethrower, tf_weapon_gl, tf_weapon_ic, tf_weapon_knife, tf_weapon_medikit, tf_weapon_ng, tf_weapon_pl, tf_weapon_railgun, tf_weapon_rpg, tf_weapon_sniperrifle, tf_weapon_spanner, tf_weapon_superng, tf_weapon_supershotgun, tf_weapon_tranq.

Here is a setup of switchers for each class, from [FOoM]bear3.


// put in autoexec.cfg
bind q quickweapon

//Quick Weapon - put in demoman.cfg
alias quick1 "tf_weapon_gl;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_pl;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in engineer.cfg
alias quick1 "tf_weapon_spanner;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_supershotgun;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in hwguy.cfg
alias quick1 "tf_weapon_supershotgun;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_ac;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in medic.cfg
alias quick1 "tf_weapon_supershotgun;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_superng;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in pyro.cfg
alias quick1 "tf_weapon_flamethrower;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_ic;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in sniper.cfg
alias quick1 "tf_weapon_sniperrifle;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_autorifle;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in soldier.cfg
alias quick1 "tf_weapon_supershotgun;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_rpg;wait;alias quickweapon quick1"
alias quickweapon quick1

// Quick Weapon - put in spy.cfg
alias quick1 "tf_weapon_tranq;wait;alias quickweapon quick2"
alias quick2 "tf_weapon_knife;wait;alias quickweapon quick3"
alias quick3 "tf_weapon_supershotgun;alias quickweapon quick1
alias quickweapon quick1