TGDB.net - Game news, cheats, solutions, walkthroughs, trainers, saved games and much more!

Home » PC » Half-Life - Counterstrike » Half-Life - Counterstrike FAQ
Submitted by System on 09/03/2006, 09:50. Print file.
Jump to page:
01 · 02

Sponsors:

_______________________________________________________________________________
îîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîî
HALF-LIFE: COUNTERSTRIKE SCRIPTING FAQ
Version 0.1 (06/01/2001)
Copyright 2001 Pierre-Hugues Goyet
_______________________________________________________________________________
îîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîî


/***
* Webmasters, feel free to post this FAQ on your web sites. All I'm asking in
* in return is a link to where it's hosted and your word that you won't edit
* or modify it in any way. Also, please try to keep it updated as much as
* possible. You can always find the latest version at http://www.gamefaqs.com
*/



-------------------------------------------------------------------------------
INDEX
-------------------------------------------------------------------------------


I. Introduction
II. Basics
III. Binding
IV. Aliases
V. Scripting
VI. Samples
VII. Requests
VIII. User Submitted
IX. FAQ
X. Final Words
XI. Credits
XII. Version History




-------------------------------------------------------------------------------
I. INTRODUCTION
-------------------------------------------------------------------------------


What exactly is scripting? A common misconception is to think it's a form
of cheating. Let me reassure you right away: it is not. You can't make a
script that gives you automatic headshots, no recoil, super fast speed, etc.
All these require external programs running in the background that typically
mess with your system memory, keyboard/mouse input or the game's binary files.
THAT is cheating. Scripting is not.

Scripting requires no external programs or illicit activities. It is merely
using the finer features of the Half-Life engine as well as its console to
their fullest. A script will simply execute console commands for you that
aren't present in the Configuration menu. That's why it's not cheating unless
the game has cheat commands accessible from the console, and that isn't the
case.

Typically, scripts are used to automatically perform certain tasks for you
during your playing routine, for example buying your equipment (buy scripts
are the most common in the CS community). In that essence, your config.cfg
(the file that is created/overwritten whenever you go into the Configuration
menu and change your settings) is a script since it binds all your keys to the
functions you have chosen automatically.

They can also be used to modify (to a certain extent) existing functions.
For example, you might want to make your gun burst fire on its own, or
transform your walk button into a toggle rather than the default press & hold,
etc. You can do a lot of things, use your imagination.

Remember that if what you want can't be done manually through console
commands, a script won't be able to do it either.




-------------------------------------------------------------------------------
II. BASICS
-------------------------------------------------------------------------------


There are 2 kinds of functions in the Half-Life engines, basically. Normal
functions and +functions. There are also settings AKA variables, but we'll
talk about those later.

Normal functions are fairly simple: once they're invoked, they're executed
once and that's the end of it. +functions are a bit more complicated. First,
they always have a -function counterpart that USUALLY (but not necessarily)
does the opposite of what the +fuction does. For example, +attack tells the
engine to make your player start firing, and -attack stops firing. When you
press the key assigned to a +function, the +function is executed. When you
release that key, the -function is executed.

I know this is an awfully short explanation, but for the sake of simplicity
and for making basic scripts, that's all you need to know.




-------------------------------------------------------------------------------
III. BINDING
-------------------------------------------------------------------------------


The principle of binding is extremely simple. What you do is assign a key
to invoke a function, an alias or a series of functions and aliases. Here's
an example demonstrating the syntax:


bind "MOUSE1" "+attack"


If you're invoking multiple functions/aliases, you need to seperate them
with semicolons. For example:


bind "Q" "say hi people; say_team hello team"


would make pressing Q send out the message "hi people" to everyone and
"hello team" to your teammates only.


Here's a relatively complete list of the keys you can bind. Big thanks to
gameFAQs board user bassfish for the original list. Slight modifications were
made by myself.

NOTE: "Ingame Key Name" is how the Half-Life engine refers to the keys that
we puny mortals sometimes call differently ("Out of Game Key Name").
Also, I'm fairly certain that the Escape key is reserved.


Ingame Key Name / Out of Game Key Name

ESCAPE Escape
F1 F1
F2 F2
F3 F3
F4 F4
F5 F5
F6 F6
F7 F7
F8 F8
F9 F9
F10 F10
F11 F11
F12 F12
PAUSE Pause / System Break Key
` Left Quote
- Hyphen (-)
= Equals Sign
BACKSPACE Backspace
TAB Tab Key
[ Left Bracket
] Right Bracket
\ Back Slash
SEMICOLON Semicolon (;)
' Right Quote
/ Slash
SHIFT Left *AND* Right Shift Keys
ENTER Enter
, Comma (,)
. Period (.)
CTRL Left *AND* Right Control Keys
ALT Left *AND* Right Alt Keys
SPACE Space Bar
1 1 (above letters)
2 2
etc. etc.
0 0
A A
B B
etc. etc.
Z Z
UPARROW Up Arrow NOT Keypad
DOWNARROW Down Arrow NOT Keypad
RIGHTARROW Right Arrow NOT Keypad
LEFTARROW Left Arrow NOT Keypad
INS Insert NOT Keypad
HOME Home NOT Keypad
PGUP Page Up NOT Keypad
PGDN Page Down NOT Keypad
DEL Delete NOT Keypad
END End NOT Keypad
KP_UPARROW Keypad Up Arrow Keypad
KP_PGUP Keypad Page Up Keypad
KP_LEFTARROW Keypad Left Arrow Keypad
KP_5 Keypad 5 Keypad
KP_RIGHTARROW Keypad Right Arrow Keypad
KP_END Keypad End Keypad
KP_DOWNARROW Keypad Down Arrow Keypad
KP_PGDN Keypad Page Down Keypad
KP_ENTER Keypad Enter Keypad
KP_INS Keypad Insert Keypad
KP_DEL Keypad Del Keypad
KP_SLASH Keypad Back Slash Keypad
KP_MINUS Keypad Hyphen Keypad
KP_PLUS Keypad Plus Keypad
MOUSE1 Mouse Button 1
MOUSE2 Mouse Button 2
MOUSE3 Mouse Button 3 Middle button
MOUSE4 Mouse Button 4
MOUSE5 Mouse Button 5
MWHEELUP Mouse Wheel Up (Roll Forward)
MWHEELDOWN Mouse Wheel Down (Roll Back)




-------------------------------------------------------------------------------
IV. ALIASES
-------------------------------------------------------------------------------


Aliases are fairly simple to understand. They are merely another way to
refer to a series of functions or other aliases. A nickname, if you like.
For example, compare the following 2 mini-scripts:


1) bind "X" "buy; menuselect 1; menuselect 3"

2) alias "buy_deagle" "buy; menuselect 1; menuselect 3"
bind "X" "buy_deagle"


What's the difference? Both do the same thing: make the X key buy you a Desert
Eagle. It's just that the second uses an alias whereas the first doesn't.
What's the point you might ask? There are several advantages to using aliases:


- Aliases eliminate useless repetitions. If, while scripting, you often
call a series of functions, instead of mindlessly cut and pasting them
over and over, you could make an alias with them and invoke that
instead.

- They make your scripts easier to read and a LOT more comprehensive.
Someone who doesn't know how to script at all would know the second
script in the previous example buys a Desert Eagle.

- They are necessary to create your own +functions and multistate
functions (e.g.: ON/OFF functions).

- They generally make your life easier.


There are 2 types of aliases: normal aliases and +aliases. They work the
same way functions do.


Jump to page:
01 · 02

Sponsors:

Other files from this game:
  1. Half-Life - Counterstrike document by System on 14/03/2006, 06:30
  2. Half-Life - Counterstrike trainer by System on 14/03/2006, 06:30
  3. Half-Life - Counterstrike document by System on 14/03/2006, 06:30
    Buy-Script
  4. Half-Life - Counterstrike document by System on 14/03/2006, 06:30
  5. Half-Life - Counterstrike hints by System on 09/03/2006, 09:50
  6. Half-Life - Counterstrike hints by System on 09/03/2006, 09:50
    Weapons and Tactics Guide
  7. Half-Life - Counterstrike FAQ by System on 09/03/2006, 09:50
    Scripting FAQ
  8. Half-Life - Counterstrike FAQ by System on 09/03/2006, 09:50
  9. Half-Life - Counterstrike FAQ by System on 09/03/2006, 09:50
  10. Half-Life - Counterstrike solution by System on 09/03/2006, 09:50
    De_Dust2 Strategy Guide
  11. Half-Life - Counterstrike FAQ by System on 09/03/2006, 09:50
  12. Half-Life - Counterstrike FAQ by System on 09/03/2006, 09:50
    Weapon Fix FAQ