PDA

View Full Version : Trouble adding images to Library Module



Sidion
March 16th, 2016, 23:32
I've been struggling recently in my attempts to add images (Well image link windows or whatever really) into an existing Library Module.

I can get the link to appear, but no matter what I do or where I place the image the link is not clickable.

I'd post the entry and relevant XML stuff I'm trying to use, but the Forums keep denying my post if I attempt to copy/paste it... (It seems to be thinking the entries are URL's?)


I'm really unsure of what else to try.

Any help would be appreciated.

damned
March 17th, 2016, 05:33
Welcome Sidion.
You cant post links until you have a few more posts up your sleeve.
What is the existing module?
When dragging images (or anything else) on to a map to make them a link you need to either enable links on the base image or hold down [ctrl] while you drag and drop.
If you are trying to make a link in a story entry that is done differently - first you must make the line of text a link (try [ctrl]+5) and then drag something to it.

https://www.youtube.com/watch?v=qpdpSmbbnQg
https://www.youtube.com/watch?v=4-PqBEJ8BRM

Sidion
March 17th, 2016, 06:36
Thanks for the welcome.

I'm currently trying to add an image into a library (Specifically to the Player Library that I got from the Star Wars EotE ruleset).

What I'm trying to do is replicate what was done in the 5e PHB I purchased from the store, wherein some of the pages in the library (The classes are the ones I remember most) have links that pop open windows with images in them when clicked.

Unfortunately while I get a link to appear that looks clickable, clicking on it doesn't result in anything happening.

As I understand it, I need a line in the db.xml that specifies the location of the image, and then I link to that with another line of code within the "formattedtext" description area of an entry that can be opened from the Library.


Nothing I've done thus far has gotten the link to result in opening an image within FG, and I'm unsure of how else to tackle the problem.

I can't link to the forum posts I was using as references (There's 2 that related to what I'm trying to accomplish I believe), but they're from pretty far back. (2007 and 2009).

damned
March 17th, 2016, 06:56
Hi Sidion.

Create a blank Star Wars campaign. Create a single story entry and add a single image. Link the image using the info above. Export the campaign as a module making sure that you have Images and Story selected. Review the code that is output and use that as your guide.

Sidion
March 17th, 2016, 07:49
Alright so I think it helped me at least get more of an idea of where I *think* the problem seems to be coming from.

Inside of my campaign db.xml I see all the entries related to the various images I put into the campaign. However the individual modules db.xml don't have these images (Cause they're in the campaign folder, not inside of the zipped module file right?)

I think I'm probably not pointing the image entry in the module at the right spot to grab the image.

While I've been toying with it, I still can't seem to remedy that problem.

currently the part I think points at a location looks like this:

-images-
-category name="" mergeid="" baseicon="0" decalicon="0"-
-id-00017-
-image type="image"-
-bitmap- images/TesterImages/canyon.png -/bitmap-
-/image-
-name type="string"-canyon -/name-
-/id-00017-
-/category-
-/images-

This is just before the closing /root tag at the end of the library file.

Then inside of one of the entries I made I have:

-test-
-classname type="string"- ability -/classname-
-name type="string" Test -/name-
-description type="formattedtext"-
-p-
-linklist-
-link class="image" recordname="images.id-00017"- Testing 123 -/link-
-/linklist-
-/p-
-/description-
-/test-


I've tried putting the image into a folder within the .mod file called images, but that didn't help either.

I'm sure I'm missing something obvious, but I really can't figure it out.

Thanks

damned
March 17th, 2016, 07:57
first thing to try - /images and only /images - no subfolders.

Sidion
March 17th, 2016, 08:12
first thing to try - /images and only /images - no subfolders.

Alright, still no luck.

Where does the image need to be within the Fantasy Grounds appdata folder?

I've been moving it around with each test as I haven't been sure.

I understand that images are normally in;

appdata->roaming->fantasy grounds II->campaigns->campaign name->images

