PDA

View Full Version : Rederence manual - problem



Xarxus
July 11th, 2021, 19:25
Hi guys, I need your help. I am writing a Reference Manual and I have a problem immediately: the images are not shown.
I have a client.xml file, a definition.xml and a hidden_images folder in which I am putting the images.

I show you the code, so you tell me if I wrote something wrong (in the image I put the result: all white).
48149

I double-checked both the file name and the path and they are correct.

client.xml

<?xml version="1.0" encoding="iso-8859-1"?>
<root version="4.0">

<library>
<MYRULES-00>
<name type="string">My Rules</name>
<categoryname type="string">My Rules Essentials</categoryname>
<entries>
<_reference_manual_index static="true">
<librarylink type="windowreference">
<class>reference_manual</class>
<recordname>reference.refmanualindex</recordname>
</librarylink>
<name type="string">Reference Manual</name>
</_reference_manual_index>
</entries>
</MYRULES-00>
</library>

<hiddenimage>
<id-00001>
<image type="image">
<bitmap>hidden_images\Front_Cover_h780.jpg</bitmap>
</image>
<name type="string">Front Cover</name>
</id-00001>
</hiddenimage>

<reference>
<refmanualdata static="true">
<refpage_myrules>
<name type="string">MY RULES</name>
<group type="string">My Rules</group>
<subgroup type="string">Cover Images</subgroup>
<text type="formattedtext" />
<blocks/>
</refpage_myrules>
<refpage_frontpage>
<name type="string">Front Cover</name>
<group type="string">My Rules</group>
<subgroup type="string">Cover Images</subgroup>
<text type="formattedtext" />
<blocks>
<block_00001>
<align type="string">center</align>
<size type="string">541,700</size>
<image type="image">
<bitmap type="string">hidden_images\Front_Cover_h780.jpg</bitmap>
</image>
<caption type="string" />
<imagelink type="windowreference">
<class>imagewindow</class>
<recordname>hiddenimage.id-00001</recordname>
</imagelink>
<text type="formattedtext"/>
<blocktype type="string">image</blocktype>
</block_00001>
</blocks>
</refpage_frontpage>
</refmanualdata>
<refmanualindex static="true">
<chapters>
<chapter_000000>
<name type="string">My Rules</name>
<subchapters>
<subchapter-000001>
<name type="string">Cover Images</name>
<refpages>
<refpage_000001>
<listlink type="windowreference">
<name type="string">Front Cover</name>
<keywords type="string">front cover</keywords>
<class>reference_manualtextwide</class>
<recordname>reference.refmanualdata.refpage_frontpage@My Rules</recordname>
<description>
<field>name</field>
</description>
</listlink>
<name type="string">Front Cover</name>
</refpage_000001>
</refpages>
</subchapter-000001>
</subchapters>
</chapter_000000>
</chapters>
</refmanualindex>

</reference>
</root>

Moon Wizard
July 11th, 2021, 22:11
It's because you are defining the reference manual in an XML files with a FGU version (v4.0); but defining the type="image" values using the FGC version format (v3.x).

The data for the reference manual must be in the same version format as the file tag. So, you either need to continue building modules in FGC and using your current reference manual method; or build in FGU but define a new reference manual creation method.

The v4.1 format looks like this:


<reference>
...
<refmanualdata>
<refpage_frontpage>
<name type="string">Front Cover</name>
<blocks>
<id-00001>
<blocktype type="string">image</blocktype>
<image type="image">
<layers>
<layer>
<name>Front Cover.jpg</name>
<id>0</id>
<parentid>-1</parentid>
<type>image</type>
<bitmap>images/Front Cover.jpg</bitmap>
</layer>
</layers>
</image>
</id-00001>
...
</blocks>
</refpage_frontpage>
...
</refmanualdata>
<refmanualindex>
...
</refmanualindex>
...
</reference>


Regards,
JPG

Xarxus
July 12th, 2021, 00:23
Oh, tnx. Perhaps I've seen the wrong pages. Have you a right link?

Ty!

Talyn
July 12th, 2021, 03:21
I doubt the documentation has been updated. Easiest way to get the new tags would be to import any image to your campaign, exit FG then look at the db.xml -- note that it contains a lot of tags which are not necessary just to display on a refpage. Moon Wizard's example gave all you really need for the basics.

Another quick 'fix' is to leave your markup alone and change your version tag to:

