Reading from a text file that is not included in the .quest file itself
Malphas
07 Oct 2022, 18:50Hello everyone, here I am once more with a question about something really unnecessary that I'm wondering about.
I know about GetFileData() and was planning to read something from a text file, it's sort of a small easteregg.
GetFileData("README.txt") worked on .aslx but not on .quest and after some research I found that is because in the .quest file it needs to be packed in the game itself, making it the .txt file a .html file works but it also packs it into the .quest file.
Which brings me to my question, is it possible to load info from a text file that is not packed into a .quest file somehow?
Thanks in advance for the help and take care!
-Mal
mrangel
07 Oct 2022, 20:55There are ways around it, but nothing particularly stable or useful. If you're trying to access a local file, it won't work for anybody playing online, and any workarounds are likely to break if the version of Chromium packaged with Quest is ever upgraded to a current one.
If your file is on the internet somewhere, it's possible to read it using JS/curl. But the code gets ugly fast.
I don't really understand why you don't put the text into the .quest file (or in an attribute somewhere)
Malphas
08 Oct 2022, 06:24It won't be necessary to make it work online as I'm more so focussed on an offline version.
But now that you mention it, I might just use a getinput to do the same thing but easier, I suppose that's handier.
Thanks for the advice!
-Mal