VCFG: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (SirYodaJedi moved page .vcfg to VCFG)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Valve Configuration file''' (or '''VCFG''') is a {{source2|4}} games text file used to [[exec]]ute a newline-delimited list of [[ConCommand|console command]]s to the [[Developer Console]]. The '''.vcfg''' file extension can be found everywhere and is not specific to Source.
'''Valve Configuration file''' (or '''VCFG''') is a {{source2|4}} games text file used to [[exec]]ute a newline-delimited list of [[ConCommand|console command]]s to the [[Developer Console]]. The '''.vcfg''' file extension can be found everywhere and is not specific to Source. Some Source 2 games (such as {{hla|1}}), still features {{code|.cfg}} file extension in some files (such as {{code|skill.cfg}}).


{{ModernTip|It can be useful to keep situational key[[bind]]s in files other than autoexec.cfg.}}
{{tip|It can be useful to keep situational key[[bind]]s in files other than autoexec.cfg.}}


{{ModernConfirm|What exactly happens after exec autoexec.cfg.}}
{{ModernConfirm|What exactly happens after exec autoexec.cfg.}}
Line 20: Line 20:
|-
|-
| '''[[autoexec|autoexec.vcfg]]''' || 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.vcfg]]''' || 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.
|-
| '''modsettings.vcfg''' || Ran on game start up, unless not found in mod folder.
|-
| '''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#vcfg.2Fconfig_default.vcfg|config_default.vcfg]]''' || 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]].
|-
| '''chapter#.vcfg''' || Ran when the player picks the chapter, with # being the chapter number, see [[Adding chapters to your mod]].
|-
|-
| '''game.vcfg''' || Ran every time a map is loaded.
| '''game.vcfg''' || Ran every time a map is loaded.
|-
|-
| '''sourcevr_modfoldername.vcfg''' || {{src13|since}} Ran when the player enables VR, replace modfoldername with the name of your folder that [[gameinfo.txt]] is in.
| '''modsettings.vcfg''' || Ran on game start up, unless not found in mod folder.
|-
|-
| '''skill_manifest.vcfg''' || Runs every time the map is changed, used to list the skill.cfgs to execute.
| '''listenserver.vcfg''' || Ran when a listen server is being started, and runs every time the map is changed.
|-
| '''360controller.vcfg''' || Used for players using {{360|4}} controllers, lists the controls for the controller. Automatically executed when player enable Gamepad support in game options.
|-
| '''360controller-linux.vcfg''' || Used for players using {{360|4}} controllers on Linux systems, lists the controls for the controller. {{confirm|executed after 360controller.cfg.}}
|-
| '''undo360controller.vcfg''' || Used for players using {{360|4}} controllers when they want to undo the effects of the controller. {{todo|Find out when this is executed.}}
|-
|-
| '''listenserver.vcfg''' || Ran when a listen server is being started, and runs every time the map is changed.
| '''user_keys_default.vcfg''' || Ran when the following file is not present:
{{Cs2}} {{code|config.cfg}} (in {{Path|Steam folder\userdata\[[SteamID]]\730\local\cfg\}})</br>
{{Cs2}} {{code|cs2_user_keys_0_slot0.vcfg}} (in {{Path|Steam folder\userdata\[[SteamID]]\730\local\cfg\}})</br>
{{Cs2}} {{code|cs2_user_keys.vcfg}} (in {{Path|Steam folder\userdata\[[SteamID]]\730\remote}})</br>
{{hla}} {{code|user_keys_0_slot*.vcfg}}</br>
or when player reset Keyboard settings in game Settings/Options.
|-
|-
| '''server.vcfg''' || Ran when a dedicated server is being started, and runs every time the map is changed.
| '''user_keys_dev_default.vcfg''' || Ran when no user_keys_default.vcfg is present or when player clicks the 'Use Defaults' button in the keyboard tab in the options panel, see [[Customizing Options: Keyboard]].
|-
|-
| '''[[valve.rc]]''' || Special vcfg file with the .rc extension, it's ran on game start up and executes autoexec.cfg along with a few other commands.
| '''[[valve.rc]]''' || Special vcfg file with the .rc extension, it's ran on game start up and executes autoexec.cfg along with a few other commands.
|-
|-
|}
|}
[[Category:File formats]]

Latest revision as of 10:51, 10 February 2025

Valve Configuration file (or VCFG) is a Source 2 Source 2 games text file used to execute a newline-delimited list of console commands to the Developer Console. The .vcfg file extension can be found everywhere and is not specific to Source. Some Source 2 games (such as Half-Life: Alyx), still features .cfg file extension in some files (such as skill.cfg).

Tip.pngTip:It can be useful to keep situational keybinds in files other than autoexec.cfg.
Confirm:What exactly happens after exec autoexec.cfg.

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.vcfg 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.
game.vcfg Ran every time a map is loaded.
modsettings.vcfg Ran on game start up, unless not found in mod folder.
listenserver.vcfg Ran when a listen server is being started, and runs every time the map is changed.
user_keys_default.vcfg Ran when the following file is not present:

Counter-Strike 2 config.cfg (in 🖿Steam folder\userdata\SteamID\730\local\cfg\)
Counter-Strike 2 cs2_user_keys_0_slot0.vcfg (in 🖿Steam folder\userdata\SteamID\730\local\cfg\)
Counter-Strike 2 cs2_user_keys.vcfg (in 🖿Steam folder\userdata\SteamID\730\remote)
Half-Life: Alyx user_keys_0_slot*.vcfg
or when player reset Keyboard settings in game Settings/Options.

user_keys_dev_default.vcfg Ran when no user_keys_default.vcfg is present or when player clicks the 'Use Defaults' button in the keyboard tab in the options panel, see Customizing Options: Keyboard.
valve.rc Special vcfg file with the .rc extension, it's ran on game start up and executes autoexec.cfg along with a few other commands.