Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Auto-reload and Rapidfire

  1. #1
    yay's Avatar



    Join Date
    Feb 15, 2009
    Last Online
    Feb 23, 2011
    Posts
    27
    Threads
    10



    Auto-reload and Rapidfire


    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.

  2. #2
    OmegaZero_Alpha's Avatar



    Join Date
    Jan 02, 2005
    Last Online
    Jul 16, 2019
    Posts
    4,880
    Threads
    253
    Reputation
    SourceOP Thread


        
    Steam: 76561197979925166 
    Steam join date: Dec 24, 2005
    Steam Level: 44
    Profile Status: Public



    fucking scripter. Have fun being banned!
    /sarcasm

  3. #3
    Drunken F00l's Avatar



    Join Date
    Dec 11, 2004
    Last Online
    Jun 11, 2019
    Posts
    5,874
    Threads
    182
    Reputation
    SourceOP Thread


        
    Steam: 76561197968459473 
    Steam join date: Aug 23, 2004
    Steam Level: 56
    Profile Status: Public



    Banned from what? For what?

  4. #4
    Hell-met's Avatar



    Join Date
    Feb 15, 2008
    Last Online
    Jul 17, 2014
    Posts
    4,310
    Threads
    64




    Not cool.

    -rep

  5. #5
    Ranma's Avatar



    Join Date
    Jan 27, 2009
    Last Online
    Aug 13, 2015
    Posts
    565
    Threads
    24




    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.

  6. #6
    Adder's Avatar



    Join Date
    Dec 01, 2008
    Last Online
    May 31, 2013
    Posts
    1,296
    Threads
    43



    Re: Auto-reload and Rapidfire


    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"

  7. #7
    OmegaZero_Alpha's Avatar



    Join Date
    Jan 02, 2005
    Last Online
    Jul 16, 2019
    Posts
    4,880
    Threads
    253
    Reputation
    SourceOP Thread


        
    Steam: 76561197979925166 
    Steam join date: Dec 24, 2005
    Steam Level: 44
    Profile Status: Public



    itt: people who never played NSP
    /sarcasm

  8. #8
    Ranma's Avatar



    Join Date
    Jan 27, 2009
    Last Online
    Aug 13, 2015
    Posts
    565
    Threads
    24




    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.

  9. #9
    yay's Avatar



    Join Date
    Feb 15, 2009
    Last Online
    Feb 23, 2011
    Posts
    27
    Threads
    10




    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.

  10. #10
    yay's Avatar



    Join Date
    Feb 15, 2009
    Last Online
    Feb 23, 2011
    Posts
    27
    Threads
    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.

Page 1 of 2 12 LastLast

Tags for this Thread