Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProjectSettings.save() does nothing #46358

Closed
MaaaxiKing opened this issue Feb 23, 2021 · 12 comments · Fixed by #46386
Closed

ProjectSettings.save() does nothing #46358

MaaaxiKing opened this issue Feb 23, 2021 · 12 comments · Fixed by #46386

Comments

@MaaaxiKing
Copy link

MaaaxiKing commented Feb 23, 2021

Godot version:

3.2.3.stable

OS/device including version:

Windows 10 Home 1909

Issue description:

I wanted to save the ProjectSettings which I configured earlier with ProjectSettings.set_setting("application/run/main_scene", "res://title_screen/title_screen.tscn"), which works because when I do print(ProjectSettings.get_setting("application/run/main_scene"), I get "res://title_screen/title_screen.tscn" printed, with ProjectSettings.save(). I even disabled safe save in EditorSettings and my antivirus. For days I ask myself where the problem is.

Steps to reproduce:
in script: change any ProjectSetting and then save it.

Minimal reproduction project:

Bug_REPRODUCTION.zip

@KoBeWi
Copy link
Member

KoBeWi commented Feb 23, 2021

Seems like you can't modify ProjectSettings from within running project. It works when you add tool to your script. Probably should be documented.

@MaaaxiKing
Copy link
Author

But why does the method exist then? To me it seems like a bug.

@MaaaxiKing
Copy link
Author

After disconnecting from my Android phone I got

E 0:10:43.140   _save_settings_text: Couldn't save project.godot - project.godot.
  <C++ Error>   Condition "err != OK" is true. Returned: err
  <C++ Source>  core/project_settings.cpp:755 @ _save_settings_text()
  <Stack Trace> tutorial.gd:36 @ next()
                tutorial.gd:29 @ _input()

. I don't know if this helps.

@MaaaxiKing
Copy link
Author

For me, it does not work with tool.

@rsubtil
Copy link
Contributor

rsubtil commented Feb 24, 2021

This was fixed by #45880

@KoBeWi
Copy link
Member

KoBeWi commented Feb 24, 2021

For me, it does not work with tool.

You need to call it from the editor. It won't work in the running game.

This was fixed by #45880

It's unrelated.

@rsubtil
Copy link
Contributor

rsubtil commented Feb 24, 2021

Sorry, I forgot to show my findings. 😅

It looks like ProjectSettings.save() works; the issue is that, as soon as the editor is re-focused, it saves the project settings, thus overriding any modifications done externally
clip

@KoBeWi
Copy link
Member

KoBeWi commented Feb 24, 2021

Ah you are right, although the PR that fixed this is #45968
I wonder if it works in exported project though.

@MaaaxiKing
Copy link
Author

That should be documented!

@Zireael07
Copy link
Contributor

No need to document something that's already fixed @MaaaxiKing

@KoBeWi
Copy link
Member

KoBeWi commented Feb 24, 2021

Ok so it works in exported project too, but the modified settings can't be loaded. This might be worth mentioning in the doc.

@MikeSchulze
Copy link

MikeSchulze commented Mar 27, 2021

This bug needs to be merged into v3.x aswell.
My inital plugin setting are not saved ;)

ah i see 'Cherry-picked for 3.2.4.' i have to try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants