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?

asked May 2, 2019 in Engine by Kyle Guarco (64 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.

answered May 6, 2019 by Kyle Guarco (64 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 How to use this Q&A? before posting your first questions.