- Oct 30, 2018
- 88
- 90
Its actually a browser limitation. The only way you're allowed to import files from disk into JavaScript environment in a default browser is to have the HTML read and execute the file (this is why all files save a variable, so they can be used by the other scripts).convert the regular text files into javascript is a strange one.
The same problem happens with images. You're not allowed to know things about the images you import using HTML, because else you could make a JS script that steals all the images from user's computers. I solved that by just using HTML+CSS to get the images how I want them.
I have created a parser that converts the text files offline, alternatively you could run a server to do the work instead. The site should be pretty efficient, because it only loads in assets when it needs them for a scene, although it seems inefficient because I have yet to make it get the data one step ahead of the player.
EDIT: Also, turns out I had some develop stuff on at the version I sent, so it didn't work, I removed that so if you redownload it should work by simply opening the html file with a browser
Last edited: