PDA

View Full Version : Reading text files



peterb
January 26th, 2010, 10:49
Foen is, as you might be aware of, building a Classic Traveller ruleset. There is a lot of info about the Traveller universe available on the net and the data is often available as fixed-position text files. The Lua language of course supports the reading of text files but is this functionality exposed in the FG engine? If it is, then that would make it much easier to show (i.e. import) sector and planetary data.

Spyke
January 26th, 2010, 12:48
The Lua file input/output functions are not currently supported in FG scripting:

https://www.fantasygrounds.com/modguide/scripting.xcp

This does also serve to limit the damage scripts can do, of course.

What you could do is provide a field for copy and paste and then parse that from within FG, or manipulate the files outside FG into xml and incorporate them in FG library reference data.

Spyke

peterb
January 26th, 2010, 17:17
What you could do is provide a field for copy and paste and then parse that from within FG, or manipulate the files outside FG into xml and incorporate them in FG library reference data.

Yes the XML route is always available but in this case (the Traveller case) being able to access the text file would have been very handy. The Traveller files are pretty much standardized, so being able to access the files directly would increase the utility of FG since any user could load any sector file without a need for a separate conversion utility.

Foen
January 26th, 2010, 19:35
Sector conversion is on my list, but will be behind the BRP ruleset for now.