Forum

[FTE]Saving custom cfg error

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

[FTE]Saving custom cfg error

Postby toneddu2000 » Sat Feb 17, 2018 2:33 pm

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!
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [FTE]Saving custom cfg error

Postby Max_Salivan » Sat Feb 17, 2018 9:11 pm

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)."
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: [FTE]Saving custom cfg error

Postby toneddu2000 » Sat Feb 17, 2018 9:28 pm

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?
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [FTE]Saving custom cfg error

Postby Dr. Shadowborg » Sun Feb 18, 2018 6:28 pm

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?
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1108
Joined: Sat Oct 16, 2004 3:34 pm

Re: [FTE]Saving custom cfg error

Postby toneddu2000 » Sun Feb 18, 2018 7:57 pm

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)
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [FTE]Saving custom cfg error

Postby Spike » Mon Feb 19, 2018 3:03 am

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.
Spike
 
Posts: 2883
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: [FTE]Saving custom cfg error

Postby toneddu2000 » Mon Feb 19, 2018 7:55 am

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
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest