PDA

View Full Version : setmetatable



HoloGnome
June 6th, 2014, 15:56
Why was setmetatable excluded from the FG Lua API (as well as basic script loading)? (https://www.fantasygrounds.com/modguide/scripting.xcp)

Moon Wizard
June 6th, 2014, 16:53
The Lua environment within FG is a sandbox, so it is limited specifically for security reasons.

JPG

HoloGnome
June 6th, 2014, 17:32
OK - so, it looks like if you want to write a script, there is no support for lua object coding with metatables. Also, there is no way to load script files from within an extension lua file (no dofile, load, require, etc.). Can multiple files be defined at the xml level and will FG load them so that the routines are accessible?

Moon Wizard
June 6th, 2014, 19:35
Yes.

*The includefile tag lets you include other XML files.
*The importruleset tag lets you include an entire ruleset code base.
*The top level named script tags let you define globally available sets of Lua functionality.
*The individual script tags within each object let you define per object Lua functionality.

Regards,
JPG

HoloGnome
June 6th, 2014, 22:34
OK - thx. Is there a complete XML reference...or just the ModGuide?

Moon Wizard
June 6th, 2014, 22:36
The reference developer guide is the complete list of all FG-supported XML tags.

Regards,
JPG

HoloGnome
June 7th, 2014, 00:49
ok thx.