Tremulous Forum

Mods => Modding Center => Topic started by: UniqPhoeniX on November 23, 2007, 09:40:24 am

Title: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on November 23, 2007, 09:40:24 am
Is it possible to bind key combinations? Like shift+Q or CTRL+1?
Title: Re: How to bind key combinations?
Post by: next_ghost on November 23, 2007, 01:23:10 pm
No. Ctrl, Alt and Shift are bindable keys, not key modifiers.
Title: Re: How to bind key combinations?
Post by: UniqPhoeniX on November 24, 2007, 05:54:27 pm
What about making holding a button use a different .cfg?
About using binds to change name, is it possible to use 2 buttons to scroll between names, and 3rd button activating it? Without spamming the server?
Besides "echo", is there another command to show a message on screen, but so that it doesn't show in console?

EDIT: Is it possible to bind a key to just enter text into "say" or "say_team"?
Would this work?
set name1 "echo ^2***^5name1^2***;bind 1 name name1;bind 2 vstr name2;bind 3 vstr name4"
set name2 "echo ^2***^5name2^2***;bind 1 name name2;bind 2 vstr name3;bind 3 vstr name1"
set name3 "echo ^2***^5name3^2***;bind 1 name name3;bind 2 vstr name4;bind 3 vstr name2"
set name4 "echo ^2***^5name4^2***;bind 1 name name4;bind 2 vstr name1;bind 3 vstr name3"
vstr name1
Title: Re: How to bind key combinations? + Some other questions
Post by: Caveman on November 25, 2007, 03:00:12 am
set name1 "echo ^2***^5name1^2***";bind 1 name name1;bind 2 vstr name2;bind 3 vstr name4

just set the quotes in the right place and you are set.
But remember there are loads of servers out there that will kick you if you change your name to often and/or to fast.
Title: Re: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on November 25, 2007, 02:57:39 pm
Well this way I can change name just once after I have chosen the right one.
Title: Re: How to bind key combinations? + Some other questions
Post by: /dev/humancontroller on November 25, 2007, 03:06:05 pm
Hmm. I'll think about coding support for such bindings. Don't try to beat me :)
Title: Re: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on November 25, 2007, 04:45:48 pm
Wait... why do the quotes have to be like that?
Oh and: Besides "echo", is there another command to show a message on screen, but so that it doesn't show in console?
Title: Re: How to bind key combinations? + Some other questions
Post by: Caveman on November 25, 2007, 05:36:27 pm
You seem to lack the basics of scripting and binds. Please use google to remedy that.
Title: Re: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on November 25, 2007, 06:09:51 pm
I use this for builder binds and it works:
Code: [Select]
set abuild1 "echo ^2***^5Overmind^2***; build overmind; bind RIGHTARROW vstr abuild2;bind LEFTARROW vstr abuild8"
set abuild2 "echo ^2***^5Eggpod^2***;   build eggpod;   bind RIGHTARROW vstr abuild3;bind LEFTARROW vstr abuild1"
set abuild3 "echo ^2***^5Acib Tube^2***;build acid_tube;bind RIGHTARROW vstr abuild4;bind LEFTARROW vstr abuild2"
set abuild4 "echo ^2***^5Barricade^2***;build barricade;bind RIGHTARROW vstr abuild5;bind LEFTARROW vstr abuild3"
set abuild5 "echo ^2***^5Trapper^2***;  build trapper;  bind RIGHTARROW vstr abuild6;bind LEFTARROW vstr abuild4"
set abuild6 "echo ^2***^5Booster^2***;  build booster;  bind RIGHTARROW vstr abuild7;bind LEFTARROW vstr abuild5"
set abuild7 "echo ^2***^5Hive^2***;     build hive;     bind RIGHTARROW vstr abuild8;bind LEFTARROW vstr abuild6"
set abuild8 "echo ^2***^5Hovel^2***;    build hovel;    bind RIGHTARROW vstr abuild1;bind LEFTARROW vstr abuild7"
vstr abuild2

Shouldn't quotes be around everything executed if you want to exec more then 1 command/subcommand, or to pass marks like ";" [space] and other commands without execing like: echo "bind 3 buy larmour"?
Title: Re: How to bind key combinations? + Some other questions
Post by: Eli on November 25, 2007, 09:08:53 pm
Try THIS (http://cebt.s4.bizhat.com/viewtopic.php?t=198&highlight=binds&mforum=cebt)


^^ Made by (Cebt)s Very own cheerleader, enjoy em =P they pwn you all xD
Title: Re: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on December 12, 2007, 03:15:29 pm
How to use center print (cp)? it doesnt seem to work
Title: Re: How to bind key combinations? + Some other questions
Post by: Eli on December 16, 2007, 04:47:59 am
It doesn't Well at least not in binds... I wanted to use it too, but couldn't.

Just use 'Echo'
Title: Re: How to bind key combinations? + Some other questions
Post by: daenyth on December 16, 2007, 01:11:13 pm
On a side note, does anyone know why it doesn't work in binds? Is it reserved for only servers?
Title: Re: How to bind key combinations? + Some other questions
Post by: Death On Ice on December 16, 2007, 08:17:56 pm
A client side version of cp (center print) would be ninja.
Title: Re: How to bind key combinations? + Some other questions
Post by: Matt2k10 on December 24, 2007, 07:17:40 pm
Is it possible to bind key combinations? Like shift+Q or CTRL+1?

Put this in a .cfg file named shift+.cfg:
Code: [Select]
seta shift1 "exec shift2.cfg"
bind [key] "[old bind]"
bind shift "vstr shift1"

Put this in a .cfg file named shift2.cfg:
Code: [Select]
seta shift2 "exec shift+.cfg"
bind [key] "[new bind];vstr shift2"
bind shift "vstr shift2"

Replace the brackets etc with the stuff you want, and repeat for however many keys you want. Pressing shift again cancels it. Doesn't work perfectly, but it works.
Title: Re: How to bind key combinations? + Some other questions
Post by: UniqPhoeniX on December 24, 2007, 11:13:05 pm
I know that stuff, but its not quite as good. I am making a huge set of binds that way.
Just 1 thing: whats the difference between set and seta?
Title: Re: How to bind key combinations? + Some other questions
Post by: kevlarman on December 24, 2007, 11:33:17 pm
for the purpose you're using them, absolutely none.