Advanced Keybindings

adam_0adam_0 Join Date: 2013-02-25 Member: 183332Members, WC 2013 - Silver
So yes, I've found the options.xml file, but haven't found any good documentation on how to do certain things. For example, I'm fairly certain that I couldn't add the equivalent of, for example, `bind <key> "name <foo>"` or other advanced bind commands.

I've seen someone on Nexzil (Rantology? Not sure) who's got an animated Kirby name which I think changes when WASD are pressed. I'm not looking for that exactly, but something similar perhaps. Any ideas on how to do this? I'm a programmer so I don't really care if it's complex, I'm just curious how this is done.

All help is appreciated and thanks!

Comments

  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    i would like to bind slot 2 (pistol) to mouse wheel down

    and maybe script a last used weapon script - which wouldn't be a problem at other games either :P
  • adam_0adam_0 Join Date: 2013-02-25 Member: 183332Members, WC 2013 - Silver
    Another thing of note is that I can't find anything that takes advantage of the numpad numbers... I'd guess it's just "NumpadX" but confirmation would be nice.
  • ultranewbultranewb Pro Bug Hunter Join Date: 2004-07-21 Member: 30026Members
    SetTitleMatchMode 3
    #IfWinActive Natural Selection 2
    {
    	WheelDown::1
    	WheelUp::2
    }
    return
    

    Use AutoHotkey. The above script will change the mousewheel into keys 1 and 2 when NS is the foreground program.

    I try to use my mouse software as much as possible, but changing the up/down of the wheel is not an option for Logitech mice.
  • adam_0adam_0 Join Date: 2013-02-25 Member: 183332Members, WC 2013 - Silver
    edited February 2013
    AutoHotkey seems useful if I'm looking to rebind my mousewheel for something, but what about the example I gave in the original post? I can't see a way to modify options.xml to set up the proper bind.

    What I'm looking for is the config file equivalent of the following:
    bind num1 name “adam_0 test1”
    bind num2 name “adam_0 test2”
    bind num3 name “adam_0 test3”
    bind num4 name “adam_0 test4”
    bind num5 name “adam_0 test5”

    etc.
  • adam_0adam_0 Join Date: 2013-02-25 Member: 183332Members, WC 2013 - Silver
    After asking around elsewhere, I've learned that binds are saved, not reloaded from config like, say, TF2. This fixes one of my problems, but I've realized that it's impossible to create a bind that will create a name with a space in it. Observe:

    bind NumPad1 "name part1 part2"

    Will execute `name part1` when NumPad1 is pressed. The `part2` will be discarded due to being the second argument ($2) to a function (for lack of a better term) which only takes one argument.

    Okay, let's just surround the name itself in double quotes:

    bind NumPad1 name "part1 part2"

    Now NumPad1 is bound to `name`. Because it's ignoring $3. Great.

    Maybe double quotes? TF2 is pretty good at understanding nested quotes, which from a parsing perspective is pretty interesting:

    bind NumPad1 "name "part1 part2""

    Nope, now NumPad1 is bound to `name `. Note the space.

    Hmm, different types of quotes? No dice.

    And finally, escaping quotes (\") works!

    bind NumPad1 "name \"part1 part2\""

    Phew. This should be documented somewhere in big, bold letters if it isn't already. Also, I'm not sure if further levels of nesting could need more escaping (\\\" etc)...
  • DTEDTE Join Date: 2004-05-03 Member: 28412Members
    I had this in my autohotkeyscript:

    WheelUp::1
    WheelDown::2

    1 being my rifle and 2 being my pistol.

    My script is working (checked it with notepad) but it seems NS2 has it blocked for some reason. Maybe because when I scroll it's like 5 or 6 scrolls and NS2 blocks input like this?
Sign In or Register to comment.