PDA

View Full Version : Images In Modules - Help Please



dulux-oz
May 23rd, 2015, 08:55
Hi Guys,

I've been pulling (what little I have left of) my hair out for the past 3 hours now and I can not get this to work.

I have read everything I can find on the Wiki and the Forums but I still can't get this to work.

I'm trying to do up a module. The module's name is "My Module".
The module has an image in it. The image is called Fig_01.png. It lives in the Figures Folder inside the module.
I don't want the image to show up under Images & Maps.
I have the following section in my module:


<figures static="true">
<image type="image">
<bitmap>Figures/Fig_01.png</bitmap>
</image>
</figures>

I also have the following line of code as part of some formatted text:


<link class="imagewindow" recordname="figures.Figures\Fig_01.png@My Module">(See Figure 1)</link>

The imagewindow opens as expected, but Fig_01.png is not displayed. So, logically, I have something wrong in my code.

Could someone / anyone tell be where the error is, please?

damned
May 23rd, 2015, 09:02
do you have any commercial rulesets like Castles&Crusades?

dulux-oz
May 23rd, 2015, 09:04
do you have any commercial rulesets like Castles&Crusades?

Yes, I've checked them, and I still can't figure out what I'm doing wrong, because as far as I can see the C&C Module's code is the same (in structure) to mine. :)

Nickademus
May 23rd, 2015, 12:20
This is how I do my images, though not entirely sure if it is what you are going for:


<image>
<category name="Conditions" mergeid="" baseicon="1" decalicon="10">
<id-00001>
<image type="image">
<bitmap>Bleed.png</bitmap>
</image>
<name type="string">Bleed</name>
</id-00001>
</category>
</image>


To prevent it from showing in the Image/Maps list, remove the category tags. Might be an error due to not having a name.

Callum
May 23rd, 2015, 14:32
You have a / in the first bit of code and a \ in the second bit.

dulux-oz
May 23rd, 2015, 14:51
You have a / in the first bit of code and a \ in the second bit.

Nicely spotted.

Have fixed this and tried it all four ways (2 by "/", 2 by "\", and each way "/" and "\") - still not working! :(

Trenloe
May 23rd, 2015, 15:08
Your recordname in the link is all wrong. You don't use a file path, you use a FG DB path. From the code you provided, all you'd use is "figures@my module" or something similar - I'm not 100% sure of the exact syntax you should be using for an image in the module DB.

dulux-oz
May 23rd, 2015, 15:27
Your recordname in the link is all wrong. You don't use a file path, you use a FG DB path. From the code you provided, all you'd use is "figures@my module" or something similar - I'm not 100% sure of the exact syntax you should be using for an image in the module DB.

If I'm understanding you correctly then shouldn't it be "figures.Fig_01.png@My Module" - in which case, I tried that (with Fig_01.png loaded in the Figures Folder and also the "." Folder) - no work :(

Trenloe
May 23rd, 2015, 22:17
If I'm understanding you correctly then shouldn't it be "figures.Fig_01.png@My Module"
Fig_01.png is a value of a database entry, it is not a reference to that database entry. You need to refer to the database entry, not the contents of the entry. Think of it like you're using DB.getValue - you need to refer to the exact DB reference, and FG uses that to identify which image it will use.

Drag an image link in a campaign into a story entry and then look at that link in the campaign DB.xml file to give you an idea of the format of a link to an image.

dulux-oz
May 24th, 2015, 03:14
Hi Everyone,

Thanks to everyone for their help and suggestions - I got it working. Something Trenloe said put me on the right track - thanks Tren.

For anyone who's interested, the correct, working module code is below:


<figures static="true">
<Fig_01>
<image type="image">
<bitmap>Figures\Fig_01.png</bitmap>
</image>
</Fig_01>
</figures>

<link class="imagewindow" recordname="figures.Fig_01@My Module">(See Figure 1)</link>


Cheers