PDA

View Full Version : <groups> ?



Varsuuk
May 17th, 2016, 06:00
I figured, not sure what this "group" thing separated, so I quickly input more complex than one Background input file. Did one wth man, including several sharing first letters. Then tried multiple equipment items under different categories / #st entries. Then ... searched on forums for <groups>, seems to ignore the angle-brackets so... ;)

Any idea what, if anything, this separates/groups? What input I might use to cause more than one of these to be generated?

example snipped of output


<armortable>
<description type="string">Armor Table</description>
<groups>
<section000>
<description type="string">Light Armor</description>
<equipment>
<padded>

Trenloe
May 17th, 2016, 06:14
This all depends on the windowclass in which the data is being opened in. But, it usually means that there will be groups within that window.

For example, the reference_armortablelist windowsclass in the PFRPG ruleset is used to open the list.armor section of the PFRPG basic rules module. This groups tag has a number of child sections that the code in reference_armortablelist uses to split the data into groups:

14091

Varsuuk
May 17th, 2016, 19:44
That's how I assumed it worked.
When I created various combos as I mentioned in original post, I EXPECTED that there would be perhaps a group per Armor type or Adventuring vs Weapons etc.
The generated (by PAR5E) xml did not have more than one <groups> in any part of it.

This is for 5E. I finished the code to parse the PAR5E-based backgrounds.txt file and now am underway writing the code to emit XML. I am mainly reverse engineering the output that works and building the code in a way that might let me separate concerns and add some enhancements that would, if desired, be used if you have a small extension added to support it. Once I have the xml output, I will release a barely-of-any-use 0.0.1-b1 to have anyone interested, validate against their backgrounds while I continue testing.

After that, I will likely add the rest of the base functionality before I actually work on a UI that lets you select things. I may release initially with a config file you pass via command line since I am learning Java as I write as well as XML and Swing or whatever it is Im using in Java :) Fun stuff, I'm having a blast.


Here is the Armor table from my generated .mod file. As you can see, even though the db.xml never used more than one group, it displays them grouped because of it separates them according to section elements further down the chain (see xml snippet below)


<armortable>
<description type="string">Armor Table</description>
<groups>
<section000>
<description type="string">Light Armor</description>
<equipment>
<padded>
<link type="windowreference">
<class>reference_armor</class>
<recordname>reference.equipmentdata.padded@DevTest</recordname>
</link>
<name type="string">Padded</name>
<cost type="string">5 gp</cost>
<ac type="string">11</ac>
<dexbonus type="string">Yes</dexbonus>
<strength type="string">-</strength>
<stealth type="string">Disadvantage</stealth>
<weight type="number">8.0</weight>
</padded>
<leather>
<link type="windowreference">
<class>reference_armor</class>
<recordname>reference.equipmentdata.leather@DevTest</recordname>
</link>
<name type="string">Leather</name>
<cost type="string">10 gp</cost>
<ac type="string">11</ac>
<dexbonus type="string">Yes</dexbonus>
<strength type="string">-</strength>
<stealth type="string">-</stealth>
<weight type="number">10.0</weight>
</leather>
</equipment>
</section000>
<section001>
<description type="string">Heavy Armor</description>
<equipment>
<shardplate>
<link type="windowreference">
<class>reference_armor</class>
<recordname>reference.equipmentdata.shardplate@DevTest</recordname>
</link>
<name type="string">Shardplate</name>
<cost type="string">500 gp</cost>
<ac type="string">19</ac>
<dexbonus type="string">Yes</dexbonus>
<strength type="string">-</strength>
<stealth type="string">Disadvantage</stealth>
<weight type="number">10.0</weight>
</shardplate>
</equipment>
</section001>
</groups>
</armortable>


14094 ... ps: I just copied one of the lines into Heavy category and renamed it picking a name and put in spurious price - it's not meant to represent the item ;)

Varsuuk
May 17th, 2016, 19:50
For now, my app will just assume anywhere there is a <groups> in the PAR5E generated code, it will just put out the same - as a single parent - regardless of number of entries.

When/if ever fails to show correctly in FG Ill check it out. Of course, when I get to looking at the lua for when I add to my extension, I may find references to groups that explains it. Knowing the great Beast that is known as "Legacy", it may be an appendix left since earlier code used it as a separator and they didn't want to break it after they went a different way. Or not... :)

Trenloe
May 17th, 2016, 20:00
Sorry, I should have said the <groups> tag will have a number of child sections under it. This is standard for FG XML - a header tag and then a number of child entries that tie directly to the header tag. In this case it is <groups> having one or more child entries labeled <sectionXXX>. In purely database entries the children are usually <id-XXXXX>, auto generated to give a unique ID tag entry.

Varsuuk
May 17th, 2016, 22:34
AH - OK, that answers my question perfectly, thank you.
I just need to always output the <groups></groups> pair as a grouping header, not that there are multiple groups possible. I actually ran into this question mainly because my eyes read faster than my brain (and my eyes are SLOW so... there you go...) and kept thinking group not groupS. The plural naming should have made it clear it is a single tg with multiple groups underneath. If there where a <group> tag, I'd expect some parent above it like... well, I dunno... <groups>?

Sorry, I should have gotten that one :)

Varsuuk
May 24th, 2016, 04:49
Didn't want to start a new thread for this trivial question, so risking burying here ;)

What does the "libn{MODULE_NAME}" under the "library" tag represent.
I like to name my consts/variables meaningfully and I can't think of one except for m_libn (yuck) or m_libIndex (not sure it is even applicable), etc.

I got the generation working fine, just trying to get some knowledge laid upon me for Grokking in fullness.

Moon Wizard
May 27th, 2016, 06:47
That tag is just a unique tag designating that the entries for that module should be listed separately in the library. I have some future plans to remove the need for a unique tag there at some point.

Regards,
JPG

Varsuuk
May 30th, 2016, 09:18
thanks for the insight - been busy this weekend, just finally reading mail and got the alert for this thread :) Happy 3day Weekend to all the US'ers