Posted 10 April 2009 - 07:34 AM

bind and unbind you have to way to bind or unbind your keys 1- from the console while you are in the game 2 - write all binds or unbinds you want to a file called autoexec.CFG and lunch that file when you start your game.

I suggest you to read this cool and easy article about bind or unbind command :

Tired of going through all your tools and weapons with your scrollwheel to get that landmine? No more! Find it hard to throw a grenade in the middle of a dogfight? Relax! Let me show you one way to deal with these issues and several others.

Introduction

When it comes to programming there are a few basic tasks that you need to be able to do: calculation, selection, iteration and of course you need to use variables i.e containers... like in the math you took in school... x = 3 + 4 but also to reassign or recalculate the value x=x+1

Calculation is just 1+1, 2-1, 3*3 (a computer will just do 3+3+3 but very fast) and 4/2 (haven't got a clu how a computer does that one )

Selection is basicly to evaluate if a statement is true or not, and for the result decide what to do.e.g.

if 2>1 then do thiselse do that

Well.. since 2 is larger than 1 the statement i true and the executer will do "this" and not "that"

Iteration is another word for repeating... to do something x times.e.g

x=0while x < 10do somethingx=x+1end while

These instructions tells a computer to "do something" 10 times (until x is not less than 10).

Scripting for ET (and other games based on the Quake 3 engine) is even simpler.. you can't use calculation, selection and iteration... all you've got is variables and commands.. so let's hit it.

Basics

You have probably used the console in ET already.. if not you can press the button place right under Esc to make it visible. In the conole you can write commands to change values or to make things happen e.g. /disconnect will disconnect you from the server you're currently on and /connect 82.192.80.143:27910 will connect you to the Pripps Blue Server (and it just doesn't get any better than that :-D).

A script (or a batch with another word) is a way to stack several commands and run them all at once (with one single instruction)... If you have a script called myscript.cfg you can execute it by typing /exec myscript.cfg in the console and press enter.

A script should be placed in your etmain-folder, and you can write it in any text editor like notepad.

The bind-command

Now lets look into one command that is very useful... the bind-command. It binds any instruction to a specific key on your keyboard or mouse.

syntax: bindkey "connect 8.9.4.227:27960"so to make a special pripps key you just have to type bindP "connect 8.9.4.227:27960"

Please note that there is no slash (/) when you use instructions... that's only when you type them into the console.. if you want to type this one into the console it would be/bindP "connect 8.9.4.227:27960

Now if all is correct you could press P on your keyboard and Enemy Territory will connect to one of the best gameserver out there....

Now that you know the simple bind it's time to go to the what I like to call the stacked bind.. to bind several instuctions to one key..the syntax is the same but you add instructions separate them with ;

A variable is a container for values (in this case it values consists of text)

some variables are "ingame" i.e. the game uses them like the variable name that contains your username (try typing /name in the console to see what it contains) and others are custom i.e. user created.

You can set a variable with set variablename "value" and you can execute what's in the variable by typing vstr variable

Now when you press F11 you will say "Watch out... I'm coming for you", and next time you press F11 you will say "I'm still coming". Get the picture?

This way we can make scripts that we load into variables and the bind any key to execute whatever is in the variable.

My scripts

I made a script to set my weaponsettings... whenever I press my x-button I will return to firearm I used most recently i.e if I hold my pistol and switch to pliers... when I press x I will return to pistol... the same goes for SMG... If I hold SMG and switch to knife x will bring me my SMG: If I'm already holding a firearm I will switch from SMG to Pistol or the other way around..x x x would mean Pistol SMG Pistol - this is what I call a toggle script.

I also made a tool-script... I use my scrollwheel for this.. down will allways bring weaponslot 5 (pliers for engineer) and up will bring me dynamite or landmines (the one I used most recently) and on the next up it will switch to the other just like the firearm toggle script..

Now because I always know my current (last used) firearm I have also written a Quick grenade script that will switch to grenade wait for a less than a second an return to my current firearm, all I have to do is press fire within that waitingtime (and hold set the delay) and after I release the button the grenade will fly and I will get my current firearm in my hands..

These scripts are linked together so I will post them all in one flow. Check the comments (//) for explaination of every row.

// Rebind the standard weaponkeys to make all the scripts work...//Select knife and remember last used firearmbind 1 "weaponbank 1; cg_drawgun 1; set altWeapon vstr currentWeapon; set altTool vstr currentTool"

//These binds has nothing to do with the scripts... just inplemented them here to keep all weaponrelated bind in one place (to make it easier to maintain or change... this is something I have learned from my dayjob - keep all code easy to read and understand)

//Use alternative mode (if exists) else reload...bind z "weapalt"

//Reload weaponbind r "+reload"

//Toggle next weaponbind UPARROW "weapnext"

//Toggle previous weaponbind DOWNARROW "weapprev"

//Fire weaponbind MOUSE1 "+attack"

// Tell the user that the script has been executedecho "weaponbinds.cfg executed!"

This concludes my first article on this matter.. If anyone of you want's to add, ask or just tell me how much you hate my guts then send me a PM...

Shrubbot also has these shortcuts that can be used in your in conjunction with binding keys

[A] - Past person who gave you ammo.[D] - Last person who killed you.[H] - Last person who gave you health.[K] - Last person you killed.[L] - Your current location. (Coordenates in where u are)[N] - Your nickname.[R] - Last person who revived you.[P] - Teammate you are pointing at.[S] - Your health (HP).[W] - Weapon you are currently holding.[T] - Ammo u have in current weapon.

How to make binds CHANGING the TEXT that appears when we do a VOICE COMMAND and using the Text Shortcuts:

Is simple, we just have to ADD the text we want to appear, at the end of the bind.

For example...:

/bind X vsay_team NeedAmmo I need ammo for my [W], coz i only have [T](This will show to players in your team the message "I need ammo for my Thompson, coz i only have 15/0!"

(Depending of wich weapon r u holding and how many amo rest) while sound ze voice "I Need Ammo!" when u press the key you binded)

Other examples...:

/bind X vsay_team Medic Please medic, come to help me, i only have [S] HP!

/bind X vsay_team Incoming Warning guyz! They r coming from [L]

U can make some very cool binds using this Text Shortcuts.

But remember to use correctly the "vsay" and "vsay_team" depending the information u want to say, because if u say it for all, instead for your team... then you will give the enemy some important info.

Also be careful not to use bind keys already used. Its best to set your binding keys up in notepad first, so that your sure not to repeat your keystrokes.Once you have set them to your satisfaction, go into your game. Pull down the command center by typing Copy and paste your binds.

Here is a list of most common binds, just change the "x" to you're prefered key

/bind X "vsay Y" or /bind X "vsay_team Y"

X is a keyboard key and Y is a term from the list below. This allows you to bind specific voice commands/comments to one key instead of using the menu to navigate to the one you want. Use one of the commands below to get the desired

Posted 16 April 2009 - 05:52 PM

BIGNI

L3: Novice

User

67 posts

0Unknown at this point

Server:None

and i know a few of them,for example "/bind key vsay iammedic" and i forgot who told me but he asked me if i had msn?!?! if thats where u get em at tell me how? and i can mak another msn cuz its so annoying and confusing but doesnt matter but thanks med and fbi anyways 4 the concern