Loading a JSON file

I want to have a folder called data in the same location as the built project, and from that folder I want to be able to load JSON files for my game. I don’y want them to be built into the project, as I want to be able to modify and more files to the folder without having to rebuild the game. How would I do this? I was using JSON simple and then giving it the directory of the build with the data folder added on “C:\Users\Home\Documents\dunno\dist\data\levels\test.json” but the game doesn’t load the file. Why is this? Anybody know a way I can load JSON from an external folder, that can be accessed after the game is built?

Sure. I do it all the time. The problem is you providing a path of its whereabouts. Usually you define folders within your game, and refer to the static paths when you save and load. So, if you saved it, you should be able to load it, because it’s the same place. A full-stop/period - e.g. “./myfolder” is a relative path. Relative to the parent directory the application was launched I believe. Not using a full-stop - e.g. “/myfolder/” is an absolute path - and refers to the root of the drive - e.g. “c:/myfolder”.

Thanks, this fixed it. I tried doing that before but for some reason it didn’t work and I guessed I would have to do put the whole thing. It all works now however.