SpawnPoint

My Blog

binding keys

Today I'm gonna be talking about the bread and butter of your soon to be config files... Key binds.

Key binds are used for just about everything you can do in the game, from moving around to attacking, buying weapons and even saying custom made lines ( If you have to say something a lot of times).

First let's look at how the bind is build up. Here's a sample line:

bind "q" "buy deagle;"

What this line does is it binds key q to buying a deagle. So at the start of a round when you press q it buys you a deagle pistol. Pretty handy eh. It does exactly the same as opening your buy menu, selecting pistols and selecting the desert eagle, only instead of using three actions you just press one button.

Ofcourse you can substitute the letter q for any of your keys on the keyboard. Letters and numbers are just the actual characters. The more special ones are for instance the keypad keys and the special keys like the F1-F12 the shift, command, enter and so on.

Here's a small list most of the special keys:

Special keys on the keyboard:
"TAB"
"ENTER"
"ESCAPE"
"SPACE"
"BACKSPACE"
"SHIFT"

Special Keys above cursor keys:
"PAUSE"
"ALT"
"INS"
"DEL"
"PGUP"
"PGDOWN"

Cursor Keys:
"UPARROW"
"DOWNARROW"
"LEFTARROW"
"RIGHTARROW"

Keypad Keys:
"KP_SLASH"
"KP_MINUS"
"KP_HOME"
"KP_UPARROW"
"KP_PGUP"
"KP_LEFTARROW"
"KP_5"
"KP_RIGHTARROW"
"KP_PLUS"
"KP_END"
"KP_DOWNARROW"
"KP_PGDOWN"
"KP_ENTER"
"KP_0"
"KP_DEL"

F Keys:
"F1"
"F2"
"F3"
"F4"
"F5"
"F6"
"F7"
"F8"
"F9"
"F10"
"F11"
"F12"


The space between the second quotes is where the commands will be placed that should be executed when you press the button. In the example above this is just buying a deagle but it can be used for a lot more. Next time I'll be talking more about that.












What is the config, and what does it do?

Why would you want to create your own custom configs?

If you set your keys, your spray, your name, or change any setting in the menu the settings are automatically written to a file called config.cfg. You can find this file in this folder:  (directory where you installed steam to)\Valve\SteamApps\(your_player_name_here)\counter-strike source\cstrike\cfg

If you open your config.cfg file with notepad you'll see it contains a lot of settings. Most settings aren't worth messing about right now. We'll get to that in a later post.

The config.cfg file is a file that is automatically created when it is damaged or removed. What this means is that with every update you could lose all your carefully set keys and video settings. It happened to me twice, which caused me to do some research into the config scripts.

Before we can start creating our own custom configs, we first want to create a text file called autoexec.cfg in the same directory the config.cfg is located.This file is automatically loaded when you launch Counterstrike:Source, and since this isn't a file create by steam, anything you put in here is safe from the next updates...

Next time I'll discuss some of the basics in scripting.... see you then!


Evil-Fluffy's Profile Image
  • Evil-Fluffy

    Server Support Staff
  • Member Since:2007-01-26 03:52:00
  • Last Online:2008-06-28 20:53:06

SpawnPoint Info

Blog Stats:

  • Total Blogs: 4
  • Popular Blogs: 2

My Games

SpawnPoint: Game File Community featuring PC Video Gaming, Free PC Games, Counter-Strike, Action And Strategy Files, Game Forums and Game News