PDA

View Full Version : XML Modding Questions



SailorLovins
July 20th, 2018, 19:25
Can you give me a screenshot of an example where
<text type="formattedtext">
<p> </p>
</text>

and

<text2 type="formattedtext">
<p> </p>
</text>

are used? I would like to see the visual results.

Trenloe
July 20th, 2018, 19:49
You won't see anything with that - as they is just open text. <p> tags are paragraph breaks.

But, using <text2> indicates that there will be two columns. Check the "Here are the valid field values:" text in the Wiki reference manual.

Talyn
July 20th, 2018, 21:09
Here, try this for a visual and codified example:



<block_0000>
<frame type="string">sidebar</frame>
<align type="string">left,right</align>
<text type="formattedtext">
<p>This is the <b>text</b> field.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</text>
<text2 type="formattedtext">
<p>This is the <b>text2</b> field.</p>
<p>The &#60;align&#62; tag is parsed in <b>text,text2</b> order. When using a refblock frame such as this, the frame will always be applied to the right column.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</list>
</text2>
</block_0000>

Bidmaron
July 20th, 2018, 21:19
Trenloe, I had assumed that two columns meant the Table of Contents and the reference text, but this doesn't sound that way. I haven't gone through every module I've purchased (I buy a lot to support SW), but is there a PF module that is in two column format? The core rulebook isn't, nor is Rise of the Runelords.

