PDA

View Full Version : How to, basic ref manuals ?



celestian
August 5th, 2017, 00:35
Okay, so with the 3.3.2 changes coming up (see here) (https://www.fantasygrounds.com/forums/showthread.php?39182-Test-Release-v3-3-2&p=349334&viewfull=1#post349334) I would like to try and learn a bit of how to use them.

I've made a very basic ref manual, can load it up and do simple chapter/sub/text display but have had no luck trying to get the new bits that JPG mentioned.

Are there any really basic ref manuals or documentation that would help me get on the right path? I'm just kinda at a loss where to put what he's got there. I've poked around the wiki but my search foo is failing me.

Really just wanting to know how to make a really simple manual and list say... spells in the spell records. Items would be fine... anything would get me on the path to figuring out the rest.

Here is a snippet of what im using in a list/ref/chapter. I've also tried the exact "Feats" and "feat" that JPG listed.



<chapter_01>
<name type="string">Items</name>
<subchapters>
<subchapter_01>
<name type="string">Equipment</name>
<p><b>Sidebar</b></p>
<p><i>Equipment List</i></p>
<refpages>
<refpage_00>
<name type="string">Items</name>
<keywords type="string"></keywords>
<items>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Items</name>
<recordtype type="string">item</recordtype>
</items>
</refpage_00>
</refpages>
</subchapter_01>
</subchapters>
</chapter_01>



When I click the link I get a "Unable to create window with invalid class{}.

If there is a good walk through for this sorta stuff I'd love to use it.

Moon Wizard
August 5th, 2017, 02:18
Are you sure that you are running the latest v3.3.2, and that there is not a CoreRPG folder in your rulesets folder?

There is no other documentation currently for those 2 classes, other than what I made in that post. (Or you can review the classes directly in the ruleset to see how they work.) The grouped list class is also the basis for the new Armor and Weapons buttons in the 3.5E and 5E campaign Items list.

Regards,
JPG

celestian
August 5th, 2017, 02:59
Are you sure that you are running the latest v3.3.2, and that there is not a CoreRPG folder in your rulesets folder?

There is no other documentation currently for those 2 classes, other than what I made in that post. (Or you can review the classes directly in the ruleset to see how they work.) The grouped list class is also the basis for the new Armor and Weapons buttons in the 3.5E and 5E campaign Items list.

Regards,
JPG

Double and triple checked the version. I did have a CoreRPG ruleset folder (I use it a lot for searches) but removed it and then created a clean campaign... put a couple items in the Item record and started it up (commented out the armor section) and still was getting the class error.

Sorry, I didn't mean to imply I was looking for documentation on the new stuff in 3.3.2, but more about the basics of Ref manuals. I've found a few entries on the wiki and searched the forum and found some bits. I thought I had a decent handle on it but hung up on this bit so figured it was just my lack of experience.

I'll futz around with it and see if I'm missing something else. This is what I just tested with...



<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">

<!-- library -->
<library>
<assettemplates>
<name type="string">AD&#38;D Core Referance Book</name>
<categoryname type="string">AD&#38;D</categoryname>
<entries>
<refboot101_01>
<name type="string">Handbook</name>
<librarylink type="windowreference">
<class>reference_manual</class>
<recordname>lists.referencemanual</recordname>
</librarylink>
</refboot101_01>
</entries>
</assettemplates>
</library>

<!-- lists -->
<lists>
<referencemanual>
<chapters>
<chapter_01>
<name type="string">Records</name>
<subchapters>
<subchapter_01>
<name type="string">Gear</name>
<refpages>
<refpage_00>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Items</name>
<recordtype type="string">item</recordtype>
</refpage_00>
</refpages>
</subchapter_01>
</subchapters>
</chapter_01>
</chapters>
</referencemanual>
</lists>

<!-- reference -->
<reference>
<referencemanual>
</referencemanual>
</reference>

<!-- list static??? -->
<list static="true">
<armor>
<name type="string">Armor</name>
<recordtype type="string">item</recordtype>
<filters>
<filter1>
<field type="string">type</field>
<value type="string">Armor</value>
</filter1>
</filters>
<groups>
<group1>
<field type="string">subtype</field>
</group1>
</groups>
<grouporder type="string">Light|Medium|Heavy|Shield|Extras</grouporder>
<columns>
<column1>
<name type="string">name</name>
<heading type="string">Name</heading>
<width type="number">200</width>
</column1>
<column2>
<name type="string">cost</name>
<heading type="string">Cost</heading>
<center />
</column2>
<column3>
<name type="string">ac</name>
<heading type="string">AC</heading>
<tooltip type="string">Armor Class</tooltip>
<type type="string">number</type>
<center />
</column3>
<column4>
<name type="string">weight</name>
<heading type="string">Weight</heading>
<type type="string">number</type>
<center />
</column4>
</columns>
</armor>
</list>

<!-- tabledata -->
<tabledata>
</tabledata>
</root>


This was from a fresh CoreRPG campaign with nothing else loaded.
https://i.imgur.com/KXbT6pj.png

Wookiee420
August 5th, 2017, 04:20
i might be wrong but i dont think you can do lists.referencemanual. i think its supposed to be reference.referencemanual and then in your refpage i dont link reference_list is a thing either it should be
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>..</recordname>
</listlink>


yeah you want to put your RefMan in the section below in <reference>, lists are for item/npc/etc lists

feel free to pm me on discord i can help you when i am not working

also you have two list sections, i dont think you can have a <lists> and a <list> (AFAIK you do not need the static="true" on lists)

Moon Wizard
August 5th, 2017, 05:58
Here's the link to the Reference Manuals topic. It's linked from the Campaign and Module Data File topic.
https://www.fantasygrounds.com/wiki/index.php/Reference_Manuals

You're using the wrong field name (librarylink). It should be listlink. So, the reference manual code is pulling an empty path and empty class, since it's trying to read from a listlink field.

Regards,
JPG

celestian
August 5th, 2017, 06:19
i might be wrong but i dont think you can do lists.referencemanual. i think its supposed to be reference.referencemanual and then in your refpage i dont link reference_list is a thing either it should be
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>..</recordname>
</listlink>


yeah you want to put your RefMan in the section below in <reference>, lists are for item/npc/etc lists

feel free to pm me on discord i can help you when i am not working

also you have two list sections, i dont think you can have a <lists> and a <list> (AFAIK you do not need the static="true" on lists)

reference_list is a new thing added in 3.3.2 (which was what got me interested in ref manuals) ;')

I've tweaked the list/reference as recommended. Trying some other things. With the mention of using listlink instead of librarylink the window at least loads now but no items are listed. Going to go peruse the link JPG suggested above tho I might ping you in discord ;)

celestian
August 5th, 2017, 06:22
Here's the link to the Reference Manuals topic. It's linked from the Campaign and Module Data File topic.
https://www.fantasygrounds.com/wiki/index.php/Reference_Manuals

You're using the wrong field name (librarylink). It should be listlink. So, the reference manual code is pulling an empty path and empty class, since it's trying to read from a listlink field.

Regards,
JPG

Woops on the librarylink, I just copy/pasted the code from the 3.3.2 section you had there. I'll correct that and review the link (think I've visited it once today).

