How do you prevent specific class scripts from transfering to all classes?
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?
Best Answer
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.
Pictures about "How do you prevent specific class scripts from transfering to all classes?"



More answers regarding how do you prevent specific class scripts from transfering to all classes?
Answer 2
Create reset.cfg file in ~\Team Fortress 2\tf\cfg, it resets all the values you change in your various class configs.
Then, add exec reset.cfg as the top line to all 9 class config files:
scout.cfgpyro.cfgsoldier.cfgdemoman.cfgheavyweapons.cfgengineer.cfgmedic.cfgspy.cfgsniper.cfg
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Andrea Piacquadio, Andrea Piacquadio, Karolina Grabowska, Julia Volk
