Generating Images/Maps (FGU Scripting)
Hey everyone,
I'm trying to create an extension for Fantasy Grounds Unity that will generate basic outdoor maps from a set of backgrounds and other decorative images.
I have never written a FG extension before, and I am running into some issues, hopefully someone can help.
So far, I have created an additional button in the Images window that creates a new image under a new category with a random name. I am trying to figure out how to add a layer to it (using an asset that is already loaded) and not having any luck. Is there an API call to do this? What I have been trying is just using "createChild" and "setValue" on the image node I created, but it is not adding entries in the "<layers />" node.
Any ideas?
Here's an example of the XML I am generating... (I can't get anything to go under the layers element!)
<category name="Maps - Generated">
<Plains-b67bd10c-1aef-4f99-b63c-b77298014775>
<image type="image">
<allowplayerdrawing>on</allowplayerdrawing>
<gridsnap>on</gridsnap>
<layers />
</image>
<locked type="number">0</locked>
<name type="string">Plains - Fri Jul 31 16:52:44 2020</name>
</Plains-b67bd10c-1aef-4f99-b63c-b77298014775>
</category>