Correcting the link line does bring up window, now to just figure out why it's not loading the records now ;)

Moon Wizard
August 5th, 2017, 06:39
Only reference_manualtextwide and referencemanualpage classes can be embedded within the right side of the reference manual window currently. Putting any other class in there right now will pop up a separate window. The reference manual is very specific about what it does (showing an index on the left, and displaying a specific reference manual text page class on the right); it's not really a general purpose solution at this point.

That might be what is happening.

Regards,
JPG

celestian
August 5th, 2017, 07:42
Only reference_manualtextwide and referencemanualpage classes can be embedded within the right side of the reference manual window currently. Putting any other class in there right now will pop up a separate window. The reference manual is very specific about what it does (showing an index on the left, and displaying a specific reference manual text page class on the right); it's not really a general purpose solution at this point.

That might be what is happening.

Regards,
JPG

Yeap! I was assuming I could place that stuff anywhere and it would work. I moved it to the library and it popped up the window properly (data is another matter).

So, I think I misunderstood what this is suppose to do? I poked at the lua behind this for a bit and after adding in some debug I saw what was going where and even plugged in a <source type="string">item</source> trying to see if that would get the results I was expecting (it did not).

What I thought this feature would do is load the local/campaign "records" (record item->*, spell->*/etc) in these windows. The only way I could get this behavior was if I hacked the code a bit... specifically this bit in ref_simplelist.lua and use the source I mentioned above.



if rList.sSource then
local sModule = DB.getModule(getDatabaseNode());
if sModule and not rList.sSource:match("@") then
--rList.sSource = rList.sSource .. "@" .. sModule;
end
Debug.console("ref_simplelist.lua","init","rList.sSource2",rList.sSource);
Debug.console("ref_simplelist.lua","init","sModule1",sModule);
for _,vNode in pairs(DB.getChildren(rList.sSource)) do
nRows = nRows + addListRecord(vNode, rList);
end
elseif rList.sRecordType then
-- .......


