In my game, I have to load a JSON file named “letters.json” to use it in a variable.
To try, the JSON file was in the desktop, and I loaded it just like this:
I would have thought the last one would work. I’d suggest you put that path and filename into a string and either write it out to console or to a text object on screen to check path is correct.
In fact, the JSON file is located in “assets\letters.json”.
I also tried: FileSystem::PathDelimiter()+"assets"+ FileSystem::PathDelimiter() + "letters.json"
But doesn’t work. In docs I didn’t found something explicit about the paths when you’re editing in GDevelop and when you export the game. Docs about the theme aren’t clear
In the project I’ve got on at the moment, I’ve had to enter the full path. I’m on Windows, storing my project in my documents folder. The path I use to load a json file is "C:\\Users\MrMen\\Documents\\myGame\\assets\\language.json" (yes, double back slash).
I’m not aware of a GDevelop function that returns the current game directory. Maybe raise it as a feature request?