TransWikia.com

Autoexec and host_writeconfig

Arqade Asked by VoidSixx on August 14, 2021

Ok, so I have two questions.

Question 1

I am trying to create an autoexec. But the problem is, it isn’t running the settings that change any commands.

I don’t think the problem is the autoexec not executing, because it runs the echo commands that I have in it. The problem is that I have lines such as "voice_enable 0" (without the " "), but they don’t run. If I enable voice and then restart the game, it’s still enabled when the game loads up again.

I know the game is reading the line, because if I put " " either side of the command in the autoexec, it says it’s an unknown command. I tried setting m_raw to 0 and restarting the game, to see if it was just that command, but that also stayed off despite m_raw 1 being in the autoexec.

My .cfg file is in steamappscommonCounter-Strike Global Offensivecsgocfg, as I’m the only user and steam account on the PC. I saw some posts saying that it changed to userdatauserID703 or something similar, but that doesn’t work for me and I’m guessing that’s for if you have multiple steam accounts in use.

Another point is that if I start the game and then force autoexec to run again by typing exec autoexec, the echo commands run as usual, but then so do the other commands like m_raw etc.

So my question is: Why are the commands not running, and how can I fix it?

Question 2

If i understand correctly, "host_writeconfig FileName" should create a .cfg file with all my current settings in it. But when I run the command, it’s not creating the file. I’ve looked in the same place as my autoexec, which I think is where it’s supposed to be, but it’s not there.

So where is it?

One Answer

While the game may read your autoexec file it is important to have it read in the correct order, if you store settings in there. Executing it doesn't matter if the settings get overwritten by your config.cfg or other configs loaded after it. If you have more than one config including the same settings with different values the last one wins. Always.

If you want to make sure to have it included properly add the line exec autoexec.cfg at the end of your config.cfg.

Question 2 does exactly what it states. It writes your settings(!) into the given file (stored in your config directory). It does only save settings, not aliases and stuff like that. Also you need to make sure you haven't write-protected your config folder (and that file if it exists). Writing something without write permissions won't work.

Solution:

  • make sure your configs and the containing folder are not set to read-only
  • autoexec.cfg can be created with `host_writeconfig, but it's not recommended
  • add only binds and aliases, etc to your autoexec - no settings
  • create a config with host_writeconfig to include your settings there

Answered by dly on August 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP