Binding Keys
NSGShuggar
Join Date: 2003-08-17 Member: 19872Members
<div class="IPBDescription">need help!</div> How can I make it so that when I press a single key, a text menu will pop up with numbers. If I press one of the numbers on the menu, then I will say a command.
This is kind of like in CS, when you press "b" a text or graphical menu will come up with a bunch of choices.
This will make it so that I don't have to use up every key on
the keyboard for commands, and so I can bind more messages for easy use in the heat
of battle. This is EXTREMELY useful. Please respond if you have an answer, or have anything
at all constructive to say
Below is an example of a cycling script that doesn't seem to work for NS. If you can tell me
why, that would also help. Basically, when you press h, you have an option of 6 things you
can say.
//Autotaunt #2
alias taunt1 "say : Game Over!; bind h taunt2"
alias taunt2 "say : Thats what you get for being in the wrong place at the wrong time.; bind h taunt3"
alias taunt3 "say : Hear that? That's the sound of you dying.; bind h taunt4"
alias taunt4 "say : Hurry up and Respawn so I can kill you again!; bind h taunt5"
alias taunt5 "say : Was it as good for you as it was for me?; bind h taunt6"
alias taunt6 "say : Next time, just run away.; bind h taunt1"
bind h taunt1
thanks for reading this.
This is kind of like in CS, when you press "b" a text or graphical menu will come up with a bunch of choices.
This will make it so that I don't have to use up every key on
the keyboard for commands, and so I can bind more messages for easy use in the heat
of battle. This is EXTREMELY useful. Please respond if you have an answer, or have anything
at all constructive to say
Below is an example of a cycling script that doesn't seem to work for NS. If you can tell me
why, that would also help. Basically, when you press h, you have an option of 6 things you
can say.
//Autotaunt #2
alias taunt1 "say : Game Over!; bind h taunt2"
alias taunt2 "say : Thats what you get for being in the wrong place at the wrong time.; bind h taunt3"
alias taunt3 "say : Hear that? That's the sound of you dying.; bind h taunt4"
alias taunt4 "say : Hurry up and Respawn so I can kill you again!; bind h taunt5"
alias taunt5 "say : Was it as good for you as it was for me?; bind h taunt6"
alias taunt6 "say : Next time, just run away.; bind h taunt1"
bind h taunt1
thanks for reading this.
Comments
<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->Make a new file in your ns directory called taunt.cfg, in that file put this:
//Autotaunt #2
alias w "wait"
alias mw "w; w"
alias lw "mw; mw; mw"
alias d1 "developer 1"
alias d0 "developer 0"
contimes 27
//Echo
d1
echo "[- 1. : Game Over!"
echo "[- 2. : Thats what you get for being in the wrong place at the wrong time."
echo "[- 3. : Hear that? That's the sound of you dying."
echo "[- 4. : Hurry up and Respawn so I can kill you again!"
echo "[- 5. : Was it as good for you as it was for me?"
echo "[- 6. : Next time, just run away."
echo "[- 0. : Exit Menu"
d0
//Binds Alias's
bind "1" "taunt1; lw; rebindk"
bind "2" "taunt2; lw; rebindk"
bind "3" "taunt3; lw; rebindk"
bind "4" "taunt4; lw; rebindk"
bind "5" "taunt5; lw; rebindk"
bind "6" "taunt6; lw; rebindk"
bind "0" "contimes 0; rebindk; contimes 27"
alias taunt1 "say : Game Over!"
alias taunt2 "say : Thats what you get for being in the wrong place at the wrong time."
alias taunt3 "say : Hear that? That's the sound of you dying."
alias taunt4 "say : Hurry up and Respawn so I can kill you again!"
alias taunt5 "say : Was it as good for you as it was for me?"
alias taunt6 "say : Next time, just run away."
alias rebindk "bind 1 slot1; bind 2 slot2; bind 3 slot3; bind 4 slot4; bind 5 slot5; bind 6 slot6; bind 0 slot10"
Now in your config.cfg put this:
bind "o" "exec taunt.cfg"<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
This works, I tryed it, its not the best way but it works.
As for getting your cycling script to work.. no idea <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo--> .
Solution:get rid of the AMX plugin <!--emo&::nerdy::--><img src='http://www.unknownworlds.com/forums/html/emoticons/nerd.gif' border='0' style='vertical-align:middle' alt='nerd.gif'><!--endemo--> now here i am posting on ns forums how to make it so it would be like in cs where you click on that ok.
Wow i finnally used a little bit of punctuation and a seconds paragraph yay.
<!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
its not a good habit scripting with binds, allias them and keep all your binds in the config.cfg
You'll also need something like <b>alias +cmenu "toggleeditps;+commandmenu"</b> in your autoexec, and of course a key bound to <b>cmenu</b>.
<a href='http://www.cs.ucr.edu/~huangj/goomenu.rar' target='_blank'>Goomenu</a>
/edit
i dont know why aliases are better than binds in simple evolution which can just be binded to its impulse but those more complicated binds such as what was a very good thing in ns 1.04:
alias screenshot "r_drawviewmodel 0;r_drawcrosshair 0;snapshot;r_drawviewmodel 1;r_drawcrosshair 1"
but u cant use this in ns 2.0
works perfect in the RR but in game it does not expand
You have to use the keyboard clicking on the numbers.