Talyn
July 20th, 2018, 21:22
Probably not @Bidmaron. Given the usable default width to a refpage (meaning we're not considering resizability), the font size and the buffer between each asset in a refblock, the two column layout is rather limited in its usefulness. I've used it here and there (usually not even for a full page, just subsections of a page) such as the Lankhmar Player's Guide but it generally works out to be a more pleasant reading experience with single column except for a few outlying circumstances.

Bidmaron
July 20th, 2018, 21:25
Thanks, Talyn. I don't have your Lankhmar material, so can't check it.

SailorLovins
July 20th, 2018, 23:03
Thank you everyone who has patiently helped me bridge some gaps. Special shout out to Trenloe and Tayln. I am going to send you two brief message later. Here is my next question. Thanks to your combined assistance I have finally produced the start pages of a reference manual. It is viewable in fantasy grounds. However it is not in the order in which I intended. I am following the authors format as precisely as possible. Everything is out of order. My question is what tells each block item to appear in what order? I am not seeing a pattern here. Additionally, as you can see in notepad screen shot, I have a column block type containing an image and some text. How do I get the image to appear on the left and the text on the right? Attached is a png of my fantasy grounds result and followed by a png of the page in question as it appears in notepad++. I am disinclined to press forward too much until I understand this important principle so it's on to the drawing board for a personal project I am working on. Thank you again everyone.

This is the Reference Manual I produced from notepad++ as it appears in fantasy grounds.
24029


This is my XML file as it appears in notepad++ focused on the reference manual page and the order in which the blocks have been created. They do not stay in order. I need the blocks to appear in the same order as I have wrote them. Also how do I change the block containing an image and text in two columns to swap places? Image on the left and text on the right.
24031

Trenloe
July 20th, 2018, 23:14
Trenloe, I had assumed that two columns meant the Table of Contents and the reference text, but this doesn't sound that way. I haven't gone through every module I've purchased (I buy a lot to support SW), but is there a PF module that is in two column format? The core rulebook isn't, nor is Rise of the Runelords.
Note - this is just for the reference manual. Text2 is just one of the options for a second column in the reference manual "block". As referenced in the wiki page: "The second alignment value will then be applied to the text2, image or picture field." Text2 is just an option available to be used if desired. It's up to the reference manual developer to decide if there is any layout that is appropriate for them to use - like maybe a sidebar, a small flavour image or similar.

Trenloe
July 20th, 2018, 23:18
The order is alphabetical based off the XML block name:copyright cover, credits, disclaim,.

That's why in the reference manual wiki is shows the example as block_01

Call you blocks something like block_01, block_02, etc. and they will be displayed in that order.

Talyn
July 20th, 2018, 23:27
As @Trenloe notes, refpages are alpha-sorted by their names, as are the refblocks within them. Same with chapters and subchapters.

My personal standard is — if I will be containing the entire book within a single refchapter (99% of all reference manuals do this, it's cleaner to work with) — I name it chapter_00 (variable number of zeroes depending on my mood, but minimum of two). For the credits/legal/blahblah section, that is subchapter_00 (again, variable zeroes, but two allows me to go up to 99 subchapters before running into problems) then subchapter_01 will equate to Chapter 1 of the actual book. Makes it easier for me to mentally keep track of what's what. Likewise, I number my refpages and refblocks in similar fashion.

SailorLovins
July 20th, 2018, 23:35
Ok I have applied that. Now in the Cover block (which is now named block_02) I have this
<block_02>
<blocktype type="string">image</blocktype>
<align type="string">left,right</align>
<size type="string">138,242</size>
<image type="image"><bitmap>images/cover.jpg</bitmap></image>
<caption type="string">On the cover</caption>
<text type="formattedtext">
<p><b>ON THE COVER</b></p>
</text>
</block_02>


My intention is to have the image on the right column and the text vertically centered on the left column. As you see in my attached image from my original post this is swapped. Also is the caption tag required?

Bidmaron
July 21st, 2018, 00:31
Thanks, Trenloe. Boy, did I have a GCE (gross conceptual error) on that one. (not the first or last time, of course).

Talyn
July 21st, 2018, 00:41
Caption is never required. I almost never use it unless I have been provided with the actual title of the artwork or if the book itself already had a caption.

Text cannot be centered. The only two exceptions to that are the "header" blocktype and an image caption.

SailorLovins
July 21st, 2018, 00:59
Im back and moving along nicely. I am just down to a couple of final touches. Here is my question. How do I assign an image, say a thumbnail, to appear in the data module activation and library windows? The image I am using is the cover image whos original size is 505,654. As always thank you for your time and patience.

SailorLovins
July 21st, 2018, 01:02
This should be my final question of the night. And it is just for detail quality rather than necessity. How do I add the left and right page turn icons at the bottom of most of the reference manual pages? Are these specific links to certain pages or do they actually turn to the next <refpage> element on the list?

Trenloe
July 21st, 2018, 01:05
I've merged all of these many threads together - same OP, similar topics. There’s really no need for these to be separate - the fact that they were the same title with an incremental number kinda suggested there wasn’t a need for individual threads as well!

Original request to do this and reason given here: https://www.fantasygrounds.com/forums/showthread.php?44805-Symbol-codes&p=397779&viewfull=1#post397779

Talyn
July 21st, 2018, 01:26
Thanks, Trenloe!

#4: Just make a small PNG image named thumbnail.png in the root folder where your definition.xml and client.xml or db.xml lie. I don't know the exact size FG uses; I've seen some DLC use 150px height. I usually use 200px height.

#5: FG generates those automatically if your indexing is done in a way it wants. See my above commentary on the preferred "inline" method of building your refpages. :)

SailorLovins
July 21st, 2018, 01:32
Thanks for merging these I hope they will help others! I will get to work on this. These pages are looking real sharp thanks to you all.

SailorLovins
July 21st, 2018, 01:49
Ok actually one last thing. When I copy and paste the copyright symbol © or even do the Alt 0169 combo, the finished product looks like this ©. I can't get rid of the accented A. I didn't put it there. Not sure how to get rid of it.

Talyn
July 21st, 2018, 01:52
You have to use ASCII codes. & # 169 ; (delete the spaces; stupid vbcode) for Copyright.

FG's formatted text renderer won't render most high characters directly, you have to use the ASCII codes for them.

SailorLovins
July 21st, 2018, 05:06
One last one for the night. How do I link an image inside a text element? For example I am inputting the race information in both the <reference><racedata> tags and the <reference><referencemanual> tags. I have the image appearing in the reference manual but how do I link the image in the race window when players select the specified race in question?

Bidmaron
July 21st, 2018, 05:57
Drag the link icon from the race image in the images window list to the race window where you want the link to appear.