PDA

View Full Version : Fantasy Grounds I/O Routines



Wintermute
May 12th, 2018, 16:29
Are there any file i/o functions available in FG? What I'm wanting to do is have the extension read in a text file containing a list of names and generate the required OptionsManager and string data. That way if someone wanted to add/edit/delete options, they just have to edit the text file instead of navigating through the code. The number of options would be flexible and not limited to a certain number. Is this possible?

Thanks.

Trenloe
May 12th, 2018, 16:52
The LUA IO routines are not available in FG. See this section for info on what is not available: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Scripting#Fantasy_Grounds_Specific_Lua_Changes

You really don't have any solid options for what you'd like to do. The only real way to get any external information into FG is through a FG module - which presents data in the FG XML database format. Aside from the format not being too user friendly, that module would need to be activated when FG loaded.

If you really want to pursue this, maybe you could have an extension that allows pasting of the data in the text format you decide upon. The extension stores this in the FG database, and then the next start of FG it reads the database and sets up the various options based on the data previously stored in the database.

Wintermute
May 12th, 2018, 23:11
Thanks Trenloe for the info and the possible work around.