Command for toggle run and crouch?

M

Mike89

Guest
I like having the options to toggle run and crouch. Some game have those options in the game menu but HalfLife 2 doesn't. Anyone know the commands to bind keys to do those two things in the console?
 
Those commands are for the game Empire? I don't recognize those commands as being for a Half Life game.
 
Empires is a mod for Half life 2, as such the console commands are the same.


The code beerdude posted is correct. Just paste it into your autoexec.cfg file, and change the "z" in the last line to whatever you want your crouch toggle to be.
Code:
alias crouchtoggle "crouchdown"
alias crouchdown "+duck; alias crouchtoggle crouchup"
alias crouchup "-duck; alias crouchtoggle crouchdown"
bind "z" "crouchtoggle"
 
I just copied and pasted those lines in an autoexec.cfg and it did not work.

alias crouchtoggle "crouchdown"
alias crouchdown "+duck; alias crouchtoggle crouchup"
alias crouchup "-duck; alias crouchtoggle crouchdown"
bind "c" "crouchtoggle"
 
Disregard that last message cause I didn't put the dam autoexec in the right folder. I had put it in the HL2 cfg folder when I was playing HL2 Episode 1. I know, I'm a dumb ass.

I did find one (after I figured out which folder it went in) that did work:

alias duck_t "duck_on"
alias duck_on "alias duck_t duck_off; +duck; developer 1; echo Ducking enabled; developer 0"
alias duck_off "alias duck_t duck_on; -duck; developer 1; echo Standing enabled; developer 0"

bind "c" "duck_t"

alias walk_t "walk_on"
alias walk_on "alias walk_t walk_off; +speed; developer 1; echo Walking enabled; developer 0"
alias walk_off "alias walk_t walk_on; -speed; developer 1; echo Running enabled; developer 0"

bind "shift" "walk_t"

It's still not doing exactly what I wanted though.

The toggle crouch part works perfect.

The toggle run part actually toggles between the default run speed (as in pressing the forward key) to sprinting. Along the way the previous "slow" or "walk" speed (from previously pressing the shift key) is now gone. That's not what I wanted. The sprint key I can assign to a different key and use as I want. The sprint only lasts as long as the power in the suit is there. I wanted to be able to toggle between that default run speed to the slow speed. I see a command for sprint (+speed) and slow (walk_t) but don't see one for that default run speed (the normal forward speed). I'll be damned if I can find this addressed anywhere. Crap!
 
I got it! (if anyone even gives a crap, heh heh).

If you want to toggle crouch and toggle from the default run to sprint, use the first config I posted.

If you want to toggle crouch and toggle from the default run speed to the slow walk speed, use this config.

alias duck_t "duck_on"
alias duck_on "alias duck_t duck_off; +duck; developer 1; echo Ducking enabled; developer 0"
alias duck_off "alias duck_t duck_on; -duck; developer 1; echo Standing enabled; developer 0"

bind "c" "duck_t"

alias walk_t "walk_on"
alias walk_on "alias walk_t walk_off; +walk; developer 1; echo Walking enabled; developer 0"
alias walk_off "alias walk_t walk_on; -walk; developer 1; echo Running enabled; developer 0"

bind "shift" "walk_t"

Of course substituting any key you might want to use for any of the two toggles if different from the above.
 
So that toggles instead of makes you have to hold it down?
Wouldn't that be frustrating if you didn't know what you did?
 
Huh? You can't tell when you're crouched or walking? I just like the toggle. Sometimes I may walk for awhile or walk crouching for awhile (or stay in a crouch for awhile). I just don't like having to keep the key held down. I'd much rather just click it once to do it and click it again to undo it. At least now I have the choice. BTW, this works for Sin Episode 1 also.
 
Good stuff, i'm glad you found a script to change it to your style. :)
 
Huh? You can't tell when you're crouched or walking? I just like the toggle. Sometimes I may walk for awhile or walk crouching for awhile (or stay in a crouch for awhile). I just don't like having to keep the key held down. I'd much rather just click it once to do it and click it again to undo it. At least now I have the choice. BTW, this works for Sin Episode 1 also.

I mean that if you see that you're crouched, but you don't know what you did to crouch and then you start yelling and slapping your keyboard/monitor.
 
I mean that if you see that you're crouched, but you don't know what you did to crouch and then you start yelling and slapping your keyboard/monitor.

Huh? (heh heh). Of course I would know what I did to crouch, I hit the "c" key. No, I wouldn't be yelling and slapping the keyboard, I would simply hit the "c" key again to stand back up. Same thing with the "shift" key to either walk or run. Are you smoking something I should know about? Or, maybe I'm smoking something you should know about. LOL!

Seriously, if you like to hold down the key, that's cool. I just posted the script for anyone that would rather have those functions toggle.
 
Back
Top