Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Auto-reload and Rapidfire
#1

I wrote this post in response to a question on the Steam forums and thought I might offer it to you guys also.

You'll need to add this to your autoexec.cfg, so that every class with an autoreloadable weapon can take advantage of the script.

Code:
//Auto-Reload Script
alias "+zreload"             "-reload; +attack"
alias "-zreload"             "-attack; +reload"

*Note* If you don't have an autoexec, just copy any class config from your Steam\steamapps\USERACCOUNT\team fortress 2\tf\cfg folder, delete the contents, then rename it to "autoexec" without quotes, and insert the above reload script.

It's important that you go through and rebind your weapon keys in each class cfg so that you don't encounter the odd weapon behavior that can carry over after changing classes, because each class config is executed everytime you switch to the respective class. Rather than just forcing people to figure out how to do this correctly, I'll paste my class cfg contents so that you can fully understand what I mean and then tailor the scripts to your needs, keybinds, and preferences.

These are my preferred weapon binds, change these as you copy them to suit your preference:
c = primary weapon
v = secondary weapon
x = melee weapon

Demoman.cfg
Code:
//Grenade Launcher Auto-reloads
//Sticky Bomb Launcher Does Not Auto-reload
bind c "slot1; +reload; bind mouse1 +zreload"
bind v "-reload; -attack; slot2; bind mouse1 +attack"

Engineer.cfg
Code:
//Shotgun Auto-reloads
//Pistol Rapidfire and Auto-reloads
bind c "slot1; +reload; bind mouse1 +zreload; -QF"
bind v "slot2; -reload; bind mouse1 +attack; ZZZ"

//Pistol Rapidfire and Auto-reloads
alias ZZZ "bind mouse1 +QF"
alias +QF "alias RF F; F"
alias F "+attack; wait 3; -attack; wait 3; RF"
alias -QF "alias RF ; wait 5; +reload; wait 3; -reload"

Heavyweapons.cfg
Code:
//Prevents Minigun From Autospin
//Shotgun Auto-reloads
bind mouse1 "+attack"
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; +reload; bind mouse1 +zreload"

Medic.cfg
Code:
//Default Weapon Behaviors
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"
bind mouse1 "+attack"

Pyro.cfg
Code:
//Removes Flamethrower Sputter
//Shotgun Auto-reloads
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; +reload; bind mouse1 +zreload"
bind mouse1 "+attack"

Scout.cfg
Code:
//Scattergun Auto-reloads
//Pistol Rapidfires and Auto-reloads
bind c "slot1; +reload; bind mouse1 +zreload; -QF"
bind v "slot2; -reload; bind mouse1 +attack; ZZZ"

//Pistol Rapidfire and Reload
alias ZZZ "bind mouse1 +QF"
alias +QF "alias RF F; F"
alias F "+attack; wait 3; -attack; wait 3; RF"
alias -QF "alias RF wait; +reload; wait 3; -reload"

Sniper.cfg
Code:
//Default Weapon Behaviors
bind mouse1 "+attack"
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"

Soldier.cfg
Code:
//Rocket Launcher and Shotgun Auto-reload
bind mouse1 +zreload
bind c "slot1; +reload; bind mouse1 +zreload"
bind v "slot2; +reload; bind mouse1 +zreload"

Spy.cfg
Code:
//Default Weapon Behaviors
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"
bind mouse1 +attack

I realize that in a number of these aliases/binds a few commands are redundant; however this circumvents a few annoying behaviors that previously cropped up from time to time.

Please be sure to fully understand what these commands do before you change or copy/paste them to your configs.
Reply
#2

fucking scripter. Have fun being banned!

/sarcasm
Reply
#3

Banned from what? For what?
Reply
#4

Not cool.

-rep

[Image: hell-met.jpg]
Reply
#5

That's what I'm wondering. Seriously, there's nothing wrong with scripting and the same scripts are available to everyone so it's not like he's doing anything you can't be. You can easily see autofire scripts in some of the frag vids that get thrown around.
Reply
#6

2 Questions, Do these not work if you mousewheel scroll, and can I just put this into my solider config for it to always work for soldier? Or would I still need the general one in the Autoexec folder?



Code:
//Rocket Launcher and Shotgun Auto-reload
"slot1; +reload"
"slot2; +reload"
Reply
#7

itt: people who never played NSP

/sarcasm
Reply
#8

pretty much autoreload is as simple as typing +reload in your console. So if you wanted autoreload for all soldier weapons you could put +reload in your soldier.cfg

Of course since autoreload might not be preferred on other classes/weapons you'd need to put -reload in the other class scripts you dont want it in.

I don't really bother with autoreload, its just natural for me to hit 'r' constantly.
Reply
#9

Adder, I need to know how you use the mousewheel.

For instance, if you have:
Code:
bind mwheelup invnext
Which just cycles to the next weapon after each click, then no it won't work. However, if you have:
Code:
bind mwheelup slot1
and
Code:
bind mwheeldown slot2
- or some other similar variation calling to a specific slot, then it can be made to work.

Let's examine my original post.
Code:
//Rocket Launcher and Shotgun Auto-reload
bind mouse1 +zreload
bind c "slot1; +reload; bind mouse1 +zreload"
bind v "slot2; +reload; bind mouse1 +zreload"
The first thing this config does is bind your Mouse1 button to execute the alias 'zreload' everytime that button is pressed. Which means that you will stop attempting to reload and then fire your weapon, the other important part is that upon releasing the button it will automatically try to reload.

What you pasted will not work the way you think it might, you've basically made it so that everytime you select slot1 or slot2 from specific keys it will reload, but it won't do it for you after you've fired a shot, not until you press slot1 button again.

The reason I suggest putting the 'zreload' alias in the autoexec is so that other classes can take advantage of it, scout scattergun, engineer shotgun, demo grenade launcher, and et cetera without repasting it to each class config.

If any of you would like this setup in a particular way, let me know and I'll make it work for you, just keep in mind that there limitations to scripting.
Reply
#10

OmegaZero_Alpha, I have no idea what it is about my scripting that would constitute a ban, and I have no idea what NSP references.

In any case, this is the contents of my autoexec.cfg
Feel free to ask questions before attempting to use any of these aliases.

http://pastebin.com/f7a54f390

After an hour of on/off attempts to keep the formatting from pasting my autoexec.cfg and failing, I decided on just providing a link (HTML hates tabs even with the code and pre tags). I think the formatting is crucial to reading it correctly if you've previously never seen anything like it.

Feel free to ask questions about any of what you see in the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)