Forum

Page 1 of 1

[FTE]Saving custom cfg error

PostPosted: Sat Feb 17, 2018 2:33 pm
by toneddu2000
Hi guys. FTE doesnt' allow to save custom cfg with the command
Code: Select all
cfg_save foo

It says:
Code: Select all
Couldn't write config c:\blah\mygame\data/configs/foo.cfg (if disablehomedir is set to 1 in default.fmf manifest file) or Couldn't write config c:\Users\blah\Documents/Mygames/FTE Quake/data/configs/foo.cfg if disablehomedir is set to 0

Instead, if I create by myself the foo.cfg in the configs folder and I read it via
Code: Select all
localcmd("cfg_load foo\n");
and then
Code: Select all
float myval= cvar("my_cfg_val");
the value is retrieved!
:?: Is it a bug or did I miss a step?

Any help will be appreciated and thanked as always!

Re: [FTE]Saving custom cfg error

PostPosted: Sat Feb 17, 2018 9:11 pm
by Max_Salivan
cfg_save_all "If 1, cfg_save ALWAYS saves all cvars. If 0, cfg_save only ever saves archived cvars. If empty, cfg_save saves all cvars only when an explicit filename was given (ie: when not used internally via quit menu options)."

Re: [FTE]Saving custom cfg error

PostPosted: Sat Feb 17, 2018 9:28 pm
by toneddu2000
thanks Max_Salivan , but cfg_save_all is set to "", so, technically, it should work. Plus, if I set cfg_save_name to foo for example, and I query cfg_save_name, it says foo, but when I issue cfg_save command, it saves all the cvars to fte.cfg!
Is it also possible to save only specified cvars to a .cfg file?

Re: [FTE]Saving custom cfg error

PostPosted: Sun Feb 18, 2018 6:28 pm
by Dr. Shadowborg
Code: Select all
Couldn't write config c:\blah\mygame\data/configs/foo.cfg (if disablehomedir is set to 1 in default.fmf manifest file) or Couldn't write config c:\Users\blah\Documents/Mygames/FTE Quake/data/configs/foo.cfg if disablehomedir is set to 0


O_o

Is it supposed to be mixing the back and forward slashes like that in the paths?

Re: [FTE]Saving custom cfg error

PostPosted: Sun Feb 18, 2018 7:57 pm
by toneddu2000
Dr. Shadowborg wrote:O_o

Is it supposed to be mixing the back and forward slashes like that in the paths?

yeah, FTE does it (at least on Windows)

Re: [FTE]Saving custom cfg error

PostPosted: Mon Feb 19, 2018 3:03 am
by Spike
make sure the directory it says actually exists.

FTE internally uses forward slashes everywhere, because they work everywhere (there's a few microsoft-specific exceptions to that, but they don't apply to standard C).
the backslashes can arise from using microsoft functions to query working directories etc. There's also a few mods that explicitly use backslashes, so the engine has to tolerate them regardless.

Re: [FTE]Saving custom cfg error

PostPosted: Mon Feb 19, 2018 7:55 am
by toneddu2000
Spike wrote:make sure the directory it says actually exists.
Thanks Spike, but it totally exists. Infact, if I try to read via localcmd("cfg_load foo\n"); the foo.cfg in configs/ folder is read perfectly. And, even if folder doesn't exist, when command is issued, fte DOES create folder but does not create .cfg file