Create an account

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to bind several actions to a key?

Title says it. I want to bind the +jump and +fire2 actions to SHIFT.

Tried a few ways to write that in config.cfg, but no luck so far, any help appreciated.
[Image: 11693.png]

Including + and - commands in binds is a little tricky. You might think it would be as simple as doing bind shift "+jump;+fire2", but that does not work because (AFAIK) the engine expects just one command if a bind command starts in +.

Here's how you should do it: by defining a couple of aliases and binding them:
alias +jumpfire2 "+jump; +fire2"
alias -jumpfire2 "-jump; -fire2"
bind shift +jumpfire2

Put those three lines in autoexec.cfg (DO NOT edit config.cfg manually, it gets overwritten by the game and the aliases will be lost). If you don't already have one, just create autoexec.cfg in the same directory as config.cfg.

Thank you man!
[Image: 11693.png]

Ignore the following, I'm not sure it's right. You might want to give it a try, though.

Note that there is a drawback when you bind multiple keys to the same +/- command (I'm guessing you have a jump key and an attack2 key other than shift). Releasing a + key will release the bind, so if you press space to jump while you're pressing shift to jump-attack, you will stop jumping as soon as you release space or shift.

To necro an eight year old thread, anyone know how I'd go about setting up single key weapon-switch and fire? In Quake I would set config like so, but this always seems to fire before switching weapon:

alias +rl "impulse 9; +fire"
alias -rl -fire
bind mouse2 +rl
Post received signal SIGSEGV, Segmentation Fault

You might wanna look at when the cl_hook_activeweapon runs and put the +fire there. Might need +fire ; wait ; -fire but that might block input for one frame. defer might avoid that but some servers intentionally break it. There's also nextframe. Or just learn to release manually.

I think you acc will suffer though - you need to be aiming at target at the point it fires but you're not in control when it fires. Wouldn't be more logical to invert it and first fire, THEN switch away? This would mean you have 9 fire buttons though if you have 9 weapon binds.
[Image: 30381.jpg]

<packer> when i see martin-t's name my blood pressure increases

<[BOT]Hоtdоg> anyone here lives near martin?
<[BOT]Hоtdоg> will pay monies for shooting him

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to bind 1st/3rd-person view switch? Smilecythe 4 9,473 09-14-2012, 06:36 AM
Last Post: Smilecythe

Forum Jump:

Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-