Godot: ProjectSettings.save_custom returns error ERR_FILE_UNRECOGNIZED for any path

Created on 23 Apr 2020  路  5Comments  路  Source: godotengine/godot

Godot version:
v3.2.2.rc.custom_build.36a30f681

OS/device including version:
Window 10

Issue description:
I'm trying to save ProjectSettings at runtime using save_custom to location "user://override.cfg", but this action returns error ERR_FILE_UNRECOGNIZED. Actually this method returns this error for any path. Is it allowed to call it at runtime or only in tool? I want to use ProjectSettings mechanism at runtime for storing some user configurations.

documentation junior job core

Most helpful comment

The restriction is hardcoded here:
https://github.com/godotengine/godot/blob/1d45a269f87ff38e04169e6aa85d9ecd73fb3473/core/project_settings.cpp#L870-L877
Removing it would be easy if we decided to do that.

All 5 comments

The file needs .godot or .binary extension to work. The docs should mention that.

@pgoral Using the ConfigFile class is probably a better idea to store user configuration. When you save the project settings, you'll literally save all settings, including settings the user isn't supposed to change such as internal Godot settings.

@KoBeWi Could we remove this restriction?

The restriction is hardcoded here:
https://github.com/godotengine/godot/blob/1d45a269f87ff38e04169e6aa85d9ecd73fb3473/core/project_settings.cpp#L870-L877
Removing it would be easy if we decided to do that.

I think we should leave it like this, but only document it properly

I'm new here and in world of opensource, can i already open a pr describing this in doc?

Was this page helpful?
0 / 5 - 0 ratings