Before we start scripting, lets try to get an understanding for what we are doing. Let me tell you a little story about what happens when you open Condition Zero. As the game starts, it reads the config.cfg file that is located in your czero folder. This is where all of your game settings are stored, and gets rewritten each time you leave the game. Feel free to look at this file, it is a simple text file and can be opened in Notepad. The last line of that file is:
. This is simply a command to "run" the file named "userconfig.cfg" (also located in your czero folder). If you have a fresh installation of Condition Zero, then the userconfig.cfg may not exist...in which case the command only throws of an exception in the developer's console. But...as soon as this userconfig.cfg file is created, it will automatically be executed every time you start Condition Zero.
Now in plain English. If you want your own commands and settings to be loaded each time you enter the game, you can simply save them in the file located at "C:\Program Files\Steam\SteamApps\YourSteamID\condition zero\czero\userconfig.cfg". This is a standard text file with the .txt extention replaced with .cfg. It can be edited in Notepad. This is where all our scripts will be saved.
THE BASICS...BINDS AND ALIASES
Before we get into Binds and Aliases, let me explain what commands and settings are. For example,
is the command that will tell the game to start moving your character forward.
is the command to tell the game to stop moving your character forward. Not all commands have a both a start and a stop. For example,
will tell your character to drop the current weapon. Since this is a single action, there is no + or - before it to tell it to start or stop...it just does it. A setting is basically a command that gets passed a variable. For example, in
the hud_centerid is the command that decides where to display the other player's names when you look at them. The 1 is a binary variable that is passed to it...binary meaning you have a choice of 0=no, or 1=yes. Therefore,
tells the game "Yes, center the players ID". A value of 0 would tell it "No, don't center the player's ID, put it in the lower left corner instead." Not all settings are binary...some have a decimal value instead.
will tell the game to set your volume to 70%. The variable can be anywhere from 0.0 = 0% to 1.0 = 100%. Some settings even use a string variable (a string is a series of text that is taken literally, rather than being given a mathmatical meaning). For example,
will pass the "name" command the variable "ImaDork", which tells the game to set your username to "ImaDork".
Binds. You can't play the game without binds. Binds are what connects a key to a command or series of commands. The basic form for writing a bind is:
In other words,
will bind the G key to the drop command. You can also bind a key to a setting.
will make the "delete" key set the game volume to 0%...very useful when your mother is yelling at you from the other room (although
might be preferable in that situation).
You can also bind a key to do multiple things at once (actually, if you want to be technical, it does them consequtively rather than at the same time).
Now Aliases are slightly more complicated. An alias will connect a certain command (you choose the name of the command) to one or multiple other commands. For example:
will create an alias called +duckjump that will both jump and duck at the same time.