Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

Ive seen plenty of simple scripts, such as "toggle crouch" and etc. that are basically a single row of a bind command.

Ive also seen 30+ rows of command that have something to do with some script files (which i assume are somewhere in the TF2 directory.

So, my question is, how do I implement... um... lets use THIS script as an example:

// Spy Attack and Disguise
// =======================
alias +spy_attackdisguise "+attack"
alias -spy_attackdisguise "-attack; lastdisguise"

bind "MOUSE1" +spy_attackdisguise

Also, as an addition to this script, I'd like to know how I can activate/deactivate it with the press of F1.

(my assumption is that you can store a script file and bind its activation and deactivation to the F1 key, probably using the console. P.S. I have no idea what im talking about)

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The basic answer is you'd create a config file, put it in the proper place, and then "exec" it when you want to use it.

First, you have to create the file. Any text editor will do, but if you're just using Notepad, I'd suggest upgrading to something like Notepad++.

Enter whatever commands you want to execute (in this case, the block of commands you've already come up with) and then save the file in:

C:\Program Files\Steam\steamapps\ (YOUR ACCOUNT NAME) \team fortress 2\tf\cfg

Once this is done, you can execute the config file by opening the console and typing:

 exec myconfigname.cfg

This will run whatever commands are in the file.

Since you can bind commands to keyboard keys, you can extend this to "exec" commands by pressing keys, for instance:

 bind "KP_5" "exec myconfigname.cfg"

would make the 5 key on your keypad execute the config file "myconfigname.cfg". Since config files can rebind keys, you can get pretty fancy with turning things on and off - bind a key in each config file that cycles through your configs, for instance.

There's a lot of power in the console (and, by extension, config files) - there's a good tutorial on the Steam forums here which I referenced in making this answer.

share|improve this answer
    
I was kind of reading that tutorial at this moment XD. Well, thanks for the info mate. –  ChaosPointDK Jun 11 '12 at 20:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.