Half-Life 2: Update

Half-Life 2: Update

View Stats:
Autoexec.cfg doesn't work?
Title. I'm just trying to get the game to automatically load a viewmodel_fov command, but autoexec.cfg, nor userconfig.cfg work.
< >
Showing 1-15 of 21 comments
my autoexec.cfg works fine.

Where have you put the file? It should be in steamapps/common/<Game Folder>/hl2/cfg/

Also, I don't know if HL2 (and by extension, HL2 Update) even has a viewmodel_fov command. It may be that your autoexec works just fine, but the command doesn't actually exist. Can you bring up the console and type the command manually? Does it work?
Yes, the command exists.
Cool. That means your autoexec is probably in the wrong place. Where is it located?
hl2/cfg/
strange.

Do you have "hide extensions for known file types" turned off in windows explorer? It might be called autoexec.cfg.txt
Nope, it's a cfg.
Well then I am well and truly stumped
"Just Harry" Mar 30, 2018 @ 7:39pm 
Try adding 'exec autoexec.cfg' to the end of 'config.cfg'.
Nathan Apr 2, 2018 @ 2:48am 
Also adding "-autoexec" to the launch command line works.
Freq Apr 2, 2018 @ 1:27pm 
Isn't viewmodel_fov is a cheat command in HL2?
Last edited by Freq; Apr 2, 2018 @ 1:27pm
meatscapes Nov 25, 2019 @ 7:20pm 
Some commands get reset every time you load a map. It probably is running, but only executing on the main menu screen, and then getting reset when you actually load up a save file or a new game. Try adding this line to your autoexec: echo "AUTOEXEC RUNNING SUCCESSFULLY!!!" . Then load up the game, and on the main menu bring up the dev console, and if you see your message somewhere in there, that means autoexec.cfg is working 100% as intended, but your settings then get overwritten when a map is loaded. I'm not sure where these settings are stored that get loaded on every map, unfortunately.

But what you CAN do is bind a key to your autoexec file. Add these lines to your autoconfig:

alias run "exec autoexec"
(in my testing you don't need the .cfg extension here)
bind tab run


i don't know if run is a reserved word already, so if that dosen't work just try a different alias. after you add these lines, all you have to do is remember to press tab every time a new map loads and you're in business!! no more messing around in the dev console breaking immersion :)
Last edited by meatscapes; Nov 25, 2019 @ 7:31pm
I know for a fact Autoexec works because I have been using a complex cfg-based input system for years (so I can do things like hold F to select the crowbar, and pressing Q will ignore the crowbar selection), and it has always worked fine.

That make me think that it's probably either a cheat command, or it's being reset.

To test if it's a cheat, try typing the command manually in the console. If it says "sv_cheats must be enabled to use this command" or something similar, then you found your problem and should enable sv_cheats (doing this WILL disable achievements, so don't do it in your Lambda Locator run).

If it's not a cheat command, but gets reset every map, you should instead create a bind for it, I would bind it to the W key since that naturally gets pressed quite a lot.

The bind would look like this (add it to your autoexec instead of the viewmodel_fox line):

alias "+fix_fov_and_move" "+forward;viewmodel_fov 90" alias "-fix_fov_and_move" "-forward" bind "w" "+fix_fov_and_move"
Last edited by Epic Store Exclusive; Dec 4, 2019 @ 7:53pm
deV Dec 13, 2019 @ 2:41am 
I'm just a little late to the party but the autoexec.cfg for Half Life 2 Update mod goes in:
C:\Program Files (x86)\Steam\steamapps\common\Half-Life 2 Update\hl2\cfg
or it won't work.
seaque Dec 2, 2020 @ 12:19am 
For some reason you can't change viewmodel via autoexec. You need to bind a key to it which is the very thing i don't wanna do. Why is it so hard to change default viewmodel_fov?
Originally posted by seaque:
For some reason you can't change viewmodel via autoexec. You need to bind a key to it which is the very thing i don't wanna do. Why is it so hard to change default viewmodel_fov?

If that's the case, why not do something like this in your autoexec

alias "+forward_fix" "+forward;viewmodel_fov 110"
alias "-forward_fix" "-forward"
bind "w" "+forward_fix"
Last edited by Epic Store Exclusive; Dec 5, 2020 @ 10:17pm
< >
Showing 1-15 of 21 comments
Per page: 1530 50