Xonotic Forums
[SOLVED] Prevent cmds and .cfgs from being permanent? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Configuration Tips (https://forums.xonotic.org/forumdisplay.php?fid=19)
+--- Thread: [SOLVED] Prevent cmds and .cfgs from being permanent? (/showthread.php?tid=2448)



[SOLVED] Prevent cmds and .cfgs from being permanent? - rocknroll237 - 12-16-2011

Hi guys,

Whenever I add a new line of code, or exec a .cfg file, it seems to be enabled every time I load Xonotic. Then, the only way to get rid of a line of code is to delete it from a .cfg file in the save game folder (btw, I'm Windows 7).

Is there a way to input code that only affects the game once and must be enabled each time you start the game?

Thanks,

Cam


RE: Prevent cmds and .cfgs from being permanent? - Mr. Bougo - 12-16-2011

Uh, I'm not sure what you're asking there? So here's a small explanation of how things work in Xonotic:

When DarkPlaces is launched, it looks for a file called quake.rc in its filesystem (it's most probably in your data pk3 or uncompressed in your git repo).
This in turn executes these files in order:
Code:
default.cfg
config.cfg
data/campaign.cfg
config_update.cfg
font-xolonium.cfg
autoexec/*.cfg
autoexec.cfg

The autoexec files can be created by you to store commands in a file that isn't touched by the game.
config.cfg is where the game saves its configuration when you quit. More precisely, it stores cvars that are declared with the store flag (I believe this is enabled by the seta command). You should not edit this file because it is regenerated every time the game quits. That's why there is autoexec.cfg.

So, what is it you're talking about? This sequence above is all that the game execs when it starts. It does not remember what cfg files you've exec'd before to re-exec them later. Other cfg files are only exec'd from inside those files mentioned above.


RE: Prevent cmds and .cfgs from being permanent? - rocknroll237 - 12-16-2011

I didn't really make myself very clear Tongue

Basically, I created a brand new config file (entitled effects.cfg) with these commands:

cl_playerdetailreduction 5
cl_projectiles_sloppy 1
cl_gibs_lifetime 3
cl_gibs_maxcount 30

I executed the config file in Xonotic ('exec effects.cfg') and ever since, the commands in the config are activated even when I don't type in 'exec effects.cfg'.

I was just wondering if there was a way of preventing the config from being activated automatically each time I start Xonotic.

(Btw, the same applies for text entered manually in Xonotic - it is always activated automatically, whenever I start the game.)


RE: Prevent cmds and .cfgs from being permanent? - Mr. Bougo - 12-16-2011

That is because it saved the new cvar values into your config.cfg. You have two options:
-Make config.cfg read-only so that no configuration is saved at all, and instead manage your config manually in autoexec.cfg
-Have autoexec reset those four cvars to their default values or something like that

Your config is not loaded automatically at all. Your config affects the settings which are in turn saved. So does setting cvars through the console.


RE: Prevent cmds and .cfgs from being permanent? - rocknroll237 - 12-16-2011

I made config.cfg read only and it works!

Thank you very much Mr. Bougo.


RE: Prevent cmds and .cfgs from being permanent? - Mr. Bougo - 12-17-2011

Don't forget that no config changes will be saved now, heh Smile
So if you bind a key, you'll lose the bind when you quit. Personally I prefer it that way.


RE: Prevent cmds and .cfgs from being permanent? - rocknroll237 - 12-17-2011

Yeah. Whenever I want to save a cmd or bind, I disable read-only. Whenever I want a cmd or bind to work temporarily I enable read-only. Simples :-)