This section will cover the basics for scripting in Counter-Strike Condition Zero. Many of the previously existing commands and rules that apply to scripting in Counter-Strike are still applicable in Condition Zero. So I will try to only cover the things that separate Condition Zero from the original Counter-Strike.
1. The userconfig.cfg file - Yes, this file is used in CS 1.6 also, but it is important in Condition Zero as well. So I will start the basics off with information about this file. The userconfig.cfg is similar to the autoexec.cfg file from CS 1.5 and older versions of CS. For more information about creating the autoexec, go here. The userconfig.cfg file is a file that is executed during the loading of the game and usually follows the config.cfg file. What this does is actually overwrite settings that were previously set in the config.cfg file. Sometimes the game resets your config.cfg back to default settings, and the only thing saving your settings is your trusty userconfig file.
Since the userconfig is not a default file, you as the user has to create it. You can either copy and rename your config.cfg into it, or make one from scratch with a Text Editor like Windows Notepad. Once you have one make sure it is in the proper directory; for the retail CS:CZ it is something like:
Just make sure you place your userconfig.cfg in the same directory as the config.cfg.
For CS:CZ via Steam, the path is something like:
C:\Program Files\Steam\SteamApps\username\condition zero\czero
Once you have your userconfig.cfg created and in the proper directory, you will want to add the settings and binds that you want to retain. You can either cut and paste these from your config.cfg file or type them in manually. Now make sure you save your file, and if using a Text Editor, make sure you use a .cfg extension and not the standard .txt extension. (Note - This is one of the most common mistakes when editing these files)
After that you are basically ready to go. Another good thing to do is to include an echo in your userconfig.cfg so that you can ensure that it properly loads. Add something like this to your file and resave:
echo echo Userconfig loaded . . . . . echo
If you open the console once you start the game, you should see "Userconfig loaded . . . . ." displayed. If you don't see that, your file did not load. You can manually load the file anytime by typing "exec userconfig.cfg" in the console.
2. The Placement
The next important factor with scripting in CS:CZ is the placement of your scripting files. I just want to reiterate that your files need to be in the proper directory or they will not work. Here again are some sample paths for CS:CZ Retail and Steam:
C:\Program Files\Steam\SteamApps\condition zero\czero
I like placing my script files in a sub-directory similar to my AutoScript. My script creates it's own directory called autoscript with most of the script-unique files in there. So if I was trying to exec those files I would need to include the full path like this example of executing a file called "scripts":
3. New Commands Now we are going to look at some new things we have seen in CS:CZ. The first thing that comes to my mind is the Buy Presets. This is a great new way to speed up your buying process and get out of the spawn as fast as possible. Now you can even make this process even faster by making direct binds to the presets like:
bind z "buypreset 1" // Buys Preset #1 bind w "buypreset 2" // Buys Preset #2 bind x "buypreset 3" // Buys Preset #3 bind c "buypreset 4" // Buys Preset #4
Now you might ask me, why do we need to do that? Well, you don't, but depending on the server you are playing on, the buy time will vary, so if you already know what preset you want to buy, why not just hit one key and fly out of the spawn? In CS:CZ like almost no other game, 1-2 seconds is the difference between a Win or Loss, a Kill or Death.
Another cool trick is to make a direct bind for editing the presets:
bind "a" "buypresetedit"
You might ask, why would I need to do this? Well, this allows you to actually edit your presets while you are in the Spectator mode or dead. This can come in very handy if you want to switch something in your presets. Once again, this just makes your time in the spawn reduced to just purchasing your equipment, instead of selecting and purchasing which can be time consuming.
The other new command that came along recently was the radartype command. This new command allowed you to finally switch between a solid or semi-transparent radar. The best thing to do in this case is to create a toggle that allows you to switch between the 2 radars with one key:
alias radsw "sradar" alias sradar "clradartype 1; radsw tradar" alias tradar "clradartype 0; radsw s_radar"
bind "n" "radsw"
Finally the newest thing to hit the streets was the ability to modify the size and color of your crosshair. The easiest way to adjust the radar size in-game is to create a script that allows you to cycle through the crosshair sizes:
alias "crs" "crs1" alias "crs1" "clcrosshairsize small; alias crs crs2" alias "crs2" "clcrosshairsize medium; alias crs crs3" alias "crs3" "clcrosshairsize large; alias crs crs4" alias "crs4" "clcrosshairsize medium; alias crs crs1"
bind "g" "crs"
Now the crosshair color can be a little more difficult. The only way you can automate this command is by creating separate cfg files for each color. The command to change the crosshair color is clcrosshaircolor "250 250 50", where the values in quotes are the RGB value of the crosshair. The problem is you have to keep the "RGB" values in the quotes or the game will only recognize the first value. The use of + signs or % symbols between the numbers does not work in this command either. So we are back to the separate cfg files. First in your userconfig, add the following lines:
alias yellow "exec cyellow.cfg" alias orange "exec corange.cfg" alias red "exec cred.cfg" alias magenta "exec cmagenta.cfg" alias blue "exec cblue.cfg" alias ltblue "exec cltblue.cfg" alias green "exec cgreen.cfg" alias white "exec cwhite.cfg" alias gray "exec cgray.cfg" alias black "exec cblack.cfg"
Then create separate cfg files with the one cl_crosshair color line in each of them. The files and the commands are listed below:
/cyellow.cfg clcrosshaircolor "250 250 50"
/corange.cfg clcrosshaircolor "250 128 50"
/cred.cfg clcrosshaircolor "250 50 50"
/cmagenta.cfg clcrosshaircolor "250 50 250"
/cblue.cfg clcrosshaircolor "50 50 250"
/cltblue.cfg clcrosshaircolor "50 250 250"
/cgreen.cfg clcrosshaircolor "50 250 50"
/cwhite.cfg clcrosshaircolor "250 250 250"
/cgray.cfg clcrosshaircolor "192 192 192"
/cblack.cfg clcrosshaircolor "0 0 0"
You can make as many color choices of these as you want, but I have just included the default colors with a few more common ones added. Now the last thing to do is make a color changer that cycles through the colors for you:
alias colorcyc "cyc1" alias cyc1 "yellow; alias colorcyc cyc2" alias cyc2 "orange; alias colorcyc cyc3" alias cyc3 "red; alias colorcyc cyc4" alias cyc4 "magenta; alias colorcyc cyc5" alias cyc5 "blue; alias colorcyc cyc6" alias cyc6 "ltblue; alias colorcyc cyc7" alias cyc7 "green; alias colorcyc cyc8" alias cyc8 "white; alias colorcyc cyc9" alias cyc9 "gray; alias colorcyc cyc10" alias cyc10 "black; alias color_cyc cyc1"
Then finally add the bind and you will be able to cycle through your colors by pressing "c" in this example:
bind "c" "color_cyc"
If you want to see what the RGB values look like, you can use an Imaging program like Paint Shop Pro, or see some examples here.
4. Conclusion This concludes Part 1 of my CS:CZ Scripting Basics. The next part will go more in depth into making other things work like they did in previous versions, like using the kb_act.lst to select your binds, and the commandmenu.
By: SxRxRnR...Posted by: Counter-Script.net