<root version="3.3" release="35|CoreRPG:4.1">
or shorten to

<root version="3.3">
works in a pinch too. That will tell FGU to not look for the new imaging tags and render your refpages in Classic backward-compat mode instead.

Xarxus
July 13th, 2021, 08:59
Ty Talyn!

Xarxus
July 13th, 2021, 09:58
Always talking about images and why I they are not shown, there is some change in 4.0?

<image type="image"><bitmap>[Only used for image blocks. Local file path to image within the module.]</bitmap></image>
I've found here (https://www.fantasygrounds.com/wiki/index.php/Reference_Manuals)

Even using the new version with layers I only see a white box.

Ok, solved: I've an extension on Code which converts \ in /

Talyn
July 13th, 2021, 16:34
Ok, solved: I've an extension on Code which converts \ in /

Not sure what that means, but glad you've figured it out. :)


I've found here (https://www.fantasygrounds.com/wiki/index.php/Reference_Manuals)

@Moon Wizard -- far as I can tell, that particular wiki page has not been replicated on the new wiki. If you're still preferring the 'inline' method for reference manuals (I sure do, makes it way less complicated and tedious to update things) may I request that when the page does get put on the new wiki that it contains a section explaining the 'inline' method with an example?

Xarxus
July 13th, 2021, 17:56
I explain myself better, I was a bit cryptic. ;)

I use an XML editor made by Microsoft. It's called Visual Studio Code. This editor allows you to use extensions that make programming easier. In particular I was using one for XML which, when asked to format the document (indent it correctly), replaced all the characters \ with the character /.
This means that the path hidden_images\my_pic.jpg was changed to hidden_images/my_pic.jpg , and this was not appreciated by FGU.

As for wikis (I don't know if you were talking to me or Moon Wizard), I always like everything. I'm struggling to find updated guides, so everything you do, everything you want to tell me, is very welcome.

Talyn
July 13th, 2021, 18:06
It's called Visual Studio Code. This editor allows you to use extensions that make programming easier. In particular I was using one for XML which, when asked to format the document (indent it correctly), replaced all the characters \ with the character /.
This means that the path hidden_images\my_pic.jpg was changed to hidden_images/my_pic.jpg , and this was not appreciated by FGU.


Ah, yes I have Visual Studio Code. I'm so accustomed to Notepad++ (and a couple of the extensions for it, specifically XML Tools which I use constantly) that I have difficulty adapting myself to it, unfortunately.

However, the / is indeed the correct character.

Here's a sample refpage from last year (coded for Classic):


<refpage_00001>
<blocks>
<block_001>
<blocktype type="string">image</blocktype>
<image type="image">
<bitmap>images/cover.jpg</bitmap>
</image>
<imagelink type="windowreference">
<class>imagewindow</class>
<recordname>image.cover</recordname>
</imagelink>
<size type="string">535,693</size>
</block_001>
</blocks>
<keywords type="string"></keywords>
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>..</recordname>
</listlink>
<name type="string">Cover</name>
</refpage_00001>


And here's the same refpage as I'm going through and updating for 4.1 (Unity):


<refpage_00001>
<blocks>
<block_001>
<blocktype type="string">image</blocktype>
<image type="image">
<layers>
<layer>
<name>cover.jpg</name>
<id>1</id>
<parentid>-1</parentid>
<type>image</type>
<bitmap>images/cover.jpg</bitmap>
</layer>
</layers>
</image>
<imagelink type="windowreference">
<class>imagewindow</class>
<recordname>image.cover</recordname>
</imagelink>
<size type="string">535,693</size>
</block_001>
</blocks>
<keywords type="string"></keywords>
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>..</recordname>
</listlink>
<name type="string">Cover</name>
</refpage_00001>


This page also uses the 'inline' method mentioned above. The content and navigation info are all contained in the same place rather than having to skip around to two separate locations for each. But you'll notice they have the / character which has always been what FG expects:


<bitmap>images/cover.jpg</bitmap>

Moon Wizard
July 13th, 2021, 18:34
The wiki is not migrated on purpose; because we want to move away from reference manuals being generated manually. We're working on some ruleset support for reference manual building internally.

Regards,
JPG

Xarxus
July 13th, 2021, 19:29
The wiki is not migrated on purpose; because we want to move away from reference manuals being generated manually. We're working on some ruleset support for reference manual building internally.

Regards,
JPG

I'll love this :)

PS even for data?