Left 4 Dead 2:
Making a custom AutoExec.cfg / Intro to Programming.
Making a custom AutoExec.cfg / Intro to Programming.
"Making a custom AutoExec.cfg / Intro to Programming" is not a good title for this post. It was a very weak attempt at humor. Perhaps it should have been named something more descriptive such as - Making an AutoExec.cfg: Key Binds, Network Tweaks, and Gameplay Enhancing Scripts. Either way. Here is a guide on making an autoexec.cfg file for Left 4 Dead 2 that tries to be a programming primer, but in the end will make L4D2 a bit more enjoyable. If you already know what you're doing, just skip down to the code snippets and have fun!!
Chapter One: CFG - Configuration File
In Source games, a configuration file can be executed to perform a list of console commands. CFG files can be written in any plain text editor. To create one, right-click the blank space in a folder, and go to New - Text file. Rename it to myconfig.cfg or whatever you want, as long as it ends in .cfg. You can then open it in your text editor and put commands in.
Note: CFGs must be placed in the game's cfg folder ie. "l4d2\left4dead2\cfg".
They can also be run from the console using "exec filename" where filename is the name of the configuration file, excluding its .cfg extension. Sometimes people put exec lines into the autoexec.cfg, so that other cfg files are executed when the game starts up. Configuration files can be placed in sub-directories of the cfg folder. The exec command would require you to include the sub-directories in the command.
Autoexec is a CFG file for launching a game with set convars that will get automatically executed on game launch.
To create an autoexec: create a text document named 'autoexec' and save it with a .cfg extension. Place it inside your game's cfg folder. Place all the cvars inside the file with each cvar on a separate line or separate by a semi-colon on a single line.
Exercise 1: Make an autoexec.cfg for L4D2.
1. Open notepad.
2. Type in the commands you want.
3. Save the file in: left 4 dead 2\left4dead2\cfg
4. Save it as: autoexec.cfg and in file type: all files.
Your newly created autoexec.cfg will be automatically ran every time you start a game. It can be used to bind keys, make toggle keys for certain behaviors, or even just setup your screen how you like it. Any command you can use in the Developer Console, can be transposed to a script (for the most part) in autoexec.cfg.
Chapter Two: The Console, CVars, commands and comments.
The console provides a command-line interface for the advanced configuration of Source games. Just about any configuration task can be completed from the console, and in fact many have to be.
The console starts disabled. To enable it, load the game and go to Options, then keyboard&mouse and Enable Developer Console. Once enabled, it can be opened and closed by pressing the button above Tab.
(This should work regardless of your keyboard layout. If it doesn't, add
-console to the game's launch options and type bind your_key toggleconsole.) CVar means Console Variable. Console variables have a value assigned to them. You can change this value by using the console. There are different CVar types:
* Boolean : 0 (off) or 1 (on)
* Integer : A whole number. (Example : 123, 1, -500, etc...)
* Float : A number with a decimal. (Example : 0.33, 1.5, 50.4, etc)
* String : A set of characters.
The console window is where commands are entered. They come in two forms: commands and variables. Commands are simply keywords, but variables (cvars) require a value of some sort before they are accepted.
A few notes about console commands:
-Multiple values are separated with spaces. If a value contains a space, surround it with quote marks.
[
say "Hello everyone on the server"]-The console will suggest commands and sometimes values in a pop-out box beneath the input field. Press Up/Down to navigate the list and Tab to accept the highlighted suggestion.
-Only "archived" cvars are stored after the game closes. Use autoexec if you want to set any others when a game loads.
-Some commands are serverside, others clientside. In multiplayer you can only set clientside ones.
-There are many command prefixes. The most common are
cl ("clientside") and sv ("serverside").-The status Console Command shows information about the server a client is connected to. The information that is shown is hostname, version, VAC security, map, the number of players in the server, and a detailed list of players. The detailed list of players includes userid, name, uniqueid, connection time, ping, loss, connection state, and IP address. Next time you are on a server, type status into your console for more info. :)
// is a standard comment when coding, it's used to put in information into coding files to explain/describe what's going on, or to comment out bad code.
Example autoexec.cfg:
//Set in game name here
setinfo name yourname //edit yourname
echo Hello World!
With this example autoexec.cfg, when the game is started [commented code is ignored] the player's name is set with the command "setinfo name playername" and the words "Hello World!" is output to the developer console.setinfo name yourname //edit yourname
echo Hello World!
Exercise 2: Get to know Boolean - 0 is off or 1 is on.
Boolean value is as simple as OFF/ON and False/True. Let's try some variables with a boolean value to turn stuff off or on. Enable the console and turn on cheats from the autoexec.cfg:// Startup Settings
con_enable "1" //default 0; Enables Console
sv_cheats "1" //default 0; Enables Cheats
con_enable "1" //default 0; Enables Console
sv_cheats "1" //default 0; Enables Cheats
SMART TIP: Client Network Optimization
Use the autoexec.cfg to set clientside variables to optimize network performance.These commands with modified values should help reduce lag and in-game stuttering.
//Client Network Optimization
cl_updaterate "30" //default 20; packets per second you request from the server
cl_cmdrate "30" //default 30; command packets sent to server per second
cl_interp "0.067" //default 0.1; interpolation value to match updaterate 30
rate "30000" //default 10000; max bytes/sec the host can receive data
cl_timeout 60 //workaround for server disconnecting prematurely before map load
cl_resend "1.5" //default 6; seconds to wait before retrying to connect to a server
cl_lagcompensation "1" //default 1; Improves hit registration
cl_forcepreload "1" //default 0; Pre-load levels entirely into RAM (use if you have >2GB)
//This reduces in-game stuttering, but may make you wait longer to join servers
cl_updaterate "30" //default 20; packets per second you request from the server
cl_cmdrate "30" //default 30; command packets sent to server per second
cl_interp "0.067" //default 0.1; interpolation value to match updaterate 30
rate "30000" //default 10000; max bytes/sec the host can receive data
cl_timeout 60 //workaround for server disconnecting prematurely before map load
cl_resend "1.5" //default 6; seconds to wait before retrying to connect to a server
cl_lagcompensation "1" //default 1; Improves hit registration
cl_forcepreload "1" //default 0; Pre-load levels entirely into RAM (use if you have >2GB)
//This reduces in-game stuttering, but may make you wait longer to join servers
Chapter 3: Playing with the BIND command.
Now let's use the bind command to bind a key to a command. Is your head spinning from that last sentence? Don't worry this is pretty straight-forward. Personally, I dislike using mouse button 3 for zooming in with the rifle scope and prefer to use the C key for +zoom, instead. This requires remapping C (the default voice chat key) to V.
Also, I like to change my cast vote binds from the function keys to the pageup/pagedown buttons.
While in the game console, you would have to type: bind c +zoom and change each bind manually. Adding your favorite binds to the autoexec.cfg is an easy way to save more time for killing infected.
Exercise 3: Use the bind command to remap keys.
Example autoexec.cfg:
//Rifle Scope and voice chat
bind "c" "+zoom" //rifle scope zoom - Default: MOUSE3
bind "v" "+voicerecord" //voice chat - Default: c
//Voting
bind "PGUP" "Vote Yes" //default: f1
bind "PGDN" "Vote No" //default: f2
bind "c" "+zoom" //rifle scope zoom - Default: MOUSE3
bind "v" "+voicerecord" //voice chat - Default: c
//Voting
bind "PGUP" "Vote Yes" //default: f1
bind "PGDN" "Vote No" //default: f2
For the sake of completeness, here are the default keyboard/mouse settings as they appear in the game's option menu. Note: Use the unbindall command to clear all currently set binds first.
Default Keyboard/Mouse Binds:
unbindall
//# Default Config Values #
//# MOVEMENT #
bind "w" "+forward" //Move forward
bind "s" "+back" //Move back
bind "a" "+moveleft" //Move left (strafe)
bind "d" "+moveright" //Move right (strafe)
bind "SHIFT" "+speed" //Walk (move slowly)
bind "SPACE" "+jump" //Jump
bind "CTRL" "+duck" //Duck
//# COMBAT #
bind "MOUSE1" "+attack" //Fire
bind "MOUSE2" "+attack2" //Push away enemies
bind "MOUSE3" "+zoom" //Use hunting/sniper rifle scope
bind "r" "+reload" //Reload weapon
bind "MWHEELUP" "invprev" //Previous weapon
bind "MWHEELDOWN" "invnext" //Next weapon
bind "q" "lastinv" //Last weapon used
//# COMMUNICATION #
bind "c" "+voicerecord" //Use voice communication
bind "F1" "Vote Yes" //Vote yes on active issue
bind "F2" "Vote No" //Vote no on active issue
bind "z" "+mouse_menu Orders" //Orders
bind "x" "+mouse_menu QA" //Questions and Answers
bind "y" "messagemode" //Chat message
bind "u" "messagemode2" //Team message
//# MENU #
bind "m" "chooseteam" //Select team
bind "TAB" "+showscores" //Display multiplayer scores
bind "1" "slot1" //Select primary weapon
bind "2" "slot2" //Select pistol
bind "3" "slot3" //Select explosive
bind "4" "slot4" //Select first aid
bind "5" "slot5" //Select pain pills
bind "6" "slot6" //required for sm_admin menu
bind "7" "slot7" //required for sm_admin menu
bind "8" "slot8" //required for sm_admin menu
bind "9" "slot9" //required for sm_admin menu
bind "0" "slot10" //required for sm_admin menu
bind "h" "motd" //MESSAGE OF THE DAY
//# MISC #
bind "e" "+use" //Use item (buttons, machines, ...)
bind "f" "impulse 100" //Flashlight
bind "t" "impulse 201" //Spray logo
bind "F5" "jpeg" //Take screen shot
bind "ESCAPE" "cancelselect" //Quit Game
bind "`" "toggleconsole" //opens dev console.
//# Default Config Values #
//# MOVEMENT #
bind "w" "+forward" //Move forward
bind "s" "+back" //Move back
bind "a" "+moveleft" //Move left (strafe)
bind "d" "+moveright" //Move right (strafe)
bind "SHIFT" "+speed" //Walk (move slowly)
bind "SPACE" "+jump" //Jump
bind "CTRL" "+duck" //Duck
//# COMBAT #
bind "MOUSE1" "+attack" //Fire
bind "MOUSE2" "+attack2" //Push away enemies
bind "MOUSE3" "+zoom" //Use hunting/sniper rifle scope
bind "r" "+reload" //Reload weapon
bind "MWHEELUP" "invprev" //Previous weapon
bind "MWHEELDOWN" "invnext" //Next weapon
bind "q" "lastinv" //Last weapon used
//# COMMUNICATION #
bind "c" "+voicerecord" //Use voice communication
bind "F1" "Vote Yes" //Vote yes on active issue
bind "F2" "Vote No" //Vote no on active issue
bind "z" "+mouse_menu Orders" //Orders
bind "x" "+mouse_menu QA" //Questions and Answers
bind "y" "messagemode" //Chat message
bind "u" "messagemode2" //Team message
//# MENU #
bind "m" "chooseteam" //Select team
bind "TAB" "+showscores" //Display multiplayer scores
bind "1" "slot1" //Select primary weapon
bind "2" "slot2" //Select pistol
bind "3" "slot3" //Select explosive
bind "4" "slot4" //Select first aid
bind "5" "slot5" //Select pain pills
bind "6" "slot6" //required for sm_admin menu
bind "7" "slot7" //required for sm_admin menu
bind "8" "slot8" //required for sm_admin menu
bind "9" "slot9" //required for sm_admin menu
bind "0" "slot10" //required for sm_admin menu
bind "h" "motd" //MESSAGE OF THE DAY
//# MISC #
bind "e" "+use" //Use item (buttons, machines, ...)
bind "f" "impulse 100" //Flashlight
bind "t" "impulse 201" //Spray logo
bind "F5" "jpeg" //Take screen shot
bind "ESCAPE" "cancelselect" //Quit Game
bind "`" "toggleconsole" //opens dev console.
Chapter 4: Playing with the ALIAS and +/- commands.
The Alias command allows you to shorten very long commands into one short alias. You can use as many aliases and/or commands that you want. Let's say we wanted to bind a single key to open the console and then runs 'status' and a few other commands - leaving us with a console chock full of info from the server we are connected to - all from a single key. We would make an alias with all the commands required to perform these functions and then bind a key to that alias. See the following snippet to see how this is done:
//Server Status and SM Admin
alias sv.check "toggleconsole; clear; echo [ SERVER STATUS CHECK ]; wait 60; status; wait 60; sm plugins list; wait 60; meta list;"
bind "F11" "sv.check" //Check Server Info in console
setinfo "server_pw" "admin_pw" //for sourcemod admin passwords
bind "F12" "sm_admin" //sm admin menu
By pressing the F11 key, which is bound to the alias sv.check, the alias' commands opens and then clears the console, outputs [ SERVER STATUS CHECK ], waits 60 frames, outputs server info from status command, waits 60 frames, outputs sourcemod plugin list, waits 60 frames and outputs the metamod plugin list to the console. alias sv.check "toggleconsole; clear; echo [ SERVER STATUS CHECK ]; wait 60; status; wait 60; sm plugins list; wait 60; meta list;"
bind "F11" "sv.check" //Check Server Info in console
setinfo "server_pw" "admin_pw" //for sourcemod admin passwords
bind "F12" "sm_admin" //sm admin menu
Sourcemod admins should feel right at home with the last two cvars above. Setting admin password and sm_admin menu bind is also conveniently handled in the autoexec.cfg.
Another example using the command alias can be viewed is in the next snippet of code, but we will use this snippet to explain + and - commands. Plus and Minus commands are commands that have 2 states. The plus part is executed when you press a key and it will execute until key is released. When key is released it goes into minus state. As you probably noticed, there is no need to bind the minus command, it's executed automatically after you stop holding key that you bound it to.
Example: bind "MOUSE1" "+attack"
By default the TAB button is set to show the scoreboard [+showscores]. Keep that in mind as we'll be using that bind/command in a moment. First let me introduce to you the net_graph CVar.
To check your client connection speed and quality, you can use a Source Engine tool called net graph, which can be enabled with net_graph 2 (or +graph). Net_graph is used to show network stats, fps, and other connectivity statistics.
Question: How could we include net_graph within the scoreboard so it can be used with the +showscores command?
Answer:
//ScoreBoard and Net graph
alias "mygraph" "net_graph 3" //change the value from 1-5 to adjust how much info will be shown
alias "+sb" "+showscores; mygraph"
alias "-sb" "-showscores; net_graph 0"
bind "TAB" "+sb" //scoreboard and netgraph bind
alias "mygraph" "net_graph 3" //change the value from 1-5 to adjust how much info will be shown
alias "+sb" "+showscores; mygraph"
alias "-sb" "-showscores; net_graph 0"
bind "TAB" "+sb" //scoreboard and netgraph bind
Chapter 5: Using exec command - Third person shoulder mode
Back in Chapter One we discussed how people put exec lines into the autoexec.cfg, so that other cfg files are executed when the game starts up. The next snippet of code is a quite large one that deserves its own cfg file which we will execute from autoexec.. The thirdpersonshoulder cvar allows switching the camera to third person mode - behind the shoulder of the player. Its very useful for the jockey-mounted-player, for peeking around corners, and also when playing on the infected team.
What makes this piece of code so enormously huge is that it incorporates a very impressive mouse-wheel zoom script. You will need to create a new cfg file named thirdperson.cfg containing the zooming script in your cfg folder. Then the thirdpersonshoulder convars must be added to the autoexec.cfg along with a line to exec thirdperson.cfg and a bind to enable/disable 3rd person mode.
Examination: Behold the Third EYE of zooming powers!!
To be able to use the third-person shoulder view mode with mouse-wheel zooming:First you will need to add the following code to your autoexec.cfg:
//Third Person Perspective with mouse wheel zoom [requires thirdperson.cfg]
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
alias "defaultzoom" "zoom.40" //default zoom distance for thirdperson mousewheel zoom (change zoom.## to any multiple of 5 (30 - 200)
bind "MWHEELUP" "up" // thirdperson camera zoom up and firstperson weapon scroll
bind "MWHEELDOWN" "down" //thirdperson camera zoom down and firstperson weapon scroll
bind "q" "thirdpersonshoulder; togglezoom" // thirdpersonshoulder toggle bind (remove "togglezoom" to disable the mousewheel zoom feature)
exec "thirdperson.cfg" // thirperson zooming script
//bind "q" "lastinv" //last weapon used [Default]
This will bind the necessary keys needed to perform this awesome enhancement and will execute thirdperson.cfg. // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
alias "defaultzoom" "zoom.40" //default zoom distance for thirdperson mousewheel zoom (change zoom.## to any multiple of 5 (30 - 200)
bind "MWHEELUP" "up" // thirdperson camera zoom up and firstperson weapon scroll
bind "MWHEELDOWN" "down" //thirdperson camera zoom down and firstperson weapon scroll
bind "q" "thirdpersonshoulder; togglezoom" // thirdpersonshoulder toggle bind (remove "togglezoom" to disable the mousewheel zoom feature)
exec "thirdperson.cfg" // thirperson zooming script
//bind "q" "lastinv" //last weapon used [Default]
Now make the thirdperson.cfg file and include the follow snippet of code in it:
// third-person shoulder mode with zooming
echo [ thirdperson.cfg LOADED ];
c_thirdpersonshoulderoffset 0;
c_thirdpersonshoulderaimdist 720;
c_thirdpersonshoulderheight 10;
c_thirdpersonshoulderdist 40;
cam_ideallag 0;
cam_idealdelta 4;
cam_idealpitch 0;
cam_idealyaw 0;
alias togglezoom.off "alias up invprev; alias down invnext; alias togglezoom togglezoom.on; echo [thirdpersonshoulder mode off ]";
alias togglezoom.on "alias up zoom.in; alias down zoom.out; up; down; alias togglezoom togglezoom.off; echo [thirdpersonshoulder mode on ]";
alias zoom.25 "cam_idealdist 30; alias zoom.in zoom.30; alias zoom.out zoom.30";
alias zoom.30 "cam_idealdist 30; alias zoom.in zoom.25; alias zoom.out zoom.35";
alias zoom.35 "cam_idealdist 35; alias zoom.in zoom.30; alias zoom.out zoom.40";
alias zoom.40 "cam_idealdist 40; alias zoom.in zoom.35; alias zoom.out zoom.45";
alias zoom.45 "cam_idealdist 45; alias zoom.in zoom.40; alias zoom.out zoom.50";
alias zoom.50 "cam_idealdist 50; alias zoom.in zoom.45; alias zoom.out zoom.55";
alias zoom.55 "cam_idealdist 55; alias zoom.in zoom.50; alias zoom.out zoom.60";
alias zoom.60 "cam_idealdist 60; alias zoom.in zoom.55; alias zoom.out zoom.65";
alias zoom.65 "cam_idealdist 65; alias zoom.in zoom.60; alias zoom.out zoom.70";
alias zoom.70 "cam_idealdist 70; alias zoom.in zoom.65; alias zoom.out zoom.75";
alias zoom.75 "cam_idealdist 75; alias zoom.in zoom.70; alias zoom.out zoom.80";
alias zoom.80 "cam_idealdist 80; alias zoom.in zoom.75; alias zoom.out zoom.85";
alias zoom.85 "cam_idealdist 85; alias zoom.in zoom.80; alias zoom.out zoom.90";
alias zoom.90 "cam_idealdist 90; alias zoom.in zoom.85; alias zoom.out zoom.95";
alias zoom.95 "cam_idealdist 95; alias zoom.in zoom.90; alias zoom.out zoom.100";
alias zoom.100 "cam_idealdist 100; alias zoom.in zoom.95; alias zoom.out zoom.105";
alias zoom.105 "cam_idealdist 105; alias zoom.in zoom.100; alias zoom.out zoom.110";
alias zoom.110 "cam_idealdist 110; alias zoom.in zoom.105; alias zoom.out zoom.115";
alias zoom.115 "cam_idealdist 115; alias zoom.in zoom.110; alias zoom.out zoom.120";
alias zoom.120 "cam_idealdist 120; alias zoom.in zoom.115; alias zoom.out zoom.125";
alias zoom.125 "cam_idealdist 125; alias zoom.in zoom.120; alias zoom.out zoom.130";
alias zoom.130 "cam_idealdist 130; alias zoom.in zoom.125; alias zoom.out zoom.135";
alias zoom.135 "cam_idealdist 135; alias zoom.in zoom.130; alias zoom.out zoom.140";
alias zoom.140 "cam_idealdist 140; alias zoom.in zoom.135; alias zoom.out zoom.145";
alias zoom.145 "cam_idealdist 145; alias zoom.in zoom.140; alias zoom.out zoom.150";
alias zoom.150 "cam_idealdist 150; alias zoom.in zoom.145; alias zoom.out zoom.155";
alias zoom.155 "cam_idealdist 155; alias zoom.in zoom.150; alias zoom.out zoom.160";
alias zoom.160 "cam_idealdist 160; alias zoom.in zoom.155; alias zoom.out zoom.165";
alias zoom.165 "cam_idealdist 165; alias zoom.in zoom.160; alias zoom.out zoom.170";
alias zoom.170 "cam_idealdist 170; alias zoom.in zoom.165; alias zoom.out zoom.175";
alias zoom.175 "cam_idealdist 175; alias zoom.in zoom.170; alias zoom.out zoom.180";
alias zoom.180 "cam_idealdist 180; alias zoom.in zoom.175; alias zoom.out zoom.185";
alias zoom.185 "cam_idealdist 185; alias zoom.in zoom.180; alias zoom.out zoom.190";
alias zoom.190 "cam_idealdist 190; alias zoom.in zoom.185; alias zoom.out zoom.195";
alias zoom.195 "cam_idealdist 195; alias zoom.in zoom.190; alias zoom.out zoom.200";
alias zoom.200 "cam_idealdist 200; alias zoom.in zoom.195; alias zoom.out zoom.205";
alias zoom.205 "cam_idealdist 200; alias zoom.in zoom.200; alias zoom.out zoom.200";
togglezoom.off; c_thirdpersonshoulder 0;
defaultzoom;
echo [ thirdperson.cfg LOADED ];
c_thirdpersonshoulderoffset 0;
c_thirdpersonshoulderaimdist 720;
c_thirdpersonshoulderheight 10;
c_thirdpersonshoulderdist 40;
cam_ideallag 0;
cam_idealdelta 4;
cam_idealpitch 0;
cam_idealyaw 0;
alias togglezoom.off "alias up invprev; alias down invnext; alias togglezoom togglezoom.on; echo [thirdpersonshoulder mode off ]";
alias togglezoom.on "alias up zoom.in; alias down zoom.out; up; down; alias togglezoom togglezoom.off; echo [thirdpersonshoulder mode on ]";
alias zoom.25 "cam_idealdist 30; alias zoom.in zoom.30; alias zoom.out zoom.30";
alias zoom.30 "cam_idealdist 30; alias zoom.in zoom.25; alias zoom.out zoom.35";
alias zoom.35 "cam_idealdist 35; alias zoom.in zoom.30; alias zoom.out zoom.40";
alias zoom.40 "cam_idealdist 40; alias zoom.in zoom.35; alias zoom.out zoom.45";
alias zoom.45 "cam_idealdist 45; alias zoom.in zoom.40; alias zoom.out zoom.50";
alias zoom.50 "cam_idealdist 50; alias zoom.in zoom.45; alias zoom.out zoom.55";
alias zoom.55 "cam_idealdist 55; alias zoom.in zoom.50; alias zoom.out zoom.60";
alias zoom.60 "cam_idealdist 60; alias zoom.in zoom.55; alias zoom.out zoom.65";
alias zoom.65 "cam_idealdist 65; alias zoom.in zoom.60; alias zoom.out zoom.70";
alias zoom.70 "cam_idealdist 70; alias zoom.in zoom.65; alias zoom.out zoom.75";
alias zoom.75 "cam_idealdist 75; alias zoom.in zoom.70; alias zoom.out zoom.80";
alias zoom.80 "cam_idealdist 80; alias zoom.in zoom.75; alias zoom.out zoom.85";
alias zoom.85 "cam_idealdist 85; alias zoom.in zoom.80; alias zoom.out zoom.90";
alias zoom.90 "cam_idealdist 90; alias zoom.in zoom.85; alias zoom.out zoom.95";
alias zoom.95 "cam_idealdist 95; alias zoom.in zoom.90; alias zoom.out zoom.100";
alias zoom.100 "cam_idealdist 100; alias zoom.in zoom.95; alias zoom.out zoom.105";
alias zoom.105 "cam_idealdist 105; alias zoom.in zoom.100; alias zoom.out zoom.110";
alias zoom.110 "cam_idealdist 110; alias zoom.in zoom.105; alias zoom.out zoom.115";
alias zoom.115 "cam_idealdist 115; alias zoom.in zoom.110; alias zoom.out zoom.120";
alias zoom.120 "cam_idealdist 120; alias zoom.in zoom.115; alias zoom.out zoom.125";
alias zoom.125 "cam_idealdist 125; alias zoom.in zoom.120; alias zoom.out zoom.130";
alias zoom.130 "cam_idealdist 130; alias zoom.in zoom.125; alias zoom.out zoom.135";
alias zoom.135 "cam_idealdist 135; alias zoom.in zoom.130; alias zoom.out zoom.140";
alias zoom.140 "cam_idealdist 140; alias zoom.in zoom.135; alias zoom.out zoom.145";
alias zoom.145 "cam_idealdist 145; alias zoom.in zoom.140; alias zoom.out zoom.150";
alias zoom.150 "cam_idealdist 150; alias zoom.in zoom.145; alias zoom.out zoom.155";
alias zoom.155 "cam_idealdist 155; alias zoom.in zoom.150; alias zoom.out zoom.160";
alias zoom.160 "cam_idealdist 160; alias zoom.in zoom.155; alias zoom.out zoom.165";
alias zoom.165 "cam_idealdist 165; alias zoom.in zoom.160; alias zoom.out zoom.170";
alias zoom.170 "cam_idealdist 170; alias zoom.in zoom.165; alias zoom.out zoom.175";
alias zoom.175 "cam_idealdist 175; alias zoom.in zoom.170; alias zoom.out zoom.180";
alias zoom.180 "cam_idealdist 180; alias zoom.in zoom.175; alias zoom.out zoom.185";
alias zoom.185 "cam_idealdist 185; alias zoom.in zoom.180; alias zoom.out zoom.190";
alias zoom.190 "cam_idealdist 190; alias zoom.in zoom.185; alias zoom.out zoom.195";
alias zoom.195 "cam_idealdist 195; alias zoom.in zoom.190; alias zoom.out zoom.200";
alias zoom.200 "cam_idealdist 200; alias zoom.in zoom.195; alias zoom.out zoom.205";
alias zoom.205 "cam_idealdist 200; alias zoom.in zoom.200; alias zoom.out zoom.200";
togglezoom.off; c_thirdpersonshoulder 0;
defaultzoom;
Did you experience third person mode? And the amazing mouse wheel zoom?
If you answered 'yes' to both of these questions - CONGRATULATIONS! You've Just created a tripped-out customized autoexec.cfg. Well done!! You may now move on to the next Chapter...
Chapter SIX: Capslock Auto-run, 2-tap walk toggle and 2-tap duck (crouch) toggle scripts
Add these follow snippets of code to your autoexec.cfg. Or if you are feeling daring, put them into their own cfg and exec them from autoexec.
Extra Credit #1: CapsLock Auto-Run
//Auto Run with CapLock
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
bind "CAPSLOCK" "run.toggle" // autorun toggle
bind "W" "+ww" // move forward key used by autorun script (game default)
bind "S" "+ss" // move backwards key used by autorun script (game default)
alias "1run" "dir; alias run.toggle 2run";
alias "2run" "-forward; -back; alias run.toggle 1run";
alias "dir.back" "+back; alias maybestop2 ; echo [autorun backward on]";
alias "dir.forward" "+forward; alias maybestop ; echo [autorun forward on]";
alias "1reverse" "alias dir dir.back";
alias "2reverse" "alias dir +forward";
alias "1forward" "alias dir dir.forward";
alias "2forward" "alias dir +forward";
alias "maybestop2" "-back";
alias "maybestop" "-forward";
alias "+ww" "2run; 1forward; +forward";
alias "-ww" "2forward; maybestop; alias maybestop -forward";
alias "+ss" "2run; 1reverse; +back";
alias "-ss" "2reverse; maybestop2; alias maybestop2 -back";
2reverse;
2forward;
2run;
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
bind "CAPSLOCK" "run.toggle" // autorun toggle
bind "W" "+ww" // move forward key used by autorun script (game default)
bind "S" "+ss" // move backwards key used by autorun script (game default)
alias "1run" "dir; alias run.toggle 2run";
alias "2run" "-forward; -back; alias run.toggle 1run";
alias "dir.back" "+back; alias maybestop2 ; echo [autorun backward on]";
alias "dir.forward" "+forward; alias maybestop ; echo [autorun forward on]";
alias "1reverse" "alias dir dir.back";
alias "2reverse" "alias dir +forward";
alias "1forward" "alias dir dir.forward";
alias "2forward" "alias dir +forward";
alias "maybestop2" "-back";
alias "maybestop" "-forward";
alias "+ww" "2run; 1forward; +forward";
alias "-ww" "2forward; maybestop; alias maybestop -forward";
alias "+ss" "2run; 1reverse; +back";
alias "-ss" "2reverse; maybestop2; alias maybestop2 -back";
2reverse;
2forward;
2run;
Extra Credit #2: Walk and Crouch 2-Tap toggle
//Walk and Crouch 2-Tap toggle
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
bind "SHIFT" "+speeding" // walk 2-tap toggle bind
bind "CTRL" "+ducking" // crouch 2-tap toggle bind
alias "+speeding" "+speed";
alias "-speeding" "speeding.switch";
alias "speeding.switch" "-speed; alias +speeding +speed; alias -speeding +speed; wait 25; alias -speeding speeding.switch; echo [walk toggled]";
alias "+ducking" "+duck";
alias "-ducking" "ducking.switch";
alias "ducking.switch" "-duck; alias +ducking +duck; alias -ducking +duck; wait 25; alias -ducking ducking.switch; echo [crouch toggled]";
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
bind "SHIFT" "+speeding" // walk 2-tap toggle bind
bind "CTRL" "+ducking" // crouch 2-tap toggle bind
alias "+speeding" "+speed";
alias "-speeding" "speeding.switch";
alias "speeding.switch" "-speed; alias +speeding +speed; alias -speeding +speed; wait 25; alias -speeding speeding.switch; echo [walk toggled]";
alias "+ducking" "+duck";
alias "-ducking" "ducking.switch";
alias "ducking.switch" "-duck; alias +ducking +duck; alias -ducking +duck; wait 25; alias -ducking ducking.switch; echo [crouch toggled]";
To be contiued...
For the complete autoexec.cfg created in this blogumentary,
Download L4D2_AutoExec.cfg_sn.zip.
From the Readme:
//-------------------------------------
Left4Dead2 Custom KeyBInds v1.1
by satannuts
Feb 3, 2010
//-------------------------------------
Description:
This package contains a modified config to customize your Left4Dead2 experience.
Some commands may require sv_cheats be set to 1 - in singleplayer or on a server with cheats enabled.
AutoExec.cfg loads custom keybinds at game startup;
ThidPerson.cfg is required for the third person button with mouse-wheel zoom to function.
//-------------------------------------
Install:
Extract to your L4D2\left4dead2\cfg folder. Backup originals if neccasary.
Set sourcemod admin passwords at "setinfo" line in autoexec.cfg using notepad.
//-------------------------------------
Features:
-Includes all default keybindings and noted changes.
-Added Client Network Optimization convars to improve network performance between client and servers.
-Remapped voting [yes/no] to "page up" and "page down" buttons.
-Remapped rifle scope zoom to "c" and voice chat to "v".
-Added third person perspective config and binding [with accuracy fix and mouse wheel zoom]:
bind "q" "thirdperson" //thirdpersons view mode
exec thirdperson.cfg
-Sm_admin is bound to F12 for easy sourcemod admin menu access
[for those with sourcemod/metamod installed]
SourceMod's Admin Menu relies on slots 1 thru 10 for Admin Menu selection/Navigation.
-Added netgraph info to Scoreboard [TAB] button.
-Added Auto-run toggle to CapsLock key and 2-Tap Toggle for Walk/Crouch keys.

0 comments:
Post a Comment