0 votes

Actually in settings, we got: Set custom user dir, to change from for example: %appdata%/Godot to a custom dir, right?

How can I set to same game folder (bin)? Just use res://?

Thanks

asked Oct 19, 2019 in Engine by kapsloki (33 points)

1 Answer

+1 vote
Best answer

It's explained here: https://docs.godotengine.org/en/3.1/classes/class_projectsettings.html#class-projectsettings-property-application-config-custom-user-dir-name
And also in the hover tooltip.
You cannot use this to target the folder of the executable.

When you use file paths in your games, the path will be relative to the executable already. So if you save a file with the following path "test.txt" and no prefix, it will look for a text.txt file next to the game executable. res:// cannot be used to save files because it relates to game resources (it only works in the editor).

The reason why user:// is recommended and points to a location which is not next to the executable is because not all platforms allow you to do this.

answered Oct 21, 2019 by Zylann (26,159 points)
selected Oct 21, 2019 by kapsloki
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.