Is there a different location they need to be in for images to work within Library modules? (For the record I've tried putting an images folder containing my test image into both the .mod file itself, and into the FGII folder itself)

damned
March 17th, 2016, 13:42
in a module try putting everything in the root folder....

you might have something like this:

gmmap.jpg
definition.xml
db.xml

in db.xml you might have:

<image>
<category name="">
<id-00001>
<image type="image">
<bitmap>gmmap.jpg</bitmap>
</image>
<name type="string">GM Map</name>
</id-00001>
</category>
</image>



and in your story entry in teh same file:


<linklist>
<link class="imagewindow" recordname="image.id-00001">GM Map</link>
</linklist>

Trenloe
March 17th, 2016, 15:20
As Damned mentions in post #4, export a module from the campaign - so that you'll get base XML and images from your campaign within the module. This will allow you to play around with data/formats etc..

See posts #4 and #6 here: https://www.fantasygrounds.com/forums/showthread.php?30360-error-when-using-own-module-in-EotE

Having said that, the format of links within a campaign story entry are different from those within a library formatted text entry. I just can't remember them off the top of my head, give me a bit to find them...

Trenloe
March 17th, 2016, 15:36
OK, the issue might be that there are static="true" entries within the library module - this means that entries are read only within a module and campaign (the formattedtext control is essentially disabled using setEnabled(false) (https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#setEnabled) in the ruleset code), and the upshot of this is that formattedtext controls (the FG control used for stories with embedded links) will be in read only mode and links within formattedtext controls cannot be clicked within read only library entries.

Trenloe
March 17th, 2016, 15:58
OK, so this was an issue in the base Star Wars ruleset - the code was setting the formattedtext control to be disabled if the node was static. I've changed this to set the control read-only, not disabled.

Try this hotfix ruleset: https://drive.google.com/open?id=0B6oOdW6SsMwsQ3BaaC1wRDBxajA

Trenloe
March 17th, 2016, 16:01
From the original issue in post#1:

I can get the link to appear, but no matter what I do or where I place the image the link is not clickable.
This is caused by an issue in the ruleset (see post #10). Hotfix ruleset in post #11, please give that a go...

Sidion
March 17th, 2016, 22:39
Requested access to the file, I'll give it a shot once I've got it.

Trenloe
March 17th, 2016, 22:46
Requested access to the file, I'll give it a shot once I've got it.
Should have access now.

Sidion
March 17th, 2016, 22:48
Alright perfect, I put in the hotfixed ruleset, and my images are showing up perfectly now.

Thanks for all the help!

Trenloe
March 17th, 2016, 22:55
Alright perfect, I put in the hotfixed ruleset, and my images are showing up perfectly now.

Thanks for all the help!
No worries. Glad we got that fixed. I just hope there wasn't a reason why the developer of the ruleset I based this on (WFRP3) was disabling the control rather than making it read only. :o Can't think of a particular reason why...

Mortar
March 18th, 2016, 00:58
Having said that, the format of links within a campaign story entry are different from those within a library formatted text entry. I just can't remember them off the top of my head, give me a bit to find them...


<linklist>
<link class="battle" recordname="battle.id-00001">Monsters</link>
<link class="imagewindow" recordname="image.id-00001">Map</link>
<link class="treasureparcel" recordname="treasureparcels.id-00001">Treasure</link>
<link class="imagewindow" recordname="image.id-00002">Note on found Garleth</link>
</linklist>


That what you are thinking of Trenloe? Got those out of a Pathfinder/homebrew story mod I have have slowly inputting.

Trenloe
March 18th, 2016, 04:36
That what you are thinking of Trenloe? Got those out of a Pathfinder/homebrew story mod I have have slowly inputting.
Not specifically, as I was referring to the Star Wars ruleset, which is a quite distinct ruleset that isn't based on CoreRPG. But, the theory is the same... :)

Thete
March 19th, 2016, 10:36
Not specifically, as I was referring to the Star Wars ruleset, which is a quite distinct ruleset that isn't based on CoreRPG. But, the theory is the same... :)

How would I resolve this for the WFRP v3 rulesset I'm using?

Regards

Trenloe
March 19th, 2016, 17:34
How would I resolve this for the WFRP v3 rulesset I'm using?
Edit classes\common\baseformattedtextfield.lua and change:


function onInit()
sourcenode = getDatabaseNode();
if sourcenode then
if sourcenode.isStatic() then
setEnabled(false);
end
end
end

to


function onInit()
sourcenode = getDatabaseNode();
if sourcenode then
if sourcenode.isStatic() then
setReadyOnly(true);
end
end
end

Thete
March 25th, 2016, 13:05
Thanks You Trenloe