Ns Scripting /binds

hidden_snperhidden_snper Join Date: 2004-03-18 Member: 27412Members
<div class="IPBDescription">HowTo needed</div> I have been playing ns for a little while now and I really love the game. Recently I heard that you can make scripts that allow quick sets of actions such as leap bite or crouch toggle or autoswitch. Could someone please post or give me a link to a beginners guide to making scripts /binds? I have programming experience in C, C++, VB, and HTML so I can quickly pick up basic syntax. I really need to know what all the command names are for the engine and such.

Thanks ahead of time.
«1

Comments

  • Renegade.Renegade. Join Date: 2003-01-15 Member: 12313Members, Constellation
    Actually you'll be happy to hear making binds in HL/NS are no where near as complex with syntax as C++ and other programming languages. THis is because when you make a bind in HL you are not actually changing/using HL's core variables, instead you are altering variables made by HL as pointers to other encoded variables. In other words HL has created a set of variables and commands for the sole purpose of being altered by the user.
    I.E:
    HL engine code may look like this:
    if (draw_hud ==1){
    double draw_single_hud = 1}

    BUT the player does not directly deal with such code, instead what you deal with looks liek this:
    draw_hud 1

    These simplified variables/commands makes it easy to script in HL. Here is a sample that I would make for your auto-crouch and auto-leap-bite:

    Toggle Crouch:
    alias crouch off
    alias on "+duck; alias crouch off"
    alias oof "-duck; alias crouch on"

    Auto Leap-Bite
    bind SPACE "slot3; +attack; wait; slot1; wait; wait; wait; wait; wait; +attack; wait; wiat; -attack"

    The first one uses an "alias", which you may look up on any HL site, the second uses your basic bind. As you will notice none of these resembles any kind of C++ coding, but yet is still easier to catch on to. It almost reads like very bad english, or a good pseudocode.
  • Robert_PaulsonRobert_Paulson Join Date: 2003-07-29 Member: 18543Members
    If you are interested in scripting I would go take a look at some CS scripts.

    There are several thousand out there, and they will teach you the basics.

    As far as a scripting community, NS < CS, and a lot of people that belong to this fine community don't like scripts...I on the other hand don't see a problem with them.

    If you have any questions on any scripts post them here, there are a few of us that are old hats at that type of stuff....
  • ZunniZunni The best thing to happen to I&amp;S in a long while Join Date: 2002-11-26 Member: 10016Members
    Mr. Paulson is correct, this community has some issues with scripting..

    Be warned however that scripting things like leap-bite, and blink-swipe actually hinder your effectiveness at these tasks, you cannot stop your blink/leap early to swipe/bite using a script or the reverse is also true..

    My suggestion is to keep scripting for certain tasks that are not "skill" based and just spend some time on small servers to learn the timing of when to leap/bite etc...

    There are many topics in the general discussion forum on variables needed to allow you to effectively leap/bite etc....
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Toggle Crouch:
    alias crouch off
    alias on "+duck; alias crouch off"
    alias oof "-duck; alias crouch on"

    Auto Leap-Bite
    bind SPACE "slot3; +attack; wait; slot1; wait; wait; wait; wait; wait; +attack; wait; wiat; -attack"
    <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Both hinder mobillity alot. It would not even help newbies to use these as they would never learn and the disadvantage of not being able to wait before biting is HUGE.

    The basic syntax for binding a command to a key is
    bind keyname commandstring. bind is just a keyword that makes the engine realize that you want to attach a command to a button, keyname is just the name of the key(e.g. p, q, shift, tab, kp_ins(key pad insert key) or mouse1). commandstring is a string of commands separated by ; and contained withing qoutation marks(e.g. "+showscores;wait;net_graph 3;wait" ). You don't need quotation marks if your just passing along a command.

    Commands can be aliases(which are user defined strings of commands) or commands made available to the player by the MOD makers.

    Commands are of 3 types, those that are preceded by a sign and those that are not as well as those that are not preceded by a sign and take an argument. Commands that are preceded by a sign such as +jump are activated when the + command is executed and turned of when the -command is executed. If you only bind a + command to a key it will automatically execute the -command when you let up the key. The most important such commands are +attack, +jump, +duck, +forward, +backwards, +moveleft (?), and +moveright(?). If you bind more than one command to a key in conjunction with a + command the - command will NOT be executed when you let up the key(to do so you need to use and alias which can also define + and - commands).

    Commands that take an argument are of the form "command argument"(e.g. net_graph 1 (turn on the net graph), gl_texturemode gl_linear_mipmap_linear (use trilinear filtering) and sv_cheats 1(turns on cheats(mostly for developers) if you are an admin)).

    Aliases take the form, alias commandname commandstring. What it does is tell the engine to make a user defined command named commandname(this can be a +, - and normal command but an alias cannot take a variable). The command string is just as before a string of other commands and aliases. (don't bother trying this: alias command1 command2
    alias command2 command1 <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->)

    Aliases and commands can be executed or created directly from the console but for aliases to be loaded on startup of the game you need to make or modify autoexec.cfg or userconfig.cfg(or any other name.cfg text file but then you have to put "exec name.cfg" in your config, execute the file from your console while ingame in the same way or bind "exec name.cfg" to a button(e.g. bind pgup "alien.cfg", bind kp_plus "low_ping_config.cfg")). In these files you simply make a list of aliases, commands to be executed, binds to be made etc. Empty lines or lines begun with // are ignored without giving you an error in the console.

    to make a + or - alias simply do something like
    alias +show_net_score "+showscores;wait;net_graph 3;wait"
    alias -show_net_score "-showscores;wait;net_graph 0;wait" (is it showscores?).

    You are much better off setting things up so that you can easily switch to whatever weapon you wan't to use, very quickly and manually instead of trying to script some leap and bite thing(there is a reason skilled players don't use them, and it's not because they think it is an unfair advantage <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html//emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /><!--endemo-->).

    For a >2 button with a mouse wheel you can do something like this:

    bind mouse1 "+attack"
    bind mouse2 "slot1"
    bind mouse4 "slot2"
    bind mwheeldown "slot3"
    bind mwheelup "slot4"

    As well as turning on hud_fastswitch 1.

    (mouse3 is typically the very inconvenient "button" that you activate by pressing the mouse wheel straight down).

    If you only have 2 buttons and a mouse wheel you can use a quickly reached button on your keyboard for switching to the least common slot(in my, and most peoples case that would be slot 4).

    I see a lot of people(including myself) getting accused of cheating(even on C-D servers) because they can properly select any weapon they want to use very quickly as well as having mastered basic movement(strafe turning, the usage of blink and leap and to a lesser extent bunny hopping). It's funny, but I have never been accused of cheating by a vet or claner allthough I see them hanging around all the time on C-D servers and they <i>should</i> be better at recognizing a cheater than a frustrated newbie.

    Strafe turning: it is a necessity, I would say it is probably the most important skill in combat as both marines and aliens. Allthough it has nothing to do with scripting it is a "must know" as it makes you about 10 times as effective with leap and blink and is so easy anyone can do it. blink, leap or jump and then let go of forward and press strafe in the direction you want to turn and move your mouse in that direction. You will turn in the air and even gain some speed if you don't turn to fast(if ducking you can't turn as fast unless you are gorge or skulk). This offers you much agillity when leaping, blinking after a moving target and is the basis for bunnyhopping if you care to learn that as well.

    Bunny hopping: strafe turn while you are in the air and then jump as soon as you land to avoid friction. There are scripts to help lessen the burden of strict timing but they more hinder you from learning how to do it without scripts than help you while you are learning.

    The most innofencive of these(a bunch of people consider these types of scripts an illegitimite advantage allthough alot of people use them as well as being allowed in a few forms in many leagues which if anything should have stricter requirements than public servers on what you can and cannot do) would be to simply bind +jump to the mouse wheel and pull the mouse wheel quickly slightly before you land. The slighlty less offencive alternative(which is about as simple as using the mousewheel and is allowed in most leagues(for NS, not necessarilly other MODs)) is to do something like this:

    alias +3jumps "+jump;wait;-jump;wait;+jump;wait;-jump;wait;+jump"
    alias -3jumps "wait;-jump"

    For lerks(which would have quirky movement with a jump script such as that)

    bind anykey 3jump_on
    alias 3jump_on "bind jumpkey +3jumps;bind anykey 3jump_off"
    alias 3jump_off "bind jumpkey +jump;bind anykey 3jump_on"

    If you use such a script you will never get a good timing on when you are supposed to jump without any script, in fact you would learn to jump slightly to early and consistently miss when you don't use such a script. Allthough many leagues would allow such a jump script as that above they, by common convention, allow only 3 jump commands in a row executed at one keypress.

    Allthough legitimacy of such scripting is debatable it is used by many people and anyone should at least get to know about the issues instead of brushing them under the rugg and pretending there is no issue. Make up your own mind on this issue and if you feel strongly about it's formal removal from the game post in suggestions and ideas or one of the(no doubt existing) threads on the subject.

    One of the most difficult aspects of bunnyhopping is avoiding or handling objects in the map that come in your way(strairs, rails, slopes), no amount of scripting will ever remove that.

    Personally I don't think scripting is good for much with few exceptions and for "comfort"(show scores and net graph at once, quickly switch between a few client settings to suit network conditions with the press of a button, toggle the volume up and down without having to reach for the knob on the speaker, )

    Setting up your binds properly is a huge advantage. Evolutions(impulse commands), building chambers(impulse commands), comfortably switching between weapons(slot# commands), sayings(impulse commands), a comfy setup with lots of buttons close to your strafe keys(e.g. wasd or esdf(my favorite) as movement keys).

    Some impulse commands(the once specific for combat missing):

    marine/alien meaning. numbers must be preceded by impulse and a space.

    1 Next Weapon -
    3 Drop Weapon -
    5 Ready Room
    7 Follow Me/Chuckle
    8 Covering/Need Healing
    9 Taunt/Need Backup
    10 Need Health/Incoming
    11 Need Ammo/Attack
    12 In Position/I'm Building Here
    13 Enemy Here/ -
    14 Move Out/ -
    15 All Clear/ -
    80 Need Order/ -
    81 Acknowledge/ -
    90 -/ Build Resource Tower
    91 -/ Build Offence Chamber
    92 -/ Build Defence Chamber
    93 -/ Build Sensory Chamber
    94 -/ Build Movement Tower
    95 -/ Build Hive
    100 flashlight/"alien flashlight"
    101 -/ Upgrade: Carapace
    102 -/ Upgrade: Regeneration
    103 -/ Upgrade: Redemption
    107 -/ Upgrade: Celerity
    108 -/ Upgrade: Adrenaline
    109 -/ Upgrade: Silence
    110 -/ Upgrade: Cloak
    111 -/ Upgrade: Scent of Fear
    112 -/ Upgrade: Enhanced Sight
    201 Spray Logo
  • CabooseCaboose title = name(self, handle) Join Date: 2003-02-15 Member: 13597Members, Constellation
    <!--QuoteBegin-Zunni+Mar 22 2004, 08:17 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Zunni @ Mar 22 2004, 08:17 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Be warned however that scripting things like leap-bite, and blink-swipe actually hinder your effectiveness at these tasks, you cannot stop your blink/leap early to swipe/bite using a script or the reverse is also true.. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Actually, if you have a script that uses a press and release to quickly switch between two attacks (leap and bute, blink and swipe) it can be verry effective.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias +release "+attack; -attack"
    alias +leapswitch "weapon_leap"
    alias -leapswitch "+release; lastinv"
    bind MOUSE2 +leapswitch<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    or

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias +release "+attack; -attack"
    alias +blinkswitch "weapon_blink"
    alias -blinkswitch "+release; lastinv"
    bind MOUSE2 +blinkswitch<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    Both of which are very effective if you give them some practice.

    Theese work because I have the popup menu bound to z, so I can use mouse2 to controll my movement. I can leap, release leap and bite/xeno (whatever last attack was) a lot more effectivly than manually switching weapons and with only one click of the button.

    Now, I know that similar results can be done with binding lastinv to MOUSE2, but you would have to click twice and the scripts make the press and release.

    Attached is a tutorial about scripting, it is really helpfull. In it is a list of all the keys names also, that in itself is verry usefull.
  • hidden_snperhidden_snper Join Date: 2004-03-18 Member: 27412Members
    Thanks alot that was really helpful. I was hearing alot about scripting and I wasn't sure what it could really do. One that I really really liked was a gorge script that put down o towers every few milliseconds so you could strafe across a door and plant 5 o towers or run in a line and do the same. Is it possible to make a script that will change to secondary gun if I am out of primary ammo? If so I would even like to extend that to knife if secondary is outta ammo too. Thanks again for all the help/ideas.
  • CabooseCaboose title = name(self, handle) Join Date: 2003-02-15 Member: 13597Members, Constellation
    yea, I use that too. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias +release "+attack; -attack"
    alias +pistolswitch "weapon_pistol"
    alias -pistolswitch "+release; lastinv"
    bind MOUSE2 +pistolswitch<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    That's a quick one, don't feel like making one that switches to knife after pistol is gone tho. I use it, and have gotten quite a few pistol kills since I started using it too. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    I do have an idea for a script like what you want, it's long and would be kind of annoying because it would auto switch after every round of ammo is depleted.
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    edited March 2004
    <!--QuoteBegin-hidden_sniper+Mar 22 2004, 12:49 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (hidden_sniper @ Mar 22 2004, 12:49 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I have been playing ns for a little while now and I really love the game. Recently I heard that you can make scripts that allow quick sets of actions such as leap bite or crouch toggle or autoswitch. Could someone please post or give me a link to a beginners guide to making scripts /binds? I have programming experience in C, C++, VB, and HTML so I can quickly pick up basic syntax. I really need to know what all the command names are for the engine and such.

    Thanks ahead of time. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    NS is built on Half-Life, so it uses Half-Life's scripting system. It's very primitive; it's basically nothing more than advanced control configuration. I learned HL scripting from <a href='http://half-life.pcgame.com/' target='_blank'>this</a> site. The site's a bit dated, but so it HL - nearly all of the info on that site is still current.

    [edit]Oh, and there's also <a href='http://www.unknownworlds.com/forums/index.php?showtopic=29827' target='_blank'>my console guide</a>, which may help.[/edit]
  • GeronimoGeronimo Join Date: 2002-12-18 Member: 11056Members
    I have never understoood the importance of scripting in NS. The menu works well with unusual commands and the others can eaily be used with the normal keys.
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    <!--QuoteBegin-Geronimo+Mar 23 2004, 07:26 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Geronimo @ Mar 23 2004, 07:26 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I have never understoood the importance of scripting in NS. The menu works well with unusual commands and the others can eaily be used with the normal keys. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Mostly it's a customisation issue. Console scripting lets you alter your inteface to suit your particlar tastes much more than the options menu. Things such as toggleing stuff that's meant to be held down (like crouching), comms scripts, in-game options tweaking, helpful scripts...

    It's by no means necessary. It's just a matter of personal taste.
  • Robert_PaulsonRobert_Paulson Join Date: 2003-07-29 Member: 18543Members
    One of my most used scripts in CS and I still use to this day, is the crouch jump script...

    With the press of my jump key I will crouch and jump at the same time so that I can get to those hard to reach places.

    Some may call this wrong, my response, I could do it without the script, it is just easier with.

    Soylent, is that a text file on your HDD, or were you bored... <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

    Very informative too.
  • InvaznInvazn Join Date: 2004-03-04 Member: 27142Members
    Is there a stop reload script? like just switchign to knife and back
  • e_Nadagaste_Nadagast Join Date: 2003-10-30 Member: 22149Members
    Robert Paulson, I really hope that nobody calls a duckjump script wrong... If they do, they should be shot <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html//emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /><!--endemo-->
  • UKchaosUKchaos Join Date: 2002-08-10 Member: 1132Members
    Its not wrong, but id probably look down one someone who needs to use them <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • BlueNovemberBlueNovember hax Join Date: 2003-02-28 Member: 14137Members, Constellation
    <!--QuoteBegin-UKchaos+Mar 24 2004, 08:16 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (UKchaos @ Mar 24 2004, 08:16 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Its not wrong, but id probably look down one someone who needs to use them <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    As he said, he does not need to use one, (I mean, who would?) it just makes things easier.

    Saying that though, you *could* aim, but an aimbot makes it easier.

    I 'spose there must be a cut-off point somewhere between the two.



    Soz to hijack, but as we are on scripting, can anyone tell me why this should crash ns when run?

    //Fade Blink swich (push the button switch from slot1 to slot2, and then again to go from slot2 to slot1)
    alias fadeblink "fadeblink1"
    alias fadeblink1 "slot2; wait; +attack; wait; -attack; alias fadeblink1 fadeblink2"
    alias fadeblink2 "slot1; wait; +attack; wait; -attack; alias fadeblink2 fadeblink1"
    bind "mouse2" "fadeblink"

    <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->
  • MMZ_TorakMMZ_Torak Join Date: 2002-11-02 Member: 3770Members
    <!--QuoteBegin-BlueNovember+Mar 24 2004, 10:09 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (BlueNovember @ Mar 24 2004, 10:09 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Soz to hijack, but as we are on scripting, can anyone tell me why this should crash ns when run?

    //Fade Blink swich (push the button switch from slot1 to slot2, and then again to go from slot2 to slot1)
    alias fadeblink  "fadeblink1"
    alias fadeblink1 "slot2; wait; +attack; wait; -attack; alias fadeblink1 fadeblink2"
    alias fadeblink2 "slot1; wait; +attack; wait; -attack; alias fadeblink2 fadeblink1"
    bind "mouse2" "fadeblink"

    <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo--><!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Two things.
    <ul><li>the syntax for the alias looks wrong (alias fadeblink2 fadeblink1) It should be [alias [nameofalias] [command string], quotes never hurt.</li><li>I do not believe you can make an alias inside an alias</li></ul>
    If you are trying to make an alias for a key that changes between two functions, make the alias' seperately, try this:

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    alias fadeblink1 "slot2; wait; +attack; wait; -attack; bind [chosen key] fadeblink2"
    alias fadeblink2 "slot1; wait; +attack; wait; -attack; bind [chosen key] fadeblink1"
    bind [chosen key] fadeblink1
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • BlueNovemberBlueNovember hax Join Date: 2003-02-28 Member: 14137Members, Constellation
    Ah that's clever. I was re-aliasing instead of re-binding. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->

    I don't want the script to engage the weapons at anypoint; only switch between slot 1 and 2.

    Mouse 1 is +attack
    I want mouse 3 to toggle weapons 1/3 for skulk, and 1/2 for fade. I will do this by binding kp_plus to "exec fade.cfg" which brings up the above script, in replace of the skulk version that is default.

    Summary:
    Make a button toggle between two weapons
    So do I need "+attack" and "wait'" in the script?
  • MMZ_TorakMMZ_Torak Join Date: 2002-11-02 Member: 3770Members
    With "hud_fastswitch 1" enabled, you don't need the "+attack, -attack" in your config. So with that in mind:

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->

    alias weap1 "slot2; bind [chosen key] weap2"
    alias weap2 "slot1; bind [chosen key] weap1"
    bind [chosen key] "weap1"

    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • e_Nadagaste_Nadagast Join Date: 2003-10-30 Member: 22149Members
    just use lastinv stop dicking around with complicated blink/swipe or leap/bite scripts when it's so much easier and more effective to just type bind q lastinv.
  • SizerSizer Join Date: 2003-10-08 Member: 21531Members
    edited March 2004
    <!--QuoteBegin-e.Nadagast+Mar 24 2004, 04:45 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (e.Nadagast @ Mar 24 2004, 04:45 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> just use lastinv stop dicking around with complicated blink/swipe or leap/bite scripts when it's so much easier and more effective to just type bind q lastinv. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Try blinkswiping someone, using lastinv, when you're five feet away. Guess what: isn't going to happen.
  • e_Nadagaste_Nadagast Join Date: 2003-10-30 Member: 22149Members
    yeah it is. It's damn easy too...
  • MintmanMintman Join Date: 2003-05-30 Member: 16866Members
    edited March 2004
    lastinv is server side and can, therefore, lag. Clientside solutions are much faster and lag free.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->// client side lastinv -- romano
    // replace 1,2,3,4 with your binds for slot1,2,3,4 respectively
    // repace q with your bind for lastinv

    bind PGDN "kk1a"
    bind KP_DOWNARROW "kk2a"
    bind KP_LEFTARROW "kk3a"
    bind KP_5 "kk4a"

    alias kk1a "kkslot1"
    alias kk1b "kkslot1; bind MOUSE5 kk2a"
    alias kk1c "kkslot1; bind MOUSE5 kk3a"
    alias kk1d "kkslot1; bind MOUSE5 kk4a"
    alias kkslot1 "slot1; bind PGDN kk1a; bind KP_DOWNARROW kk2a; bind KP_LEFTARROW kk3a; bind KP_5 kk4a"

    alias kk2a "kkslot2; bind MOUSE5 kk1b"
    alias kk2b "kkslot2"
    alias kk2c "kkslot2; bind MOUSE5 kk3b"
    alias kk2d "kkslot2; bind MOUSE5 kk4b"
    alias kkslot2 "slot2; bind PGDN kk1b; bind KP_DOWNARROW kk2b; bind KP_LEFTARROW kk3b; bind KP_5 kk4b"

    alias kk3a "kkslot3; bind MOUSE5 kk1c"
    alias kk3b "kkslot3; bind MOUSE5 kk2c"
    alias kk3c "kkslot3"
    alias kk3d "kkslot3; bind MOUSE5 kk4c"
    alias kkslot3 "slot3; bind PGDN kk1c; bind KP_DOWNARROW kk2c; bind KP_LEFTARROW kk3c; bind KP_5 kk4c"

    alias kk4a "kkslot4; bind MOUSE5 kk1d"
    alias kk4b "kkslot4; bind MOUSE5 kk2d"
    alias kk4c "kkslot4; bind MOUSE5 kk3d"
    alias kk4d "kkslot4"
    alias kkslot4 "slot4; bind PGDN kk1d; bind KP_DOWNARROW kk2d; bind KP_LEFTARROW kk3d; bind KP_5 kk4d"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    That's his client-side lastinv script with my keys added in.

    Edit:
    You need to know that MOUSE5 is my lastinv key, PG_DN is slot1, KP_DOWNARROW is slot2, KP_LEFTARROW is slot3 and KP_5 is slot4.
  • bioshockbioshock Join Date: 2003-05-20 Member: 16538Members
    <3 romano's lastinv except sometimes it randomly switches me to knife
  • Crono5Crono5 Join Date: 2003-07-22 Member: 18357Members
    <!--QuoteBegin-Invazn+Mar 23 2004, 11:46 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Invazn @ Mar 23 2004, 11:46 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Is there a stop reload script? like just switchign to knife and back <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I use one of those, it goes like this...

    Tap 3 before you go into battle, and when you want to stop reloading, hit Q twice. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->bind "yourkeyhere" "slot3; wait; slot1"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    I think this'd do it.
  • e_Nadagaste_Nadagast Join Date: 2003-10-30 Member: 22149Members
    uh... the clientside lastinv script isn't client side. I've tested it with slotx, and weapon_x and they both are server side...
  • a_civiliana_civilian Likes seeing numbers Join Date: 2003-01-08 Member: 12041Members, NS1 Playtester, Playtest Lead
    edited March 2004
    <!--QuoteBegin-BlueNovember+Mar 24 2004, 10:09 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (BlueNovember @ Mar 24 2004, 10:09 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Soz to hijack, but as we are on scripting, can anyone tell me why this should crash ns when run?

    //Fade Blink swich (push the button switch from slot1 to slot2, and then again to go from slot2 to slot1)
    alias fadeblink  "fadeblink1"
    alias fadeblink1 "slot2; wait; +attack; wait; -attack; alias fadeblink1 fadeblink2"
    alias fadeblink2 "slot1; wait; +attack; wait; -attack; alias fadeblink2 fadeblink1"
    bind "mouse2" "fadeblink"

    <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo--><!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    The problem, I believe, lies with "alias fadeblink1 fadeblink2" and "alias fadeblink2 fadeblink1". Upon the third execution of "fadeblink" you become trapped in an infinite loop.

    This should work (changes are bolded):
    alias fadeblink "fadeblink1"
    alias fadeblink1 "slot2; wait; +attack; wait; -attack; alias <b>fadeblink</b> fadeblink2"
    alias fadeblink2 "slot1; wait; +attack; wait; -attack; alias <b>fadeblink</b> fadeblink1"
    bind "mouse2" "fadeblink"

    <!--QuoteBegin-MMZ>Torak+Mar 24 2004, 01:35 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (MMZ>Torak @ Mar 24 2004, 01:35 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->? the syntax for the alias looks wrong (alias fadeblink2 fadeblink1) It should be [alias [nameofalias] [command string], quotes never hurt.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    It actually is following that syntax. In "alias fadeblink2 fadeblink1", fadeblink2 is the alias name and fadeblink1 is the command string.

    <!--QuoteBegin-MMZ>Torak+Mar 24 2004, 01:35 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (MMZ>Torak @ Mar 24 2004, 01:35 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->? I do not believe you can make an alias inside an alias<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    You can make an alias inside an alias. I do it all the time. In fact, due to bad experiences in the past with putting binds inside aliases (scripts often wouldn't work even when everything seemed right), I always use aliases within aliases rather than binds within aliases.

    <!--QuoteBegin-Crono5788+Mar 24 2004, 08:41 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Crono5788 @ Mar 24 2004, 08:41 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->bind "yourkeyhere" "slot3; wait; slot1"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    I think this'd do it.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    That would only work for the primary weapon. Substituting lastinv for slot1 in that script will increase its versatility.
  • AAA5AAA5 Join Date: 2004-03-04 Member: 27140Members
    requesting pistol script..
  • PetitMortePetitMorte Join Date: 2002-11-06 Member: 7232Members
    Allow me to point out one REALLY IMPORTANT thing about scripting and aliasing... especially + and - aliasing...

    If you are using a script, and get killed mid-script, with a + command "in use" then you will find yourself staring at a black screen as you are unable to respawn. You will continue to not respawn until you give half-life the appropriate - command.

    If you'd like to try this, here's how. pull down your console, and type +duck. You will crouch down. Now die. You will be unable to respawn until you type -duck into the console, or until you hit and release your duck key.

    Be sure that in any script where you have a + command, that you have the appropriate - command as well.

    If you're experimenting with new scriptage, I suggest setting an alias and binding a key to undo any + commands you can think of.

    alias letmespawnplease "-attack; -attack2; -jump; -duck; -aliasthatImade; -anotheralias; -yougettheidea"
    bind "L" "letmespawnplease"

    then when you get stuck in "limbo", you can just hit your key and get free.
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    edited March 2004
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Try blinkswiping someone, using lastinv, when you're five feet away. Guess what: isn't going to happen. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    Guess what? I do it all the time and it's super easy(well technically I have slots bound to keys and fastswitch on instead of lastinv but it's allmost the same). There is a(small) minimum time between switching and slashing, no scripting will ever change that and it's quite enough to make blinking and slashing without scripts just as easy except it gives you more controll and less hazzle. You may change your mind and wan't to blink again before swiping without having to make another script that will cancel and "reset" the binds of the last.
  • BlueNovemberBlueNovember hax Join Date: 2003-02-28 Member: 14137Members, Constellation
    <!--QuoteBegin-Soylent green+Mar 25 2004, 07:41 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Soylent green @ Mar 25 2004, 07:41 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
    You may change your mind and wan't to blink again before swiping without having to make another script that will cancel and "reset" the binds of the last.

    <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->
    "You may want to blink more than once before you make your swipe" possibly?
    Soz, you lost me a bit.


    Mintman, a civilian, MMZ>Torak: Thanks. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->


    One more thing, is there a practical difference between these two?

    1)
    alias fadeblink "fadeblink1"
    alias fadeblink1 "slot2; alias fadeblink fadeblink2"
    alias fadeblink2 "slot1; alias fadeblink fadeblink1"
    bind "mouse2" "fadeblink"

    2)
    alias weap1 "slot2; bind [chosen key] weap2"
    alias weap2 "slot1; bind [chosen key] weap1"
    bind "mouse2" "weap1"



    TY. Finally, what's Romano's client-side lastinv all about? I tried and failed to interpret it, dispite HL script almost being psuedocode. <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html//emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /><!--endemo-->
Sign In or Register to comment.