PDA

View Full Version : Question: XML for adding encounters (i.e. Battle items) to a map in a module...



Fran Stewart
February 22nd, 2021, 21:06
Hi, folks,
I've got some maps in the content I'm preparing for FG that need pins for encounters (denoted as battle items in the XML). I can't find a way to do it. Adding pins to a map through the UI generates a buncha "layer" tags in the XML. However, none of the resulting <image> content works properly when I port it across into my module's client file.

I can add shortcuts to refpages and story elements (i.e. encounter tags in the XML code). I can add encounters as pins in the UI. I cannot find the right syntax to get 'em into my module. Creating links to <class>Battle</class> objects just creates a dead link. Can anyone advise?

Moon Wizard
February 22nd, 2021, 21:48
If you are preparing content to be used in FGC or FGU, then the data should be added/updated in the original campaign used to create the module.

The data formats for FGC and FGU are very different. While FGU can perform a one-time migration of FGU data while loading; FGC does not understand FGU data.

Regards,
JPG

Fran Stewart
February 23rd, 2021, 00:16
I should clarify: I'm *creating* a source module. I'm working in FGU and raw XML. I'm helping to import a bestiary that has several sample encounters in it. The bestiary module contains a client.xml that I've been debugging. Someone else started the project but couldn't finish it. All the NPCs, images, tokens, tables, encounters, and reference pages are now in and working. I just need the maps.

The syntax and tag structure for images and shortcuts looks simple, and it looks like I should be should be able to have a shortcut with class=battle, but that doesn't work. Clicking the shortcut opens a *blank* encounter, not the one with the corresponding ID.

I tried building the map inside a campaign, then extracting the resulting XML code from \<campaign_name>\moduledb\<module name>.xml, but copying and pasting that code (an <image> with a set of <layers> inside it) into the original module and the map "loads," but only creates an entry labelled <<New Image>>, containing no actual image and no pins at all, so it seems clear it's not loading.

There's no campaign to go back to. I can get the images for the maps in and with the grid in place and scaled. I can manually enter the shortcuts for reference pages and story objects, but not encounters. I can show you some samples, though the code is a bit of a hash at present from all my hand-tweaking.



<templatetest>
<name type="string">AAAA</name>
<image type="image">
<bitmap>images/vttmaps/templeofthestarsvtt.jpg@Scarred Lands Creature Collection</bitmap>
<name type="string">Test Map</name>
<gridsize>59,59</gridsize>
<gridoffset>448,602</gridoffset>
<shortcuts>
<!--This works.-->
<shortcut>
<x>200</x>
<y>150</y>
<class>encounter</class>
<recordname>reference.encounters.templestarsenc01</recordname>
</shortcut>
<!--This doesn't.-->
<shortcut>
<x>691</x>
<y>524</y>
<class>battle</class>
<record>reference.battles.id-00011</record>
</shortcut>
</shortcuts>
</image>
<locked type="number">0</locked>
</templatetest>


....and OH #%$@ing hell, I LITERALLY figured it out as I was trying to narrow down the repro steps so y'all could read it. The answer:

In the "Layers" version that you get when you build/export the map from a campaign, the property of the <shortcut> that points to the target <battle> object is <record>. In the "just shortcuts" version that actually works in the external module, the right propery is <recordname>.

It's truly amazing how often the way to solve a problem is to show it to someone else, not so they help, but so that you can embarrass yourself by discovering the obvious error you made live, right in front of someone else. :) Thank you all for "rubber-ducking" for me. At this rate, I should be back for an encore of some kind within a week and a half! :)

Moon Wizard
February 23rd, 2021, 00:25
No worries. Glad you found it.

Regards,
JPG

LordEntrails
February 23rd, 2021, 01:35
Thanks for documenting via Rubber Ducking. It may help someone else with this issue in the future :)