Digital Paint Discussion Board

Paintball 2: The Game => Paintball 2 Discussion => Topic started by: WARNER on October 11, 2008, 02:08:04 PM

Title: Multiple Binds
Post by: WARNER on October 11, 2008, 02:08:04 PM
Can you have multiple binds on 1 key?  ??? I heard you can but no one told me how.. please help? :-\
Title: Re: Multiple Binds
Post by: iced on October 11, 2008, 02:12:16 PM
no u cant
Title: Re: Multiple Binds
Post by: WARNER on October 11, 2008, 02:29:47 PM
no u cant
oh okay thank you.
Title: Re: Multiple Binds
Post by: Olbaid on October 11, 2008, 02:43:01 PM
Yes, you can.  "cmd;cmd"
Title: Re: Multiple Binds
Post by: {appy Hamper on October 14, 2008, 12:53:39 PM
can you give me an example of how you would use "cmd;cmd"

If you mean something like:

bind "mouse1" "+attack;+movedown"

I'm pretty near certain that doesn't work.  At least it didn't in the older builds (maybe that got changed after I stopped actively writing scripts)...

Can you have multiple binds on 1 key?  ??? I heard you can but no one told me how.. please help? :-\

you have to use an ALIAS:

bind "mouse1" "duckshoot"
alias duckshoot "+attack;+movedown"

all you wanted to know and more about writing scripts:
http://console.planetquake.gamespy.com/tutorials/quake_2.html (http://console.planetquake.gamespy.com/tutorials/quake_2.html)
Title: Re: Multiple Binds
Post by: Eiii on October 14, 2008, 01:43:40 PM
Nope, aliases really don't accomplish anything other than group together commands for convenience's sake.
Title: Re: Multiple Binds
Post by: {appy Hamper on October 14, 2008, 02:33:12 PM
"nope" what?

"nope," we don't need aliases?
"nope," we can't use "cmd;cmd;cmd..." in a single bind?
"nope," I'm not really on fire?
"nope," but I'll give you a $100?
...

I assume you're referring to the 1st answer, to which I say, "since when?!!" and "why didn't I know about this sooner?!!"  :o
Title: Re: Multiple Binds
Post by: Zorchenhimer on October 14, 2008, 02:35:45 PM
Haha, for +/- commands you might have to put a few "wait" commands in between there.
Title: Re: Multiple Binds
Post by: jitspoe on October 14, 2008, 05:32:37 PM
Nope, aliases really don't accomplish anything other than group together commands for convenience's sake.
Try writing a crouch toggle bind without aliases. :)
Title: Re: Multiple Binds
Post by: Eiii on October 14, 2008, 07:19:42 PM
"nope" what?

"nope," we don't need aliases?
"nope," we can't use "cmd;cmd;cmd..." in a single bind?
"nope," I'm not really on fire?
"nope," but I'll give you a $100?
...

I assume you're referring to the 1st answer, to which I say, "since when?!!" and "why didn't I know about this sooner?!!"  :o
Nope, you don't need aliases to stick multiple cmds in a bind. As jits points out, though, aliases can be pretty useful for rebinding and such. :P

Feel free to do 'bind mouse2 "+moveup;say Jump!", though. When I just tested this, though, it appends some numbers to the end of what you say... >.>
Title: Re: Multiple Binds
Post by: jitspoe on October 14, 2008, 09:43:14 PM
Feel free to do 'bind mouse2 "+moveup;say Jump!", though. When I just tested this, though, it appends some numbers to the end of what you say... >.>

Ugh, I thought I fixed that!

Edit: Interesting...

Code: [Select]
if (kb[0] == '+')
{ // button commands add keynum and time as a parm
Com_sprintf(cmd, sizeof(cmd), "%s %i %i\n", kb, key, time);
Cbuf_AddText(cmd);
}

I don't think anything even uses that.  Wonder if it's safe to remove it.

Edit: It's not.

You can work around this easily enough with an alias:

alias +jump "+moveup;say Jump!"
alias -jump "-moveup"
bind mouse2 "+jump"

Put a feature vote up for it if you want it fixed.  Turns out it isn't as trivial as I thought it would be to fix.
Title: Re: Multiple Binds
Post by: WARNER on October 25, 2008, 05:48:36 PM
some on said that you can have multipple name binds on one key. is it possible? can you telll me how if it is? it would be really helpful. im kind of a newb at these things... ;D
Title: Re: Multiple Binds
Post by: zimtstern on October 25, 2008, 06:02:07 PM
bind "F8" "switchname1"
alias switchname1 "name YOURNAMEHERE; bind F8 switchname2; echo YOURNAMEHERE"
alias switchname2 "name 1YOURNAMEHERE; bind F8 switchname3; echo 1YOURNAMEHERE"
alias switchname3 "name 2YOURNAMEHERE; bind F8 switchname4; echo 2YOURNAMEHERE"
alias switchname4 "name 3YOURNAMEHERE; bind F8 switchname1; echo 3YOURNAMEHERE"
Title: Re: Multiple Binds
Post by: sk89q on October 25, 2008, 11:04:48 PM
bind space +moveup
bind f +moveup

They won't undo each other.