Gaah! Binding Problems!

JNightshade

Newbie
Joined
Nov 20, 2004
Messages
2,277
Reaction score
0
I was wondering... does anybody out there know how to bind 2 commands to the same key? Because I was thinking that having both low gravity and slomo mapped to the same key would make for a bitchin' good Matrix-y time. On a separate note, what does BindToggle do? I tried it out, but I couldn't tell what it did. I figured it toggled the command on and off, but it didn't seem like it. Anyway, thanks in advance for the help.
 
I'm no programmer or script-wiz or anything so take this with a grain of salt, but something that might work is binding a key to execute a cfg with those commands in it. Like make "matrix.cfg" with host_timescale .2 and sv_gravity 400 then bind it to a key like bind x "exec matrix.xfg". I have NO IDEA if this works, but it got me interested in it so i'm gunna go try it myself :p
 
bind "x" "cvar value; command; cvar value; command"

k?
k!
 
But you'd need another bind to make it normal again :)
 
Binding

I found that you have to put the command in parethesies like this

for example
bind x "host_timescale .4" (Slo-mo)
bind c "host_timescale 1" (Normal)
 
MaxiKana said:
But you'd need another bind to make it normal again :)

alias "on" "command; cvar value; command;...; bind x off"
alias "off" "command; cvar value; command;...; bind x on"
bind "x" "on"

?
!
 
jacen said:
alias "on" "command; cvar value; command;...; bind x off"
alias "off" "command; cvar value; command;...; bind x on"
bind "x" "on"

?
!

Ah but then if you ever want to change the key it is bound to, you need to edit the script in 3 places.

I'd recommend this:

alias "on" "command; cvar value; command;...; alias switch off"
alias "off" "command; cvar value; command;...; alias switch on"
off

This way, all you need to do is enter "bind x shift" in your console to bind it to x. If you ever want to change the key to something like g, you just go "bind g shift" into the console. You don't need to quit and then manually edit the script again. The third line is important, because it runs the alias, makes sure the effect is off when you load the game and creates the "switch" alias for you. If the "switch" alias isn't created then the key simply wont work.
 
Back
Top