How do you prevent specific class scripts from transfering to all classes?

How do you prevent specific class scripts from transfering to all classes? - Top view of crop anonymous person holding toy airplane on colorful world map drawn on chalkboard

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?"

How do you prevent specific class scripts from transfering to all classes? - From above of crop anonymous person driving toy airplane on empty world map drawn on blackboard representing travel concept
How do you prevent specific class scripts from transfering to all classes? - Set of gratitude message for doctors with stethoscope and hearts
How do you prevent specific class scripts from transfering to all classes? - Picture of cock painted with watercolors placed on table








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.cfg
  • pyro.cfg
  • soldier.cfg
  • demoman.cfg
  • heavyweapons.cfg
  • engineer.cfg
  • medic.cfg
  • spy.cfg
  • sniper.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