How to Apply Scripts in the Source Engine
This is a tutorial showing people how to apply scripts to the Source Engine.
This tutorial applies to games such as CSS, TF2, HL2 and so on.
Bare in mind that more complex scripts will occasionally need you to follow specific instructions for that script... so they should come with there own instructions.
Firstly you are going to have to create an autoexec if you have not already.
Follow the steps below to create one :
1. Navigate to the cfg folder for which ever game/mod you want to add a script for.
The default location for
mod cfg folders is :
C : \ Program files \ Steam (or Valve) \ Steamapps \ SourceMods \ (Mod name) \ cfg
The default location for
game cfg folders is :
C : \ Program files \ Steam (or Valve) \ Steamapps \ YourUserName \ (Game name) \ (Game name abbreviation) \ cfg
2. Open the file called config. If you are having problems doing that right click it and select Open With and open it with Wordpad
3. Now go to File , Save As and save it in the cfg folder as :
autoexec.cfg (make sure you put .cfg after autoexec when you rename it)
When you look at the two files, autoexec and config, in the cfg folder they should both have the same icon. If not you have done something wrong, see pic below.
If you have done the above steps correctly then you have created your autoexec.cfg
Follow the final steps beneath to enable the script you chose.
1. Now you need to copy and paste the script you wish to use into the autoexec
2. Once you have put the script you wish to use in your autoexec, close it and click Yes to save.
Dont forget to change the key which the script uses if you wish to.
3. Go and test it out. If the script doesn't work then make sure you have done everything correctly, and it if still doesn't work contact the author of the script !
___________________________________
*Edit*
My TFC reload script didnt work for TF2, however, I did test one that does work (see below) but for using pistols, it sucks.. kinda. It wants to reload after every shot so unless you shoot really fast and unload it, it'll be a prob. But it works...
TF2 AutoReload script Movement based
alias "aron" "alias +goF +onF;alias +goB +onB;alias +goR +onR;alias +goL +onL;alias -goF -onF;alias -goB -onB;alias -goR -onR;alias -goL -onL;alias auto aroff"
alias "aroff" "alias +goF +offF;alias +goB +offB;alias +goR +offR;alias +goL +offL;alias -goF -offF;alias -goB -offB;alias -goR -offR;alias -goL -offL;alias auto aron"
alias "+offF" "+forward"
alias "+offB" "+back"
alias "+offR" "+moveright"
alias "+offL" "+moveleft"
alias "-offF" "-forward"
alias "-offB" "-back"
alias "-offR" "-moveright"
alias "-offL" "-moveleft"
alias "+onF" "+forward;+reload"
alias "+onB" "+back;+reload"
alias "+onR" "+moveright;+reload"
alias "+onL" "+moveleft;+reload"
alias "-onF" "-forward;wait;-reload"
alias "-onB" "-back;wait;-reload"
alias "-onR" "-moveright;wait;-reload"
alias "-onL" "-moveleft;wait;-reload"
aron //Initialize Script - on by default
bind "W" "+goF" //Movement Forward
bind "S" "+goB" //Movement Back
bind "D" "+goR" //Movement Right
bind "A" "+goL" //Movement Left
bind "O" "auto" //Toggle auto-reload
_________________________________
This is my
TFC AutoReload script if anyone is interested in usung it. It works great, never gave me any problems. Great script.
alias +f "+forward; +reload"
alias -f "-forward; +reload;wait; -reload"
alias +b "+back; +reload"
alias -b "-back; +reload;wait; -reload"
alias +l "+moveleft; +reload"
alias -l "-moveleft; +reload;wait; -reload"
alias +r "+moveright; +reload"
alias -r "-moveright; +reload;wait; -reload"
_______________________________________
Rocket Jump Script for TF2
//Rocket Jump
alias +rocketjump "+jump; +duck; wait; +attack"
alias -rocketjump "-jump; -attack; wait; wait; wait; -duck"
bind "MOUSE5" "+rocketjump"
____________________________________
All-in-One Engineer Build/Destroy Script for TF2
*Note* I dont have a build script for engy, this isnt mine, I dont know if it works..
This uses the destroy PDA to avoid accidents.
This script is also more responsive than that above (no delay between releasing the key and the buildable actually going up), but brings back the occasional shotgun fire after building. I figure the occasional shotgun-blast is worth it for the added responsiveness. Could probably be tweaked to be just as responsive but without the blast, but I don't see the need.
Rewritten by Klaymen, based on script by 1 of 9.
// ### Build quick-bind...
// holding down key will show blueprint for new building (if you didn't already build it)
// releasing key will build building in new chosen position
// =====================================================================================
alias +sentry "use tf_weapon_wrench; build 3"
alias -sentry "+attack; wait 50; -attack; use tf_weapon_shotgun_primary"
alias +dispenser "use tf_weapon_wrench; build 0"
alias -dispenser "+attack; wait 50; -attack; use tf_weapon_shotgun_primary"
alias +entry "use tf_weapon_wrench; build 1"
alias -entry "+attack; wait 50; -attack; use tf_weapon_shotgun_primary"
alias +exit "use tf_weapon_wrench; build 2"
alias -exit "+attack; wait 50; -attack; use tf_weapon_shotgun_primary"
bind "1" "+sentry"
bind "2" "+dispenser"
bind "3" "+entry"
bind "4" "+exit"
bind "5" "use tf_weapon_pda_engineer_destroy"
Here's a second All-in-One script..
All in One "Boomode" Key
Four binds for building, one bind to change those four binds to destroy. Prevents accidents!
This script no longer requires weapon selection to switch between buildings without actually building them (Valve fixed a bug causing this problem).
Rewritten by Essobie.
// Build and Destroy "Boomode" System
// ==================================
alias eng_destroybuild_0 "destroy 0; build 0"
alias eng_destroybuild_1 "destroy 1; build 1"
alias eng_destroybuild_2 "destroy 2; build 2"
alias eng_destroybuild_3 "destroy 3; build 3"
alias +eng_destroy "alias eng_dispen eng_destroybuild_0; alias eng_tpentr eng_destroybuild_1; alias eng_tpexit eng_destroybuild_2; alias eng_sentry eng_destroybuild_3"
alias -eng_destroy "alias eng_dispen build 0; alias eng_tpentr build 1; alias eng_tpexit build 2; alias eng_sentry build 3"
-eng_destroy
bind "SHIFT" "+eng_destroy" // Swap all build binds to destroy binds.
bind "1" "eng_sentry" // Build Sentry (Destroy Sentry when +eng_destroy is held down)
bind "2" "eng_dispen" // Build Dispenser (Destroy Dispenser when +eng_destroy is held down)
bind "3" "eng_tpentr" // Build Teleporter Entrance (Destroy Teleporter Entrance when +eng_destroy is held down)
bind "4" "eng_tpexit" // Build Teleporter Exit (Destroy Teleporter Exit when +eng_destroy is held down)
Auto Upgrade
//HOLD DOWN MOUSE3 TO SWING WRENCH FOR UPGRADE THEN LETTING GO SWITCHES BACK TO LAST WEAPON
alias +upgrade1 "slot3; +attack; wait 5; -attack; wait 5; +attack"
alias -upgrade1 "-attack; wait; lastinv"
bind "mouse3" "+upgrade1" //Leaves mouse2 to still rotate the sentry placement
_____________________________________
Medic Heal toggle script
**Removed due to update, Check you multiplayer tab, there's an option there for it.
_________________________________
Melee Attack
Global Melee Weapon Switch & Attack
**Removed.. Didnt work correct.
______________________________________
Another Melee and Auto Attack incase the other one dosent work..
Press bound key (I use mouse button 3 in this example) to whip out your melee weapon and start busting some butt, automatic-style!
//Melee Toggle and Auto-Buttwhoopin'
alias meleetoggle melee1
alias melee1 "slot3; +attack; alias meleetoggle melee2"
alias melee2 "-attack; slot1; alias meleetoggle melee1"
//Variant to pop a shot when you switch back
alias meleetoggle melee1
alias melee1 "slot3; +attack; alias meleetoggle melee2"
alias melee2 "-attack; slot1; alias meleetoggle melee1; +attack; wait 200; -attack"
//Automelee Toggle Keybind
bind mouse3 meleetoggle
______________________________________
Here's a battlecry script, enables each class to do their "battlecry" when you attack.
BattleCry Script
//battlecry script
alias battlecry "menuselect 0; voice_menu_3; menuselect 2; menuselect 0"
bind mouse1 "+attack;battlecry"
(the menu stays on the screen sometimes but its still awesome.)
__________________________________
*I made this battlecry script, got kinda crazy hearing it every time I hit the fire key, so I bound it to +jump.
//battlecry
alias battlecry "menuselect 0; voice_menu_3; menuselect 2; menuselect 0"
bind SPACE "+jump;battlecry"
**I love this battlecry script, funny as hell.
<3 pyro
___________________________________
I'll find some more later, post em if ya got em.
*It seems that most of the old TFC binds work in TF2 as well. There may be some tweaking required to get some of them to work correctly.