0 votes

I'd like to use a GDScript as a configuration file at runtime. I know I can use load("path"), but could I maybe read the configuration file from the executable's current directory?

in Engine by (66 points)

If I recall, the configuration files for a game are created and modified under user://, which, in turn, is found in a directory under the user owned directory. For example, under Linux, it's usually $HOME/.local/share/godot/app_userdata/<game name>. So if you're going to use configuration files, it'll probably have to be from the user:// directory.

So there's no direct way to find the executable's current path?

AFAIK, you can't get the path to the location of the executable from within the game.

After digging a bit more into the documentation, maybe there's a way to do this.

The documentation on the functionality between the OS and the engine has something about this topic. The get_executable_path() function maybe able to get the current directory.

This ended up working very well for me, thank you!

1 Answer

0 votes
Best answer

This problem was solved in a comment above by Eritan.

by (66 points)
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.