melee swap keybind.

YM

LVL100 YM
aa
Dec 5, 2007
7,158
6,079
So I thought to myself one day "how can I streamline my weapon switching?" I set about creating myself some binds. Unfortunately I lost the first set of binds at some point when I had to redownload TF2. But after rebuilding them I ended up with a better system. so yay for me.

Here is what I did:

  • Q no longer acts as previous weapon, but a primary/secondary slot
  • Every time 1, 2 or q is pressed the "current weapon" is stored and swapped to
  • On the surface, 1 and 2 have had no change in function and Q's only change is that it omits melee totally
  • The previously unused shift key, as well as 3 is now bound as a melee swap button
  • When 3/shift is pressed it swaps between the stored current weapon and the melee weapon

How is this faster? well I was never really good at hitting the number keys whilst playing and q/shift are much easier to hit and when I came to do this I was literally gob-smacked that shift wasn't bound to anything already. At the time I was playing a lot of medic, healing then quickly being able to swap to my ubersaw was handy, pressing 3 was ok but then I had to think about which button to use to get back to healing (medigun seems logical as the medic's primary weapon, but its not, its slot2) so one goal was I needed an accessible button to get me a quick jab at a scout and then healing again asap. Then the primary/secondary weapon swap key came out of that, I can swap in the same manner to the needlegun and back with less thought about which buttons to press.

The code:
Code:
alias primary "slot1; bind q secondary; alias cur slot1; bind shift 
meleetoggle; bind 3 meleetoggle"
alias secondary "slot2; bind q primary; alias cur slot2; bind shift 
meleetoggle; bind 3 meleetoggle"
alias current "cur; bind shift meleetoggle; bind 3 meleetoggle"
alias meleetoggle "slot3; bind shift current; bind 3 current"
bind 1 "primary"
bind 2 "secondary"
bind 3 "meleetoggle"
bind q "primary"
bind shift meleetoggle

I might even bind the buttons on the pistol grip of my falcon to these too. I hope at least one other person finds these useful :)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
A decade of playing FPS shooters, most significantly Half-Life and TFC have hard coded 1234567 weapon switching as reflexes for me. If i'm feeling exotic i'll use the mouse roller button, one cog piece movement and a click gets me to the next weapon in a fraction of a second and i don't have to sacrifice mobility by using my left hand. Shift is usually sprint but TF2 doesn't have a sprint feature so...

This seems more complicated than what i'm doing already but if it works for you then, well well done for something that works for you.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,674
I have mine like so...

Code:
alias invswap invswap2
alias invswap1 "invprimary; alias invswap invswap2; alias invmelee invmelee3"
alias invswap2 "invsecondary; alias invswap invswap1"
alias invmelee invmelee3
alias invmelee3 "invtertiary; alias invmelee invmelee2; alias invswap invswap1"
alias invmelee2 "invsecondary; alias invmelee invmelee3"
bind mouse4 invswap
bind mouse5 invmelee

What it does is make mouse4 always swap between primary and melee, and mouse5 swap between secondary and melee. When switched to melee each button gets 'reset' to bring out primary/secondary.

The invprimary, invsecondary, invtertiary aliases are defined directly to weapon commands on a per-class basis, like this.
Code:
alias invprimary "use tf_weapon_rocketlauncher; use tf_weapon_rocketlauncher_directhit"
alias invsecondary "use tf_weapon_shotgun_soldier; use tf_weapon_buff_item"
alias invtertiary "use tf_weapon_shovel"
This allows for two things. Bypassing "slot" commands means those damnable sourcemod votes never interfere with weapon switching. For medic I can easily define medigun as primary as far as my switching commands are concerned, even though the game puts it in slot 1.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,820
I have mouse wheel up for slot1, down for slot2, and hold mouse4 for constant melee (like l4d).
fixed^

and mouse 5 for whatever else there is... build and disguise? I think engineers destroy is the only thing I don't access with the mouse.

No fancy swapping, just one button for each slot.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,701
2,583
Is there a way I could change my bindings so that the scroll wheel just cycles through weapons 1-3? Because that's my biggest problem. When there's only three weapons every one is just a flick away, but any more than that and I start fumbling. (I used to have it set to wheelup=1, wheeldown=2, E=3, Q=4, and wheelclick=5, and F=call for medic because I was used to it being the heal key in Bioshock. Eventually I decided I was wasting buttons and went back to defaults, but now I hate playing Engineer.)
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,674
Code:
alias inv1 "slot1; alias invup inv2; alias invdown inv3"
alias inv2 "slot2; alias invup inv3; alias invdown inv1"
alias inv3 "slot3; alias invup inv1; alias invdown inv2"
alias invup inv2
alias invdown inv3
bind mwheelup invup
bind mwheeldown invdown
That should do it. If it goes the 'wrong' way, just reverse the wheel binds.
 

honeymustard

L9: Fashionable Member
Oct 26, 2009
698
575
fixed^

and mouse 5 for whatever else there is... build and disguise? I think engineers destroy is the only thing I don't access with the mouse.

No fancy swapping, just one button for each slot.

It's extremely useful for when you are playing medic competitively to get a fast ubersaw on something and immediately switch back to your medigun to use the uber you just got.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,701
2,583
Code:
alias inv1 "slot1; alias invup inv2; alias invdown inv3"
alias inv2 "slot2; alias invup inv3; alias invdown inv1"
alias inv3 "slot3; alias invup inv1; alias invdown inv2"
alias invup inv2
alias invdown inv3
bind mwheelup invup
bind mwheeldown invdown
That should do it. If it goes the 'wrong' way, just reverse the wheel binds.

Sweet. Now I just have to figure out how to stop it from automatically resetting my keybindings whenever it syncs with the Steam Cloud.
 

Jimmy

L420: High Member
Jul 6, 2009
421
228
I use my mouse for switching weapons. Mouse wheel up is slot one, mouse wheel down is slot 2, and mouse 3 is melee. I have a mouse 4 and 5 buttons now, but both disguises and building is bound to my numpad, so I shall bind them to voice spams :D
 

Passerby

L2: Junior Member
Mar 27, 2010
99
15
i use a pretty different setup

q will only switch between primary and secondary, mouse 5 will switch melee and start hitting if i hold it down, when the melee is out mouse 1 will bring back my primary and q will pull out my secondary.

and the olny other real difference is that i use shift for crouch not control