I'm using JSON files to define data for some dialog and creature stats. When I'm running from the editor, I can read them without problem using:
String dialogFile = "res://scenes/town/dialog.json";
Godot.File f = new Godot.File();
if (!f.FileExists(dialogFile))
{
GD.Print("File does not exist: " + dialogFile);
return;
}
f.Open(dialogFile, File.ModeFlags.Read);
String text = f.GetAsText();
f.Close();
JSONParseResult res = JSON.Parse(text);
However, this doesn't work after I've exported for either Android or Windows desktop. The error message I'm printing is reporting that my file does not exist.
How do I fix this so that may exported projects can find my .json files?