That got it to do what I expected (load 'item' children).

Thinking about it now it doesn't make much sense to load just "local" records since most will come from modules and ref manuals are generally tied to modules.

I attempted to get it to load a module items (my item module 'item@Items' unless I'm not knowing what im doing, they look like this databasenode = { item.id-00006@Items }) using the <recordtype> with item@Items and couldn't get that to work (before or after my hacks) but I'll chalk that up to still not knowing how this stuff is suppose to work.

Maybe I'll think more clearly tomorrow and figure this out ;)

So much for sleep, I decided to just try one last thing. I put item@Items in the <source> and it works (I had reverted the lua code back to original).

celestian
August 5th, 2017, 20:26
Got the chance to play around with grouplist and figured out how to use those as well I think. I'll post the XML for what I have working.

Note: I use modules for the source of these list/grouplists.

Items = "@Items" (contains all armor/gear/etc)
Spells = "@2e Spells"

You can replace those with names of your own spell/item modules for this to work. Just keep in mind your spells probably don't have the Arcane/Divine (AD&D thing) so the spells list for Arcane/Divine wont work but "Spells - All" should.



<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">

<!-- library -->
<library>
<assettemplates>
<name type="string">AD&#38;D Core Referance Book</name>
<categoryname type="string">AD&#38;D</categoryname>
<entries>
<ref_01>
<name type="string">Handbook</name>
<librarylink type="windowreference">
<class>reference_manual</class>
<recordname>lists.ADNDCoreRefIndex</recordname>
</librarylink>
</ref_01>
<ref_02>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Items - All</name>
<source type="string">item@Items</source>
<recordtype type="string">item</recordtype>
</ref_02>


<ref_03>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Spells - All</name>
<source type="string">spell@2e Spells</source>
<recordtype type="string">spell</recordtype>
</ref_03>
<ref_04>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Spells - Arcane</name>
<source type="string">spell@2e Spells</source>
<recordtype type="string">spell</recordtype>
<filters>
<filter1>
<field type="string">type</field>
<value type="string">Arcane</value>
</filter1>
</filters>
</ref_04>
<ref_05>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Spells - Divine</name>
<source type="string">spell@2e Spells</source>
<recordtype type="string">spell</recordtype>
<filters>
<filter1>
<field type="string">type</field>
<value type="string">Divine</value>
</filter1>
</filters>
</ref_05>
<ref_06>
<librarylink type="windowreference">
<class>reference_groupedlist</class>
<recordname>lists.armor</recordname>
</librarylink>
<name type="string">Equipment - Armor</name>
</ref_06>
</entries>
</assettemplates>
</library>

<!-- lists -->
<lists>
<armor>
<name type="string">Armor</name>
<source type="string">item@Items</source>
<!-- <recordtype type="string">item@Items</recordtype> -->
<filters>
<filter1>
<field type="string">type</field>
<value type="string">Armor</value>
</filter1>
</filters>
<groups>
<group1>
<field type="string">subtype</field>
</group1>
</groups>
<grouporder type="string">Light|Medium|Heavy|Shield|Extras</grouporder>
<columns>
<column1>
<name type="string">name</name>
<heading type="string">Name</heading>
<width type="number">200</width>
</column1>
<column2>
<name type="string">cost</name>
<heading type="string">Cost</heading>
<center />
</column2>
<column3>
<name type="string">ac</name>
<heading type="string">AC</heading>
<tooltip type="string">Armor Class</tooltip>
<type type="string">number</type>
<center />
</column3>
<column4>
<name type="string">weight</name>
<heading type="string">Weight</heading>
<type type="string">number</type>
<center />
</column4>
</columns>
</armor>
<ADNDCoreRefIndex>
<chapters>
<chapter_01>
<name type="string">Introduction</name>
<subchapters>
<subchapter_01>
<name type="string">The Ruleset Overview</name>
<refpages>
<refpage_00>
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>reference.ADnDCoreRef.page_01</recordname>
</listlink>
<name type="string">xxPageName</name>
<keywords type="string">xxKeyword xxKeyword</keywords>
</refpage_00>
</refpages>
</subchapter_01>
<subchapter_02>
<name type="string">Character Sheet</name>
<refpages>
<refpage_00>
<listlink type="windowreference">
<class>reference_manualtextwide</class>
<recordname>reference.ADnDCoreRef.page_02</recordname>
</listlink>
<name type="string">xxPageName</name>
<keywords type="string">xxKeyword xxKeyword</keywords>
</refpage_00>
</refpages>
</subchapter_02>
</subchapters>
</chapter_01>
</chapters>
</ADNDCoreRefIndex>
</lists>

<!-- reference -->
<reference>
<ADnDCoreRef>
<page_01>
<name type="string">First Page</name>
<!-- Optional leading/solitary text -->
<text type="formattedtext">xxText</text>
<blocks>
<block_01>
<blocktype type="string">text</blocktype>
<text type="formattedtext"><p>xxText</p></text>
</block_01>
</blocks>
</page_01>
<page_02>
<name type="string">Second Page</name>
<!-- Optional leading/solitary text -->
<text type="formattedtext">xxText</text>
<blocks>
<block_01>
<blocktype type="string">text</blocktype>
<text type="formattedtext"><p>xxText</p></text>
</block_01>
</blocks>
</page_02>
</ADnDCoreRef>
</reference>

</root>

shikage
August 6th, 2017, 05:44
Celestian, good job on getting this working. I was wondering if you could include a couple screen shots of the interface windows for these lists?

celestian
August 6th, 2017, 05:54
Celestian, good job on getting this working. I was wondering if you could include a couple screen shots of the interface windows for these lists?

This what you're wanting?

https://i.imgur.com/7SuQFdK.png

Spell List is a LIST
Armor and Divine - Spells are the new group lists.

You'll note in the group lists the shortcuts are missing (bugged it in the thread for 3.3.2) and the alpha sorting is a bit off as well with grouping.

The example XML I posted doesn't include the groups I don't think but the stuff im working on is in github. It's just a ref manual for how to use my ruleset I've just begun as an excuse to play with these things.

https://github.com/CelestianGC/ADNDCoreRef/

Samarex
August 6th, 2017, 09:27
Are you sure that you are running the latest v3.3.2, and that there is not a CoreRPG folder in your rulesets folder?

There is no other documentation currently for those 2 classes, other than what I made in that post. (Or you can review the classes directly in the ruleset to see how they work.) The grouped list class is also the basis for the new Armor and Weapons buttons in the 3.5E and 5E campaign Items list.

Regards,
JPG

Thank you Moon.....I have been pulling my last few hairs out trying to figure out why Im not seeing any of these changes.....CoreRpg folder.....haha

Samarex
August 6th, 2017, 11:28
Ok Got a question. There is the Spells window that opens when you use the Spells button on the Sidebar. [I cant find this window anywhere in the ruleset for some reason].
But what I am wondering is the list of spells that populate this window. Whats the data source for it? Working with Cel on this and he has it pulling the list from a module. This works but trying to get this to read the list in the Sidebar Spells Window. Since this window has spells that are in all open modules, not just 1.

Samarex

Talyn
August 6th, 2017, 14:23
The Spells button is found on the Library window at the top. You can check the button to add/remove any button from your sidebar, or simply click it from that Library window to open it, as in the screenshot below. It's a CoreRPG feature, so as long as you're using a CoreRPG-layered ruleset it's available to you.

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=20061&stc=1&d=1502025534

The sidebar buttons use a "masterindex" class, which is why they can load every data source from every module.

I haven't played with the new reference_groupedlist class that @Celestian is using yet to answer anything else about it.

celestian
August 6th, 2017, 19:18
I want to point out that some of the stuff I'm doing in these examples is just proof of concept for me and has no purpose other than that. I am just feeling my way around this because I've not ever worked with the ref manuals.

In case there is some confusion as to why I am doing things like loading a module for a unrelated ref-book.

kelebros
January 2nd, 2018, 04:04
Sorry to Necro this topic, but this is the best information I've been able to find on how to use the reference_list class.
I'm trying to replicate how the D&D 5E SRD module presents the equipment lists.
Namely, The Equipment link from the library opens (what looks like) a reference_list window of links to all the equipment types (e.g. Armor, Weapons, etc) which are again links to equipment tables.

Any assistance, a point in the right direction, a link to examples (I've tried to find some without much luck) would be greatly appreciated.

Thanks for the above info, it is very enlightening. On a side note, is there any documentation for how these classes work, or is it just read the xml and lua?

Moon Wizard
January 2nd, 2018, 04:24
It’s just read the XML and Lua, and look for examples. I’m adding grouped list views in v3.3.4, which allows rulesets to specify commonly used list views. There will be examples in the 3.5E SRD and PF SRD modules with the update.

I’ll probably be looking to push to beta testing later this week.

Regards,
JPG