What is a Cleanup up script?
A cleanup script is a script in it's own config file (cleanup.cfg) that is essentially a config created to unbind keys that you use to do something different for two or more classes. This is important because sometimes you can actually confuse the game by not unbinding your keys. This in turn can result in you not being able to execute the desired action in game and can be detrimental to your success as a player.
An example of a set of scripts that would fall into this category is:
//in scout.cfg bind mouse4 "+duck"
//in demoman.cfg bind mouse4 "+attack2"
- In the example we are using the same key (mouse4) to duck for a scout and to use the secondary attack for a demo.
What exactly does a cleanup.cfg do?
A cleanup.cfg is simply a NEW .cfg file created by you to "cleanup" your configs and binds.
Example of a cleanup.cfg
echo Clean Up Config Loaded unbind mwheelup unbind mwheeldown unbind alt unbind mouse2 unbind mouse3 unbind mouse4 unbind mouse5 unbind f unbind g unbind shift unbind ctrl
You will notice that in the example, there are a lot of commands in there. This is because each of those keys are hypothetically being used to preform separate commands depending on the class that is being played. Yours may not be as large or it may be larger, that depends on the scripts you are using.
Creating a cleanup.cfg
To create a cleanup.cfg you will need to have notepad (notepad NOT wordpad).
Open a blank notepad document and place this line at the top:
echo Clean Up Config Loaded
- this will let you know in console that your .cfg has been successful in loading
Next you will need to place any and all keys that you wish to unbind here. For instance if you use c, d, 3, and mouse2 as different things for two or more scripts then you will want to place these here.
YOU WILL NEED A SEPARATE LINE FOR EACH KEY!
Using the keys from above your hypothetical cleanup.cfg would look like this:
echo Clean Up Config Loaded unbind c unbind d unbind 3 unbind mouse2
Once you have put all the keys into your cleanup.cfg you need to save this AS A CONFIG FILE.
To do this, go to file, saveas and navigate to your cfg folder:
When saving the document it is important that you save it as cleanup.cfg (include the .cfg in the filename or it will not save properly!)
The last step is to execute your cleanup.cfg. To do this place the following line into each <classname>.cfg. You can find a copy of the default <classname>.cfg's in the Category:Default_Configs section of this wiki.
- This line needs to be at the TOP of each <classname>.cfg before any scripts you have, but below the line: echo <classname> CFG LOADED
To test your cleanup.cfg join a game (or create a server) and choose a class. Then check your console (~) and look for a line that says:
Clean Up Config Loaded
You should see this at or near the bottom of your console. If you cannot find this line then you will need to go back through the steps above.