Understanding Scripting

2iDWraithGeN2iDWraithGeN Join Date: 2003-03-22 Member: 14772Members
<div class="IPBDescription">I want to understand scripts that I see</div> Ok, I administer a server and I play very often and one desire I have had recently is to understand scripts better. I have viewed a number of scripts and have some idea of how they work, but not an exact idea. I understand that a script can simply be a button binded to perform 2 actions, such as I could bind my primary attack button to attack and say a taunt at the same time. Anyway, long story short I don't really understand the actual working scripts, so I am going to drop in the bhop script and if someone would be kind enough to walk through each part of the script I would appreciate it.

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

bind [jumpkey] +3jumps in the console

I believe "alias" is just a way of saying "anytime something says +jump3, the rest of the line is what it means to do".
Now, what I do understand is that it is like a jump then the wait is a pause, but I don't understand why there is "-jump" and why there is a "-3jumps". What is the difference between the "-jump" and "+jump"? What do these things accomplish?

If you think there is some tutorial I can benefit from, then please let me know.

Just so everyone knows, I am sure I will get flamed for this, but I do not believe in using bunny hop scripts, fast attack scripts, etc... I think ppl should only be allowed to play the came as fast as their little hands, eyes, and brains can carry them. I am thinking about using scripting in some form to rebind my keys per every time I morph into a differnt alien, but I want to gain a good understanding of scripts first.

Comments

  • GrillkohleGrillkohle Join Date: 2003-12-23 Member: 24695Members, Constellation
    The + and - indicate the action that is executed when you press the button (+), and when you release it(-).

    F.E. if you press +forward, you will walk forward, and if you release the +forward button, -forward is executed, which makes you stop.

    The alias command is basically defining a new command that can be bound on any key and that can include more than one command. The difference is that you can use the alias command to create +/- commands that work as described above, and you can create 1/2 commands like this one:

    alias ducky "ducky2"
    alias ducky1 "-duck;alias ducky ducky2"
    alias ducky2 "+duck;alias ducky ducky1"

    Now you can bind "ducky" to a key, and if you press that key, it will make you crouch (+duck) AND it will make you stay crouched (because there is no -crouch in ducky2). After it made you crouch, it redefines the new alias command "ducky" as the alias command "ducky1", and if you press the button again, it basically redefines the button back to "ducky2", and 'un-crouches' you.
  • NGENGE Join Date: 2003-11-10 Member: 22443Members
    <!--QuoteBegin--[2iD]Wraith[GeN]+Jan 19 2004, 04:43 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> ([2iD]Wraith[GeN] @ Jan 19 2004, 04:43 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Ok, I administer a server and I play very often and one desire I have had recently is to understand scripts better. I have viewed a number of scripts and have some idea of how they work, but not an exact idea. I understand that a script can simply be a button binded to perform 2 actions, such as I could bind my primary attack button to attack and say a taunt at the same time. Anyway, long story short I don't really understand the actual working scripts, so I am going to drop in the bhop script and if someone would be kind enough to walk through each part of the script I would appreciate it.

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

    bind [jumpkey] +3jumps in the console

    I believe "alias" is just a way of saying "anytime something says +jump3, the rest of the line is what it means to do".
    Now, what I do understand is that it is like a jump then the wait is a pause, but I don't understand why there is "-jump" and why there is a "-3jumps". What is the difference between the "-jump" and "+jump"? What do these things accomplish?

    If you think there is some tutorial I can benefit from, then please let me know.

    Just so everyone knows, I am sure I will get flamed for this, but I do not believe in using bunny hop scripts, fast attack scripts, etc... I think ppl should only be allowed to play the came as fast as their little hands, eyes, and brains can carry them. I am thinking about using scripting in some form to rebind my keys per every time I morph into a differnt alien, but I want to gain a good understanding of scripts first. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    The script you have is quite useful, offers no unfair advantages, and does not make you bhop. It makes it so it's easier to never miss a jump.


    Next, the + and - parts of the script are there to do this:

    It's a command that you can HOLD down. The '+' part is activated when you press your key, and the '-' part is activated when you release the key.


    That is all.
  • 2iDWraithGeN2iDWraithGeN Join Date: 2003-03-22 Member: 14772Members
    Thank you guys, that makes way more sense. I really appreciate you guys not flaming me. I have seen so many people who ask questions about scripts that get flamed. So, I will go about trying to use scripts in a proper manner they are meant to be used and I really appreciate all of your help.
  • GrillkohleGrillkohle Join Date: 2003-12-23 Member: 24695Members, Constellation
    No problem at all.
    Just see this script 'language' as a (very basic) programming language.
  • TeoHTeoH Join Date: 2002-12-30 Member: 11640Members
    Tutorial here:

    <a href='http://www.planetquake.com/console/tutorials/quake.html' target='_blank'>http://www.planetquake.com/console/tutoria...ials/quake.html</a>

    This is written for quake1, valve use most of id's code for HL though, so this tutorial applies to HL as well. This will explain the differences between different console commands, how autoexec and config files work as well as the syntax including +/- etc.
Sign In or Register to comment.