Create an account


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

#1
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.
voice_)))))
[Image: 11693.png]
Reply

#2
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:
Code:
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.
Reply

#3
Thank you man!
voice_)))))
[Image: 11693.png]
Reply

#4
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.
Reply

#5
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:

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

#6
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
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How do I change a variable by 0.5 when a key is pressed? Kriss7475 9 5,794 01-06-2018, 10:35 AM
Last Post: martin-t
  How to bind 1st/3rd-person view switch? Smilecythe 4 12,074 09-14-2012, 06:36 AM
Last Post: Smilecythe
  key bindings to rotate weapons after shooting? zim2dive 7 7,823 12-24-2011, 05:17 AM
Last Post: tZork

Forum Jump:


Users browsing this thread:
1 Guest(s)

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