CFG: Difference between revisions
Jump to navigation
Jump to search
Tip:It can be useful to keep situational keybinds in files other than autoexec.cfg.
Confirm:What exactly happens after exec autoexec.cfg.
(add userconfig.cfg) |
(alphabetize) |
||
Line 22: | Line 22: | ||
| '''[[autoexec|autoexec.cfg]]''' || Ran on game start up, so one can easily create the file and put any commands that one doesn't want to type each time. | | '''[[autoexec|autoexec.cfg]]''' || Ran on game start up, so one can easily create the file and put any commands that one doesn't want to type each time. | ||
|- | |- | ||
| ''' | | '''chapter#.cfg''' || Ran when the player picks the chapter, with # being the chapter number, see [[Adding chapters to your mod]]. | ||
|- | |- | ||
| '''config.cfg''' || Ran on game start up, this is created automatically when the player runs the game/mod for the first time. {{note| On game quit, key binds in this file will be re-written to current bindings, so making changes to this file is most likely pointless.}} | | '''config.cfg''' || Ran on game start up, this is created automatically when the player runs the game/mod for the first time. {{note| On game quit, key binds in this file will be re-written to current bindings, so making changes to this file is most likely pointless.}} | ||
|- | |- | ||
| '''[[Customizing_Options:_Keyboard#cfg.2Fconfig_default.cfg|config_default.cfg]]''' || Ran when no config.cfg is present or when player clicks the 'Use Defaults' button in the keyboard tab in the options panel, see [[Customizing Options: Keyboard]]. | | '''[[Customizing_Options:_Keyboard#cfg.2Fconfig_default.cfg|config_default.cfg]]''' || Ran when no config.cfg is present or when player clicks the 'Use Defaults' button in the keyboard tab in the options panel, see [[Customizing Options: Keyboard]]. | ||
|- | |- | ||
| '''360controller.cfg''' || Used for players using {{360|4}} controllers, lists the controls for the controller. Automatically executed when player enable Gamepad support in game options. | | '''360controller.cfg''' || Used for players using {{360|4}} controllers, lists the controls for the controller. Automatically executed when player enable Gamepad support in game options. | ||
Line 41: | Line 33: | ||
|- | |- | ||
| '''undo360controller.cfg''' || Used for players using {{360|4}} controllers when they want to undo the effects of the controller. {{todo|Find out when this is executed.}} | | '''undo360controller.cfg''' || Used for players using {{360|4}} controllers when they want to undo the effects of the controller. {{todo|Find out when this is executed.}} | ||
|- | |||
| '''game.cfg''' || Ran every time a map is loaded. | |||
|- | |- | ||
| '''listenserver.cfg''' || Ran when a listen server is being started, and runs every time the map is changed. | | '''listenserver.cfg''' || Ran when a listen server is being started, and runs every time the map is changed. | ||
|- | |||
| '''modsettings.cfg''' || Ran on game start up, unless not found in mod folder. | |||
|- | |- | ||
| '''server.cfg''' || Ran when a dedicated server is being started, and runs every time the map is changed. | | '''server.cfg''' || Ran when a dedicated server is being started, and runs every time the map is changed. | ||
|- | |- | ||
| ''' | | '''skill_manifest.cfg''' || Runs every time the map is changed, used to list the skill.cfgs to execute. | ||
|- | |||
| '''sourcevr_modfoldername.cfg''' || {{src13|since}} Ran when the player enables VR, replace modfoldername with the name of your folder that [[gameinfo.txt]] is in. | |||
|- | |- | ||
| '''userconfig.cfg''' || Ran on game start up, for "custom configurations", as a comment in config.cfg describes it. The pre-Steam version of Half-Life does not load it automatically, and users place configurations in autoexec.cfg instead. ([https://wiki.sourceruns.org/wiki/Setting_up_userconfig_file rumor]) | | '''userconfig.cfg''' || Ran on game start up, for "custom configurations", as a comment in config.cfg describes it. The pre-Steam version of Half-Life does not load it automatically, and users place configurations in autoexec.cfg instead. ([https://wiki.sourceruns.org/wiki/Setting_up_userconfig_file rumor]) | ||
|- | |||
| '''[[valve.rc]]''' || Special cfg file with the .rc extension, it's ran on game start up and executes autoexec.cfg along with a few other commands. | |||
|} | |} | ||
Revision as of 16:58, 18 June 2024
Configuration file (or CFG) is a Source games text file used to execute a newline-delimited list of console commands to the Developer Console. The .cfg file extension can be found everywhere and is not specific to Source.


File format
- Each line is considered a command. Note that each command can still consist of multiple commands delimited with the semicolon
;
. - Comments can be added by using
//
. These two characters and everything following after them is ignored by the engine until the next line starts. - Cheat commands require sv_cheats 1 enabled, otherwise they have no effect. To configure a mod's default cheat convars, VScript or point_servercommand can achieve this on map start without having to enable sv_cheats.
Files
The folder <game>/cfg/
is usually dedicated to CFG files and can be further organized in subdirectories, and referred in exec by relative path.
This is a table listing common CFG files found in mods and games alike.
CFG | Description |
---|---|
autoexec.cfg | Ran on game start up, so one can easily create the file and put any commands that one doesn't want to type each time. |
chapter#.cfg | Ran when the player picks the chapter, with # being the chapter number, see Adding chapters to your mod. |
config.cfg | Ran on game start up, this is created automatically when the player runs the game/mod for the first time. ![]() |
config_default.cfg | Ran when no config.cfg is present or when player clicks the 'Use Defaults' button in the keyboard tab in the options panel, see Customizing Options: Keyboard. |
360controller.cfg | Used for players using ![]() |
360controller-linux.cfg | Used for players using ![]() ![]() |
undo360controller.cfg | Used for players using ![]() Todo: Find out when this is executed.
|
game.cfg | Ran every time a map is loaded. |
listenserver.cfg | Ran when a listen server is being started, and runs every time the map is changed. |
modsettings.cfg | Ran on game start up, unless not found in mod folder. |
server.cfg | Ran when a dedicated server is being started, and runs every time the map is changed. |
skill_manifest.cfg | Runs every time the map is changed, used to list the skill.cfgs to execute. |
sourcevr_modfoldername.cfg | (in all games since ![]() |
userconfig.cfg | Ran on game start up, for "custom configurations", as a comment in config.cfg describes it. The pre-Steam version of Half-Life does not load it automatically, and users place configurations in autoexec.cfg instead. (rumor) |
valve.rc | Special cfg file with the .rc extension, it's ran on game start up and executes autoexec.cfg along with a few other commands. |
See also
- Mini-mod tutorial
- vtest - Alternative to cfg files.
- alias
- echo