The “Load text” works fine and everything I need is in the “datafile”, and if I just paste that into the JSON string, it works, but if I do the above, I get an “Unexpected token in JSON at position 0” error. Does not seem to matter what I actually have in the file.
I also tried sending a GET request, but I don’t know how to do that for a local file on mobile, and it feels… wrong.
Is the string not already loaded into a variable? Is that not stored in memory? I am not looking to access the file system on mobile, just what is packaged inside the apk. That is not possible either?
It’s packaged under /assets like all the other assets. I’m not trying to alter it or anything. I only need to read it once at game start. So why can I read a jpeg, but not that? It’s just text, that I’m trying to convert into JSON and then do stuff with. I can’t imagine why this would not be possible? Is there some other command for this? Or am I fundamentally not understanding something about this system?
You can do this, just not using the filesystem actions ;p Those are for reading and writing files at runtime, not at build time, and only work on PC builds. To load a JSON at build time, use the “Load JSON Resource” extension.
UUgghh. OK… Got it done now! In all the searching I did around the internet, I could never find a reference to that extension! For anyone reading this, the exact name of the extension is “JSON Resource Loading”. Thanks all for your help!