PDA

View Full Version : Linking a picture in a Data Module



Dep200
February 2nd, 2018, 11:06
Hi all,

So my project based on TESV is going nicely thanks to help I got here from; Moon Wizard, Trenloe, Damned and Lord Entrails, thanks so much everying is going nice but slow.

So as you guessed I have another question, I was looking through the 5E data modules, while in FG, and observed that they have linked pictures to data module entries; so is there a way to do this under the 3.5 ruleset, which is where my project is being being created. I Know I can store images in an adventure module and link them to entries for the adventure module, my question is can I store images in the ruleset to be used by the data modules much like the way 5E appears to be?

Thanks All.
Dep200

damned
February 2nd, 2018, 12:59
Hi all,

So my project based on TESV is going nicely thanks to help I got here from; Moon Wizard, Trenloe, Damned and Lord Entrails, thanks so much everying is going nice but slow.

So as you guessed I have another question, I was looking through the 5E data modules, while in FG, and observed that they have linked pictures to data module entries; so is there a way to do this under the 3.5 ruleset, which is where my project is being being created. I Know I can store images in an adventure module and link them to entries for the adventure module, my question is can I store images in the ruleset to be used by the data modules much like the way 5E appears to be?

Thanks All.
Dep200

Hey Dep200

I dont believe there are pictures in the 5e ruleset that are being used in the modules... can you post a pic of some sort?

Zacchaeus
February 2nd, 2018, 14:26
Are you talking about images embedded in reference manuals? If so those are not stored in the ruleset but are embedded in the reference manual XML code.

Trenloe
February 2nd, 2018, 16:07
@Dep200 - can you give us more details of what you're trying to do? You can't have "images" in a ruleset or extension, only in a module (or a campaign, of course) as the details of these are stored in the FG database. You can have icons and tokens in a ruleset - but you're limited in what you do with these.

In theory the 5E ruleset has the same limitations/capabilities for images as the 3.5E ruleset. So let us know what you've seen in 5E and we can point you in the right direction.

Dep200
February 2nd, 2018, 18:27
Hey all,

Here is a screen shot. I tried to arrange it so as to show how I got to the picture. This is taken from the 5E PHB.

22072

I though maybe I should clarify here, I loaded up FG, started a 5E campaign, opened up the 5E PHB, clicked on classes, clicked on the fighter class and then clicked on the image of a fighter that brought up the picture on the right. Trying to add a similar link to weapons and armor in my project, however if you click on the image folder on the right side of the screen it shows to images there.

Thanks Dep

PS I may have just figured this out. I did a double check through the map folder on the right and found the image of the fighter stored there. Funny how the first time I checked this it was empty. I guess now I just need to know how to embed the link on my weapon description pop.22073

Trenloe
February 2nd, 2018, 18:52
PS I may have just figured this out. I did a double check through the map folder on the right and found the image of the fighter stored there. Funny how the first time I checked this it was empty.
Yeah, they are stored in the module, or a campaign, as an image file. These cannot be in rulesets or extensions, they have to be in modules.

Dep200
February 2nd, 2018, 18:55
Thanks,

Can you point me where I need to go to embed the link in my pop window description. Here's a screen shot of one of my pop up windows for a weapon.

22074

I know I need to create an xml line in the xml record of that weapon i need an example of that code?

Trenloe
February 2nd, 2018, 19:16
Best way to get any example XML is to make an example in a campaign, save the campaign and then look at the XML in db.xml.

Drag an image link to a story entry - then look at the XML for that story entry in the campaign database.

damned
February 2nd, 2018, 23:58
Create a line of text.
Image Link
and then press ctrl+5 and it will now accept a link and will use your text
or just drag the image into the formattedtext field and it will create the link and use the image name as the text

You can then view the xml in the db.xml

Dep200
February 4th, 2018, 14:00
Hey All,

As always you all are awesome with the responses. I followed what you all have said here and the image link shows up in the pop up window inside FG but when clicked on it show and empty drawing window:

22114

Here is the section of xml code from my client xml:

<irondagger>
<name type="string">Iron Dagger</name>
<cost type="string">10 gp</cost>
<weight type="number">2</weight>
<damage type="string">4</damage>
<critical type="string">2</critical>
<range type="number">1</range>
<damagetype type="string">Slashing/Piercing</damagetype>
<properties type="string"></properties>
<type type="string">One Handed Weapon</type>
<subtype type="string">Dagger</subtype>
<description type="formattedtext">
<id-00001>
<text type="formattedtext">
<linklist>
<link class="imagewindow" recordname="image.id-00001">Iron Dagger</link>
</linklist>
</text>
</id-00001>
<p>The iron dagger is a one handed weapon that is stronger then a bronze weapon and is among the most common and daggers of all swords that are
available. On a natural 20 dice roll with no critical melee weapon perk the iron sword will do additional 2 points of damage.</p>
<p><b>Smithing:</b>can be crafted without any Smithing perks. It can be forged at a blacksmith's forge and have the following components:
<li>1 iron ingots.</li>
<li>1 leather strip.</li></p>
<p>It can be upgraded with an iron ingot at a grindstone though it does not benefit from any Smithing perks.</p>
</description>
</irondagger>

Here is the xml code from my db.xml file from my campaign:

<image>
<id-00001>
<image type="image">
<bitmap>images/Iron Dagger.jpg</bitmap>
</image>
<isidentified type="number">0</isidentified>
<locked type="number">0</locked>
<name type="string">Iron Dagger</name>
</id-00001>
</image>

Not sure why the image is not loading, I am going to try and continue to work on this. Any help is much appreciated. I have one last thing to try and that is to us <image> command.

Thanks Dep

Trenloe
February 4th, 2018, 14:09
You’ll need to change the recordname entry in the link to point to the correct image entry in the module.

You will also need to export the image into the module, so you have everything in the same module.

Look at the image entry in the module and use the FG database reference in the link - with the addition of @modulename after the database reference.

More info here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Database. The “absolute module path” at the bottom of the page is an example of what you need to point to the image in the module.

Dep200
February 4th, 2018, 15:41
Hey Trenloe,

"You’ll need to change the recordname entry in the link to point to the correct image entry in the module."

When you say this you are referring to this line correct?
<link class="imagewindow" recordname="image.id-00001">Iron Dagger</link>
I thought "id-00001" was the correct way FG identifies the image, am I missing something?

Also when you say module are you referring to a data module or an adventure module i.e. the campaign folder?

I did a drag and drop of the image of the Iron Dagger inside fantasy grounds to the image folder from the right hand side of fantasy grounds.

When I then looked at my db.xml file it shows the image as "id-00001"

"Look at the image entry in the module and use the FG database reference in the link - with the addition of @modulename after the database reference."
Here are saying to look at the db.xml file like a state just above. If I actually look at the folder, through windows explore the image has the name I gave it.

I followed that link you gave me and read it a couple of times but it looses me. I was using the "Tale of Dinor 3.5" as my example to link images. I found the images all have a unique id, like "id-00001 all the way through "id-00008" in the db.xml file. I then was following, the example there, since the images are linked to encounters and used the code there as an example.

So as I usual I am lost again.

Thanks Dep

Talyn
February 4th, 2018, 17:20
You need to be working with an editable (not set to 'read-only') window to start with if you're doing all this in the UI. Say, an Item window, since you're talking about this Iron Dagger. The Iron Dagger image needs to already be in the Images campaign master index (the 'Images' button on the right-hand toolbar).

Click into the text area of the Item window and press Enter to create a blank line. Drag the image of the Iron Dagger out of the Images window and onto the blank line you just made. Done. That's literally all there is to it.

If you're fiddling with the XML then you need to know all the underlying recordnames and data paths, and it sounds like you'd be better off using the UI for now while you're learning.

I tl;dr'd this thread, so I didn't catch if this was for your personal home game?

Dep200
February 4th, 2018, 17:43
Talyn

Thanks, this is a custom ruleset and data modules based on Elder Scrolls V; Skyrim. It is for my personal home game for friends, don't want to intrude on Bethsada Studios rights for Skyrim. I do believe the window for the item description is not editable through FG UI. That was what I am working on now. You can not create a line and drop the image into that window at all. I have stored my iron dagger image, in the images folder for this campaign, using the right hand tool bar button in FG.

Thanks Dep

Dep200
February 4th, 2018, 18:20
Hey all,

Thanks for all the help, I got it to work, I had to load the images into the images folder of the campaign then export that folder as a separate data module and then in the recordname line after "id-00001" I added the @TES Images, the name of the data module I stored the image in; now it works as I wanted it.

As always all, thank you for all you help and patience.

Dpe200

Talyn
February 4th, 2018, 19:04
If the item is read-only, you make a copy of it (drag it back into the Items window, or into its own (or the New) group in the group drop menu). Then you can edit the text. There is never a need to export images into their own modules to do any of this.

Also you don't need to be fiddling with the XML for an image link. Once it's done in the UI, it's done.

Trenloe
February 5th, 2018, 03:04
and then in the recordname line after "id-00001" I added the @TES Images, the name of the data module I stored the image in; now it works as I wanted it.
Glad you got it working. That was what I was trying to communicate with the "absolute module path" reference to the documentation.