Jump to content

Bind issues


Jacobmeister

Recommended Posts

So recently my M2 button has been kinda failing and it's very inconsistent - as I play a lot of dodgeball, this is naturally rather annoying. I've been messing around with new binds and decided I prefer M1 over M2 for dodgeball only.

 

What do I put into my autoexec if I want to set a key to switch the attack types of the mouse? (mouse1 doing attack2, mouse2 doing attack)

 

Any other solutions (other than getting a new mouse, that's in the works) would be helpful

Link to comment
Share on other sites

I'm using my own made up alias names and key bind in this script. If you want to use a different name or key, feel free to do so.

 

alias attackswitcher "dodgeball"
alias dodgeball "bind MOUSE1 +attack2; bind MOUSE2 +attack; alias attackswitcher normal"
alias normal "bind MOUSE1 +attack; bind MOUSE2 +attack2; alias attackswitcher dodgeball"
bind KP_DOWNARROW "attackswitcher"
bind MOUSE1 "+attack"
bind MOUSE2 "+attack2"
In case you're not familiar with scripting, an alias is a custom command where it will execute every command you assign to it.

 

Here, I make a command called "attackswitcher" and bind it to the number 2 on your keypad (which is also the down arrow. If you don't have a keypad, change the key to something else) so that you can access the switcher at any time. "attackswitcher" is then assigned to execute a command called "dodgeball", which you can see in the next line.

 

Executing "dodgeball" will change your left mouse click (MOUSE1) to secondary fire (+attack2), which is what lets you airblast; change your right mouse click (MOUSE2) to primary fire (+attack), which is what lets you shoot your gun; and reassign the original "attackswitcher" command to a new command called "normal", which you can see in the next line.

 

Executing "normal" will reverse the effects of "dodgeball". Your left and right mouse buttons will function as normal and the "attackswitcher" command will be reassigned to "dodgeball" in case you want to switch again.

 

The next two lines are simply a failsafe in case you exit the game while you have your dodgeball mapping enabled. Since this will be in the autoexec.cfg file, the script will revert to as you see it every time you relaunch TF2, but it won't actually fix your mouse keys, so your switcher would think you're in normal mode when you're actually in dodgeball mode. Binding the mouse keys to normal mode will ensure your switcher works every time, even after restarting TF2.

 

If anything goes wrong, just quote me or send me a PM via the forums.

Link to comment
Share on other sites

Or you could go into the in-game options menu and change the keys.

But then you'd have to change them back every time you want to play a normal TF2 game. This is faster and more convenient at the cost of taking time to set up.
Link to comment
Share on other sites

Works perfectly. Thank you Mr. Modest Gentleman Knavesmith! :D

Thank Christ it works. I had a feeling I missed a semi-colon or a quotation mark somewhere.

 

If you need anymore help with scripting, I can lend a hand.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...