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

Resources saved to res:// at runtime get reverted: Can't save SaveGame to res:// reliably #159

Closed
NathanLovato opened this issue Dec 31, 2018 · 6 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@NathanLovato
Copy link
Contributor

No description provided.

@NathanLovato NathanLovato added the bug Something isn't working label Dec 31, 2018
@NathanLovato
Copy link
Contributor Author

According to @nhydock this is due to a bug in the engine: saving Resources to res:// while the game is running seems to not work as expected, but saving to the user:// dir works no problem. But if we can only save to user:// it kills one of the main points of using resources: being able to edit the savegame in the inspector

@Zireael07
Copy link

What, you can't edit resources in inspector if they're in user://?

@erodozer
Copy link
Contributor

erodozer commented Jan 1, 2019

This is all intentional within Godot as res:// is a virtual filesystem for your game's bundled assets after exporting, it should not hold any mutable data. user:// dir is outside of the project dir and is designed to hold mutable persistent data. Since the editor is only supposed to be working with your projects own files and nothing dynamic, it makes sense that you can't access user:// from the inspector

https://docs.godotengine.org/en/3.0/tutorials/io/data_paths.html
https://docs.godotengine.org/en/3.0/getting_started/step_by_step/filesystem.html?highlight=user%3A%2F%2F#resource-path

Note that saving and loading does work with files in res:// within the editor right now as long as you save and load within the same run. However, any changes to the file system not performed by the editor will be reverted when you stop the running debug instance.

@erodozer
Copy link
Contributor

erodozer commented Jan 1, 2019

godotengine/godot#24646 highlights the same issue we're having

@NathanLovato NathanLovato added the wontfix This will not be worked on label Jan 2, 2019
@NathanLovato NathanLovato changed the title Experience doesn't get saved in the PartyMembers' stats after an encounter Resources saved to res:// at runtime get reverted: Can't save SaveGame to res:// reliably Jan 2, 2019
@realkotob
Copy link

In this case wouldn't the best course of action would be to save resources to user:// after they are changed, and when loading check if they exist in user:// or else default to res:// ?

@NathanLovato
Copy link
Contributor Author

@asheraryam The point was to save debug save files in res:// so we can edit them in the inspector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants