View Full Version : librarylink vs linklist vs windowcontrol
kirbol
September 19th, 2010, 15:58
To start, this is somewhat of a convoluted issue, the crux of the issue is I cannot seem to find any documentation on librarylink and linklist.
The problem:
I've written the inventory items to allow drops of type item.
Items include two lists (threads and properties), which I've used variants of the copy node function found on the boards here.
Items in the library are referenced using linklist as part of a table.
Item cards include a shortcut (windowcontrol)
The gm can use either link (linklist or item card shortcut) to drop the item into a character's inventory without an error
the player gets an error referencing the second list only when using the linklist, the item card shortcut works fine
In a template library, items are references using librarylink, which player and gm can drag and drop into inventory without issue.
I've verified this issue in 2.6.5, 2.7.1, and 2.7.2 of FG
when the second srclist errors, all that appears on the sheet is a blank list item.From all of my testing, the gm can use any link and the item copies properly, where a player can only use those links created by the item card's shortcut (windowcontrol) or a librarylink reference.
It appears there is some difference in how a link created by linklist is handled based on role, gm or player.
Since I can't find any documentation on either of these two resources, the only resolution I can think of would be a rewrite of the module, excluding links to items from any informational tables.
Any enlightenment on the subject would be greatly appreciated,
-kirbol
Moon Wizard
October 6th, 2010, 03:16
Kirbol,
I think something that will help is an explanation of each of the objects you are referring to.
librarylink = The name of a windowreferencefield control used in reference windows for some rulesets (such as 4E).
linklist = An internal only tag used to denote a list of links within a formattedtextcontrol object.
windowcontrol = the base object for any control created within a window in FG (stringcontrol, stringfield, numbercontrol, numberfield, windowlist, ...)
Also, the player can only create data under nodes which they "own" in the database, whereas the GM can create data anywhere in the database.
The best way to figure out what is going on is to open the db.xml file while FG is running using a text editor. Then, find the area you are changing. Next, make the change in FG, and type /save in the chat entry window. Finally, reload the db.xml file to see what got saved.
It sounds like you are doing something very similar to what was already done by Tenian to build weapon tables in 4E modules.
Example in next post.
Cheers,
JPG
Moon Wizard
October 6th, 2010, 03:19
Snippet from module for weapons table. See reference_equipment.xml in 4E ruleset to see how this data is used. Also, see charsheet_inventory.xml for drop handling from module to character sheet, and adventure_items.xml for drop handling from module to campaign item list.
<reference static="true">
<weapon>
<club>
<name type="string">Club</name>
<type type="string">Melee</type>
<prof type="string">Simple</prof>
<heft type="string">One-Handed</heft>
<profbonus type="number">+2</profbonus>
<damage type="string">1d6</damage>
<range type="number">0</range>
<cost type="number">1</cost>
<weight type="number">3</weight>
<group type="string">Mace</group>
<properties type="string">—</properties>
<description type="formattedtext">
</description>
</club>
<dagger>
<name type="string">Dagger</name>
<type type="string">Melee</type>
<prof type="string">Simple</prof>
<heft type="string">One-Handed</heft>
<profbonus type="number">+3</profbonus>
<damage type="string">1d4</damage>
<range type="number">5</range>
<cost type="number">1</cost>
<weight type="number">1</weight>
<group type="string">Light blade</group>
<properties type="string">Off-hand, light thrown</properties>
<description type="formattedtext">
</description>
</dagger>
.......
</weapon>
</reference>
<weaponlists>
<core>
<description type="string">Weapons Table</description>
<groups>
<section001>
<description type="string">Simple Melee Weapons</description>
<subdescription type="string">One-Handed</subdescription>
<weapons>
<a0001club>
<link type="windowreference">
<class>referenceweapon</class>
<recordname>reference.weapon.club@4E Players Handbook</recordname>
</link>
<name type="string">Club</name>
<profbonus type="number">+2</profbonus>
<range type="number">0</range>
<cost type="string">1</cost>
<weight type="string">3</weight>
<group type="string">Mace</group>
<properties type="string">—</properties>
<damage type="string">1d6</damage>
</a0001club>
<a0002dagger>
<link type="windowreference">
<class>referenceweapon</class>
<recordname>reference.weapon.dagger@4E Players Handbook</recordname>
</link>
<name type="string">Dagger</name>
<profbonus type="number">+3</profbonus>
<range type="number">5</range>
<cost type="string">1</cost>
<weight type="string">1</weight>
<group type="string">Light blade</group>
<properties type="string">Off-hand, light thrown</properties>
<damage type="string">1d4</damage>
</a0002dagger>
......
</weapons>
</section001>
<section002>
......
</groups>
</core>
</weaponlists>
kirbol
October 6th, 2010, 15:07
Moon,
Thanks for replying, unfortunately, I'm still running into issues.
First, it seems that librarylink and linklist are both tags provided by FG? I cannot find definitions for either anywhere in the ruleset files:
Earthdawn # grep -r link * |grep "<template"
common_templates.xml: <template name="linkednumber">
common_templates.xml: <template name="linkstringfield">
common_templates.xml: <template name="staticlinkstringfield">
common_templates.xml: <template name="staticlinkstringcontrol">
Earthdawn # grep -r library * |grep "<template"
common_templates.xml: <template name="closebutton_library">
Here are snips of the lib, perhaps that may help illuminate my mistake:
<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.06">
<library><!--{{{-->
<edrefgear static="true"><!--{{{-->
<categoryname type="string">Earthdawn Reference</categoryname>
<name type="string">Earthdawn Gear</name>
<entries>
<a-weapons>
<librarylink type="windowreference">
<class>referenceindex</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Weapons</name>
<description type="formattedtext">
--descriptions--
</description>
<index>
<a-melee>
<name type="string">Melee Weapons</name>
<listlink type="windowreference">
<class>referencetextwide</class>
<recordname>reference.tables.melee@Earthdawn Gear</recordname>
</listlink>
</a-melee>
<..snip other table references>
</index>
</a-weapons>
</entries>
</edrefgear>
</library>
<reference>
<tables>
<melee>
<name type="string">Melee Weapons</name>
<text type="formattedtext">
<table>
<tr decoration="underline">
<td colspan="2"></td>
<td><b>Cost</b></td>
<td><b>Damage Step</b></td>
<td><b>Strength Minimum</b></td>
<td><b>Weight</b></td>
<td><b>Size</b></td>
</tr>
<tr> <!-- This reference links to the object, but cannot be used by players to drop onto list item -->
<td colspan="2">
<linklist>
<link class="item" recordname="reference.weapons.melee.dagger@Earthdawn Gear">Dagger</link>
</linklist>
</td>
<td>8 cp</td>
<td>2</td>
<td>5</td>
<td>1</td>
<td>1</td>
</tr>
<tr> <!-- this doesn't create a working link, and somehow inserts into the table very strangely -->
<td colspan="2">
<link type="windowreference">
<class>item</class>
<recordname>reference.weapons.melee.dagger@Earthdawn Gear</recordname>
</link>
Dagger
</td>
<td>8 cp</td>
<td>2</td>
<td>5</td>
<td>1</td>
<td>1</td>
</tr>
</table>
</text>
</melee>
<snip other tables>
</tables>
<weapons>
<melee>
<dagger>
<name type="string">Dagger</name>
<props>
<type>
<property type="string">Type</property>
<value type="string">Melee</value>
</type>
<cost>
<property type="string">Cost</property>
<value type="string">0.8</value>
</cost>
<damagestep>
<property type="string">Damage Step</property>
<value type="string">2</value>
</damagestep>
<strmin>
<property type="string">Strength Minimum</property>
<value type="string">5</value>
</strmin>
<weight>
<property type="string">Weight</property>
<value type="string">1</value>
</weight>
<size>
<property type="string">Size</property>
<value type="string">1</value>
</size>
</props>
<description type="string">
A dagger is a small, sharp-bladed weapon with a maximum length of 12 inches. A blade longer than 12 inches is considered a sword.
</description>
<text type="formattedtext">
<p>
A dagger is a small, sharp-bladed weapon with a maximum length of 12 inches. A blade longer than 12 inches is considered a sword.
</p>
</text>
<maxthreads type="number"></maxthreads>
<spelldefense type="number"></spelldefense>
<threads>
</threads>
</dagger>
</melee>
</weapons>
</reference>
</root>
I've tested using the librarylink setup, rather than the formatted table with linklist, allows the direct link to be used by players for drag and drop. For some reason the linklist doesn't appear to behave the same.
Right now, it looks like I will not be able to use linklists in the formatted table, as the error popups can be frustrating if these are tried.
If the player first follows the link in the table to the item card, and uses the link in it (windowreference) to drag and drop, the item populates on their inventory sheet properly.
I just can't seem to understand why the librarylink style works where the linklist does not for the players (prior to opening the item card.... all cases work for the gm)
I could provide the library I'm working on, if that would help...
Thanks again for the assistance,
-kirbol
Moon Wizard
October 6th, 2010, 16:54
Kirbol,
Some clarifications:
* librarylink is not provided by FG, but by the rulesets written for FG. It's simply the name given to a database node in the 3.5E and 4E rulesets. In those rulesets, that node has the type "windowreference". The "windowreference" data type always refers to a matching windowreferencefield defined in one of the windows of a ruleset. Run a search for "librarylink" on the unpacked 4E ruleset.
* linklist is an internal tag used by database nodes of the type "formattedtext". The "formattedtext" data type refers to a matching formattedtextfield defined in the ruleset. However, the internal layout of formattedtext data types have never been well documented, since before I began working on FG. Also, formattedtext data types are somewhat particular about the ordering of elements, table support is limited, and the control behavior is not the same as other elements. My guess is that you will not be able to use linklists for reference modules you want to drag from at this point. The 4E ruleset uses an alternate approach using windowlists and windowclasses instead, which is the partial example I posted. Look in reference_equipment.xml
In summary, the primary issue is between the behavior of links from a "windowreferencecontrol" and a "formattedtextcontrol"; and the FTC object does not have the same behavior for links. I will look into it further, but anything I uncover will be added to the wish list for future updates.
Regards,
JPG
kirbol
October 7th, 2010, 04:12
Thanks very much for this, I'm now understanding how these fit together better. With your description, I was able to locate and understand (I think) the librarylink that was causing me so much confusion.
I've taken a quick look at reference_equipment.xml, I'll have to take some time to digest all that's in there. For now I'm content with the options of using it as is, with the caveat that players will have to open the card first, or rewriting the structure, with an info table, and the links in a separate list.
Yeah, if links working the same in both types could go on the wishlist, that would be great.
... and perhaps if not already there, maybe an upgrade to the table handler for links? <tl> tag perhaps? :)
Again, thanks so much,
-kirbol
Moon Wizard
October 7th, 2010, 05:40
Also, I was able to make a minor update that I included in the v2.7.2 update today. (Use the Test Mode Manager,and click Dev Release to access.) This minor update may address the difference you were seeing, or not.
Could you give it a try to see if it makes the behavior the same between the two drag objects? If not, the difference is much deeper, and will have to be added to the long-term list.
Cheers,
JPG
kirbol
October 7th, 2010, 14:06
Awesome! Yes, I can verify that under every test I tried, both links work identically for the GM and the player.
I tried with existing campaigns and characters, new campaigns, new characters, GM adding first item to char sheet then player. Player adding first, etc, and they all work as expected.
Thanks a ton for taking the time on this one,
-kirbol
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.