Developer Guide - Extracting LOS Data for Modules

FGU Version 4.1 and Newer Only

Any module for Fantasy Grounds should be built first for Fantasy Grounds Classic and then these additional steps will allow the developer to create additional XML files that can be added to support enhanced Line of Sight (LOS) functionality within Fantasy Grounds Unity.

Definitions:

  • FGC - Fantasy Grounds Classic

  • FGU - Fantasy Grounds Unity

  • LOS - Line of Sight

Prepare your FGC Module with LOS Data

  1. Create a new blank campaign in FGU and call it something like MASTER - [My FGC Module]

  2. Open your FGC Module within FGU

  3. Go to Assets > Images and locate the folder for your module

  4. Open your Images & Maps window and have both it and your module’s image assets open at the same time

  5. Drag an Image Asset that needs LOS over to the Campaign Images folder. This will create a new image record in FGU for this image

  6. Unlock the image and set the following:

    1. Set the grid size and adjust the grid if necessary. This is important even for graphics that don’t have line of sight data since it is used to set the object scale.

    2. The image should be centered by default. Do not move the image around.

    3. Define all LOS. Please refer to the https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996640584/Map+Line+of+Sight+Style+Guide

  7. Make a copy of your module (mymodule.mod) file somewhere and extract it using a Zip tool like 7Zip or Winzip.

Modules you build for personal use can use whatever LOS Style you want. Any module that is officially sold in the Fantasy Grounds Store or on Steam must follow the LOS Style Guide in order to be accepted by SmiteWorks for distribution.

Extract the XML for your LOS Data

XML files are now extracted directly out of FGU. The XML files generated from here will not work with earlier versions of FGU. They will render everything as solid walls and you won’t have usable doors, windows, terrain, etc.

These exported files can be zipped up for a module and attached to the forum thread below. Please include the module product ID and let us know whether or not you add lights and LOS.

https://www.fantasygrounds.com/forums/showthread.php?66991-FGU-Sharing-LOS-and-Light-Definitions-(v-4-1-and-up-only)

The extract option does a number of steps.

Step 1: Extract Metadata for the layer that contains the image

What the extract does:

  1. Extracts occluder data (LOS info) from the current campaign image into a separate XML file.

  2. It adjusts the X,Y coordinates if the image is off-center. If you followed the instructions under Preparation, it shouldn’t need to do anything here.

  3. It updates X,Y points to fit snap to image edges and corners. This is very important for tile based images that must snap together.

  4. It closes any door or terrain elements

Step 2: Save the XML file next to the image in your final module file or folder.

Verify that you now see an XML file next to any image that has LOS data. It should look similar to this inside your module’s images folder.

Rezip your module.

Test the module in a test campaign. From there you should be able to open any map image as normal and then check the LOS definitions. Make sure they are lined up correctly with each image.

Related Topic: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645724

Sample XML file

1 2 3 4 5 6 7 8 9 10 <root> <grid>on</grid> <gridsize>100,100</gridsize> <occluders> <occluder> <id>1</id> <points>14.4,-51.3,18.6,-36.3,25.1,-14.8,19.4,17.5,18.2,35.9,14.6,48.9</points> </occluder> </occluders> </root>