Counter-Strike – Do I Have to Use ‘userconfig.cfg’ Instead of ‘autoexec.cfg’?

counter-strike

Written in config.cfg created by the game:

// This file is overwritten whenever you change your user settings in the game.
// Add custom configurations to the file "userconfig.cfg".

As an CS:GO player I created autoexec.cfg text file of habit, but noticed that some, not all, commands don't work. In particular the commands starting with cl_ aren't executed.
Is userconfig.cfg CS' equivalent to autoexec.cfg?

Best Answer

You can name it whatever you want, as long as you have exec <filename>.cfg in your config. It's a bit of a habit to name it autoexec or userconfig (because there was an empty file with that name when the game was newly installed), but it doesn't matter. You can even have multiple config files for different purposes. (I have buy scripts in a separate file, movement stuff in another one and game settings in another one again.) In CS it was common to load the autoexec file via command line parameter as well. And even there you could use any given name, as long as you typed it correctly.

Just make sure you don't overwrite your own config. The game will load the cvars in the order they come:

config.cfg:

exec customfile.cfg
...
cl_some_cvar 1
...

customfile.cfg:

...
cl_some_cvar 0
...

This will set your cvar to 1, because your custom file is executed first.

config.cfg:

cl_some_cvar 1
...
exec customfile.cfg

This will overwrite the cvar with the value of your custom config (0).
So it doesn't necessarily mean the cvars don't work in your config. They could just be overwritten by another config.

TL;DR:
Put exec someconfigname.cfg on the bottom of your config.cfg and it will work as intended. The file name doesn't matter, as long as the game can identify it.