PDA

View Full Version : Another Modules question - Images



Casimir
April 12th, 2016, 16:22
Greetings again - still working on modules, but this is a different issue. I have two images I want to link inside my Module. I've copied and then opened one of the default modules in FG and scanned through the db.xml file to see how it was done, and have copied that same syntax. However, I'm having a strange issue that makes no sense. I ended up creating a test module that just includes the relevant snippets to test, with the same results. For the sake of clarity and being clear on what I'm dealing with, I'm including code snippets below.

My module file has the following files:



db.xml
definition.xml
image1.png
image2.png


The db.xml file has the following code:



<?xml version="1.0" encoding="iso-8859-1"?>
<root version="3.1" release="2|CoreRPG:3">
<library>
<imagetest static="true">
<name type="string">Test</name>
<categoryname type="string">Call of Cthulhu Essentials</categoryname>
<entries>
<section-01>
<librarylink type="windowreference">
<class>referencetext</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Image Testing</name>
<text type="formattedtext">
<p>Testing the images</p>
<p></p>
<linklist>
<link class="imagewindow" recordname="reference.id-00000">Image 1</link>
</linklist>
<linklist>
<link class="imagewindow" recordname="reference.id-00001">Image 2</link>
</linklist>
</text>
</section-01>
</entries>
</imagetest>
</library>
<reference>
<id-00000>
<image type="image">
<bitmap>image1.png</bitmap>
</image>
<name type="string">Image 1</name>
</id-00000>
<id-00001>
<image type="image">
<bitmap>image2.png</bitmap>
</image>
<name type="string">Image 2</name>
</id-00001>
</reference>
</root>


What SHOULD happen is that when I click on the link for Image 1, Image 1 pops up, and likewise for Image 2.

However, what's actually happening is that Image 2 pops up for BOTH links. I can't understand why this is happening, considering the code is correct (I've wracked my brain making sure it's correctly coded). I've tried changing the Library section to an INDEX rather than a TEXT, and that doesn't change anything. I've even re-compiled the .MOD file, flushed my campaign's DB, restarted FG several times, etc.

Am I missing something somewhere maybe? What's frustrating is that I'm sure that the solution is probably something agonizingly simple...

Zacchaeus
April 12th, 2016, 16:28
It's possible that you are using .png's rather than jpg's. png files are usually only for tokens whereas jpg's are for pretty much everything else. I'm just guessing though since I don't really know.

Moon Wizard
April 12th, 2016, 18:01
It looks like it should work from quick scan. Try posting your files zipped up so we can check on our installs.

Cheers,
JPG

Casimir
April 12th, 2016, 19:32
I completely forgot about the JPG issue. Yes, both images were PNG's - when I converted them to JPGs, it worked. I knew it was something simple I was overlooking. Thanks for the help!