PDA

View Full Version : Read from external file



ColinBuckler
May 26th, 2022, 18:24
I seem to recll that some of the IO functions of LUA were not allowed for obvious reasons (WRITE for example), not sure if this is still the case or not.

What I would like to do is to select an external text file from within an extension and READ it. This functionality would only be available on the GM side only. ( ideally a .txt or .ini, but could do .json or .xml )

I know I could copy and paste into a text box and save that, but I would much rather it be from a config file as the contents maybe quite long for pasting and there could be multiple different versions which could be configured by the GM or even shared with other GM's.

Is the ability for the GM to READ external files available in LUA?

Trenloe
May 26th, 2022, 19:20
Refer to the File Package in the API: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/1482293249/File