PDA

View Full Version : Developer Guide - Extracting LOS Data for Modules Question



Tyrannosaurus VeX
June 3rd, 2020, 00:06
From https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/260440084/Developer+Guide+-+Extracting+LOS+Data+for+Modules


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:

a. Set the grid size and adjust the grid if necessary

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

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


Ok, so from the bolded section ... I really don't understand.

Can you move around the map and zoom in and such or not? And are you able to before you set the grid, but not after? Or the other way around?

Even if you follow the link, in the example video, they are zooming in, moving around the map, etc.

Is this only important if you actually click+hold+move the image itself? Or does this include zooming and scrolling around the map?

Zacchaeus
June 3rd, 2020, 10:28
Not really sure either what that means. You can't really draw LoS without a lot of moving the map around and zooming in and out.

Kelrugem
June 3rd, 2020, 11:23
From https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/260440084/Developer+Guide+-+Extracting+LOS+Data+for+Modules



Ok, so from the bolded section ... I really don't understand.

Can you move around the map and zoom in and such or not? And are you able to before you set the grid, but not after? Or the other way around?

Even if you follow the link, in the example video, they are zooming in, moving around the map, etc.

Is this only important if you actually click+hold+move the image itself? Or does this include zooming and scrolling around the map?

I think the moving is just about moving the image itself via drag&drop, zooming in/out is not actually movement :)

I never used that tool but I have shortly skimmed through the wiki, and I think the following roughly happens: The tool extracts the LoS data as an xml file, and that file is combined with the jpg file of your image later in the module :) (see the very last screenshot at that wiki page) Especially that means that a module has to create the image with attached LoS data on its own, it has to start with the blank image, basically as if you would have to start again but you wrote down the coordinates of the LoS stuff of your previous attempt to speed up things a bit

And I guess that is the crucial point, the way how a module combine the LoS data with an image (I hope I can describe it well, I rewrote the following parts now several times :D):

1. The LoS data is saved as coordinates with respect to some origin/center of coordinates, where the zero-coordinates are (whereever this is in a new image; we can't really see that because the blank image has no visual hint where that center is. I do not know the code of course)
2. When a module now combines a jpg and the LoS coordinates, it will probably assume that some specific part of the image is in the center/origin of the coordinates (maybe upper left corner of the image or its own center); or in general: The jpg will be probably added in such a way that e.g. the upper left corner has always the same coordinates like the zero coordinates of the origin/center of the coordinate system (or take any other defined point of a generic image like other corners and apply fixed coordinates for this process). And then it applies the LoS data using the saved coordinates of the separate xml file. That is probably the reason for The image should be centered by default, thence, the center of the coordinate system will be probably the "fixed point" to which some defined point of the image gets aligned. In the following I now assume the upper left corner of the image for simplicity (it doesn't matter which point of the image is the fixed one)
3. When you created the LoS data while the image was not as by default when you added it, i.e. you moved it around and translated it, then the created coordinates of the LoS will be with respect to that moved-around image, i.e. the coordinates get also an additional offset corresponding to your translation of the image. But the module assumes the upper left corner (i.e. the fixed point of the image) in the center of the coordinate system as described above such that the LoS lines will not be correctly aligned in the asset coming from the module, the LoS lines will be at the coordinates where you had the initial image but the module shifts that image now to the center and so the LoS will not align nicely :)

Lou Ciphor
June 3rd, 2020, 16:44
That's what I was trying to describe in chat, Vex.... though, I'm not sure which one of us was more clear in describing it. LOL