PDA

View Full Version : Any way to execute "code" on loading an XML module?



Varsuuk
May 19th, 2019, 02:34
I had an idea for some ruleset updating/extending functionality triggered by code and XML in a module.

Long story short (you are welcome, I know it is unlike me), I'd like to have some way to add (optionally, nothing happens if not present) some sort of "onLoad()" method to the mod file that could be defined in a Lua file. The code in there could take some of the XML and modify or extend some tables already present in my ruleset.

Yeah, probably weird - but is it something that is impossible because I am unknowledgeable about this stuff - or is it something the FG engine could do easily if such a call was added and people "caught" it?

Trenloe
May 19th, 2019, 05:48
What, like Module.onModuleLoad?

https://www.fantasygrounds.com/refdoc/Module.xcp#onModuleLoad