Binding Keys

NSGShuggarNSGShuggar 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.

Comments

  • AcrylicAcrylic Join Date: 2002-11-03 Member: 6400Members, Constellation, NS2 Playtester, Reinforced - Supporter, Reinforced - Shadow
    What you see in cs is the commandmenu, and that is not available in ns, but you could probably do the same thing with echo's.

    <!--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.
  • romanoromano Join Date: 2002-11-02 Member: 4296Members
    Commandmenu works fine in NS.

    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--> .
  • XodlikeXodlike Join Date: 2003-06-03 Member: 16985Members
    some people who haev played cs (who hasnt) have seen the little message when you connect to the server,no i am not talking about the console motd but the little box with the button ok in it. i have managed to seen amx plugins that try to reproduce this but whenever i try it in ns my mouse seems to dissapear and than it starts happening to everyone who joins the server.
    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.
  • HEAD-d_bHEAD-d_b Join Date: 2003-08-15 Member: 19742Members
    <!--QuoteBegin--Acrylic+Aug 17 2003, 04:15 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Acrylic @ Aug 17 2003, 04:15 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> alias rebindk "bind 1 slot1; bind 2 slot2; bind 3 slot3; bind 4 slot4; bind 5 slot5; bind 6 slot6; bind 0 slot10"
    <!--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
  • MrKNifeyMrKNifey Join Date: 2003-06-25 Member: 17668Members
    Window with button thing when you join server in CS is the Half-Life VGUI. They decided not to use it that much in NS, simply because it places you outside the game. Also, the current version of the VGUI sucks because it has lots of glitches, and the new version which was released on Steam with CS 1.6(which also sucks IMHO) is much less buggy, but you HAVE to use Steam to get it.
  • MausMaus Join Date: 2002-11-03 Member: 5599Members
    Here's my old commandmenu.txt - you should be able to see easily how to edit it to what you want.

    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>.
  • GoobagGoobag Join Date: 2003-05-18 Member: 16437Members, Constellation
    An example of one way to make the binded menu(s):
    <a href='http://www.cs.ucr.edu/~huangj/goomenu.rar' target='_blank'>Goomenu</a>
  • XodlikeXodlike Join Date: 2003-06-03 Member: 16985Members
    edited August 2003
    sry but i got to admin my GUI menu is well kinda better..... <!--emo&::lerk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/lerk.gif' border='0' style='vertical-align:middle' alt='lerk.gif'><!--endemo-->

    /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
  • HEAD-d_bHEAD-d_b Join Date: 2003-08-15 Member: 19742Members
    anyone managed to get the commandmenu working in 2.0

    works perfect in the RR but in game it does not expand
  • EKSEKS Join Date: 2002-11-01 Member: 2790Members
    You cant use your mouse on the command menu in NS 2.0 ( You can buts its complex to get it working )

    You have to use the keyboard clicking on the numbers.
Sign In or Register to comment.