Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just started scripting and have a bunch for spy (to modify the cursor, remove view model, modify sensitivity, rebind keys, etc.). How do I prevent scripts in the spy.cfg class file from spreading to all my other classes?

share|improve this question
up vote 3 down vote accepted

You cannot prevent this due to the way .cfg files work.

What you can do is, if a setting appears in at least one class, write the default setting to all the other class config files.

To go a step further, make a .cfg file with all those default settings and execute it at the beginning of each class config file. No further hacks will be required.

share|improve this answer
"make a .cfg file with all those default settings and execute it at the beginning of each class config file" how do you go about doing this? – I Phantasm I Dec 10 '11 at 1:52
To execute a cfg file from within another cfg file in the same directory, use the exec command: exec some_other_file.cfg – Steve V. Dec 10 '11 at 6:17
exelent ty, do you happen to no the defaoult cursor in tf2 it says none is there a specific command or is this not possible? – I Phantasm I Dec 10 '11 at 6:41

The Solution:

Make a script for each class, and place exec config.cfg at the top of each one.

This config file contains all your default settings, and should clear any key bindings and other assorted changes.

This should unclutter your scripts quite a bit.

Important Note:

Any excessively strange settings you may have created that aren't in the 'default' setup of TF2 may not be undone by this, so you may have to include your own code to undo them.

If this is the case, make a separate config file and place the code to clear them in that file. Then, simply place exec <custom reset script name>.cfg before exec config.cfg in each class script.

share|improve this answer

Your Answer


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.