Scripting: Whats Wrong With What Ive Done?

VisserVisser Join Date: 2002-11-03 Member: 6613Members
edited December 2002 in NS General Discussion
<div class="IPBDescription">Need helping fixing com script.</div> What im attempting to write here is a little complx. Im aiming for two things: 1st, i am making the same 4 by 3 set of keys the buttons for ALL of the comm commands. By pressing f,g,h it unbinds the keys im using (i,o,p,[,j,k,l,;,n,m), switches to the right menu (basic advanced equipment), and rebinds all the keys to be the right item accoding to how they are placed in the grid square you click. (EG res node is top left on basic tab - i hit f for basic then press i (top left in my layout) and then place it down). Anyone who has played the RTS game strifeshadow knows what i mean. THe other thing i am aiming for (which is made a lot easier by this last part) is to not have to constantly switch cfgs - i have movment on the left half of keyboard, and radio, alien morphs/upgrades all around the side and on keypad.

The script is these lines pasted in the bottom of my config.cfg file. Note the enter bind (alias HP) is an emergancy medpack button. I press it and it switches to equip menu puts a medpack on my cursor.

<!--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-->alias HP "hotkey88;hotkey59"
alias basic "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;hotkey86;bind i

hotkey41;bind k hotkey56;bind o hotkey40;bind p hotkey48;bind j hotkey43;bind l hotkey57;bind n hotkey58"
alias advanced "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;hotkey87;bind i

hotkey51;bind o hotkey45;bind p hotkey46;bind [ hotkey55"
alias equip "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;hotkey88;bind o

hotkey59;bind i hotkey60;bind p hotkey61;bind j hotkey62;bind k hotkey64;bind l hotkey65;bind , hotkey66;bind m hotkey39;bind

n hotkey38"
bind "enter" "HP"
bind f basic
bind g advanced
bind h equip<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

None of these work in a live game on the net. All my other things work except f2 bound to carapace doesnt work while f3 adren and f4 cloak work fine.

EDIT: replaced script with better version, (not really). When i press f or h, the console tells me basic/equip is an invalid command. The various keys are bound to the keys set out by the "advanced" alias

EDIT2:after redoing the way the script ran as told below, it works SLIGHTLY more. When i press f/g/h it tells me hotkey 87/8/9 is invalid. When i press enter for medkit it tells me hotkey59 is unknown.

Comments

  • CilraisCilrais Join Date: 2002-11-29 Member: 10264Members
  • PseudoKnightPseudoKnight Join Date: 2002-06-18 Member: 791Members
    If you put stuff like that in the config file, HL is just going to overwrite it. Put it into comm.cfg or something and execute it by program shortcut or in the console.
  • Dauntl3ssDauntl3ss Join Date: 2002-11-08 Member: 7737Members
    edited December 2002
    and use that in <!--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-->CODE<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    Take a look what i've done in my little script, thou i aint got aliases for everything.. (in my sig)
  • VisserVisser Join Date: 2002-11-03 Member: 6613Members
    edited December 2002
    PseudoKnight what you said helped but its not fixed as i explained in my edit above.

    Dauntl3ss there are many scripts like yours, i already have a few i could have used if i wanted. But i am trying to make my own more advanced thing.
  • HoMIciDaL_PuPPyHoMIciDaL_PuPPy Join Date: 2002-11-27 Member: 10091Members
    u can put it in yer config u just have to then make your config READ ONLY
  • nthingnthing Join Date: 2002-11-01 Member: 3091Members
    I've just worked out your script and it's pretty well written and don't see any reason why it shouldn't be working if those hotkey numbers are the right ones to do the things you want to achive...

    BTW, you don't have to unbind the keys before you bind them to new ones, so you can take the unbinds out... they arn't really nessaserry...

    I have noticed however that the hotkeys dont work on my machine at all... at least, the one's I've tried... they just say 'hotkey<#> is not a recognised command' or something like that, so maybe the NS team havn't impletemented these commands yet, just as they hadn't previously impletemented lastinv ect... <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' valign='absmiddle' alt='confused.gif'><!--endemo--> just a theory
  • EzekielEzekiel Join Date: 2002-11-01 Member: 3006Members
    edited December 2002
    you cant bind f1 and f2 atm because hl has 'reserved' em. there is a way around it but i cant remember, go look for it.
  • nthingnthing Join Date: 2002-11-01 Member: 3091Members
    edited December 2002
    <!--QuoteBegin--Ezekiel+Dec 3 2002, 06:46 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Ezekiel @ Dec 3 2002, 06:46 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->you cant bind f1 and f2 atm because hl has 'reserved' em. there is a way around it but i cant remember, go look for it.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    you have to delete or rename the <b>'GameUI.dll'</b> in <b>'.../valve/cl_dlls'</b>

    But really that has nothing to do with anything as neither F1 or F2 are being bound by this script...
  • ShingyBoyShingyBoy Join Date: 2002-11-17 Member: 9086Members
    <!--QuoteBegin--Cilrais+Dec 2 2002, 11:34 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Cilrais @ Dec 2 2002, 11:34 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->my head hurts.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Omg the spam <!--emo&:angry:--><img src='http://www.unknownworlds.com/forums/html/emoticons/mad.gif' border='0' valign='absmiddle' alt='mad.gif'><!--endemo-->
  • ElricElric Join Date: 2002-11-13 Member: 8448Members
    The problem is that you can't issue anything but the hotkey command in one line. It also has to be bound, if you just type it in the console or leave it as a command itself in the config, it won't execute. As far as anyone has been able to do, you have to use the button once to rebind everything and then at the end, bind the hotkey button to the same button. Push it twice. Sorry.
  • VisserVisser Join Date: 2002-11-03 Member: 6613Members
    Elric has something like that in the back of my mind.. that must be it.

    However i never got exactly what people mean to setup the push it twice thing.

    Can someone do a quick example to show me

    @whoever: the unbinds are there for tidyness as far as the end user is concerned. Pressing keys that are no longer valid for that command tab wont give you an error/that annoying beep kinda noise.
  • TacoSupremeTacoSupreme Join Date: 2002-11-01 Member: 2562Members
    The below code should work for you, but of course you need to hit the key twice.


    <!--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-->//..::This line below will not work, hotkeys only work if bound to a key::..
    alias HP "hotkey88;hotkey59"

    //..::The hit the button twice fix will work because with the first click it binds all the necessary keys, and with the second click it switches menus::..
    alias basic "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;bind f hotkey86;bind g advanced; bind h equip;bind i hotkey41;bind k hotkey56;bind o hotkey40;bind p hotkey48;bind j hotkey43;bind l hotkey57;bind n hotkey58"

    alias advanced "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;bind g hotkey87;bind f basic;bind h equip;bind i hotkey51;bind o hotkey45;bind p hotkey46;bind [ hotkey55"

    alias equip "unbind i;unbind o;unbind p;unbind [;unbind j;unbind k;unbind l;unbind ,;unbind n;unbind m;bind h hotkey88;bind f basic; bind f advanced;bind o hotkey59;bind i hotkey60;bind p hotkey61;bind j hotkey62;bind k hotkey64;bind l hotkey65;bind , hotkey66;bind m hotkey39;bind n hotkey38"

    bind "enter" "HP"
    bind f basic
    bind g advanced
    bind h equip<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • nthingnthing Join Date: 2002-11-01 Member: 3091Members
    <!--QuoteBegin--Visser+Dec 3 2002, 07:37 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Visser @ Dec 3 2002, 07:37 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->@whoever: the unbinds are there for tidyness as far as the end user is concerned. Pressing keys that are no longer valid for that command tab wont give you an error/that annoying beep kinda noise.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    oh, of course... good point... for like the advanced menu where there are only like 4 options?
  • BridgerBridger Join Date: 2002-10-30 Member: 1761Members
    i wish they'd used meaningful names. What the hell is "hotkey88"? Can't they just call it "jetpack" or "buy_ha" or "place_hmg"

    One of the first things you learn in programming class is to use meaningful names....
  • Rabid_LlamaRabid_Llama Join Date: 2002-11-02 Member: 4340Members
    Yes, the deal with hotkeys is that
    1) they have to be bound to a key to work, you can't execute them from aliases or cfgs
    and
    2) you have to be in the right commander menu to place an item (Equip for Medpacks, for example)

    those two combined mean that your commander script, while a great idea, simply won't work <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
  • DraugluinDraugluin Join Date: 2002-10-31 Member: 1824Members, Constellation
    Also when binding a hotkey## to a key, you can only bind one. This was stated earlier up but I just wanted to reiterate.

    bind <key> hotkey<##>

    Can't get any more special than that with hotkeys.
Sign In or Register to comment.