-
January 2nd, 2018, 21:58 #1
How to get <catagory .*> entries for children?
So I've been able to get the catagory of a child in a list using UtilityManager.getNodeCategory(node)
Code:local dStories = DB.getChildren("encounter"); for _,node in pairs(dStories) do local sCategory = UtilityManager.getNodeCategory(node) Debug.console("manager_author.lua","authorRefmanual-dStories","node",node); Debug.console("manager_author.lua","authorRefmanual-dStories","sCategory",sCategory); end
Code:<encounter> <category name="Cat-2" baseicon="0" decalicon="0"> <id-00001>
I can create my own version of this flipping through every node, checking it's category and then making a new list of nodes with just those specific entries. It would seem that it's kinda backwards though and I'm probably just missing some built in functionality? I also need to ensure I preserve the order that they are in THAT category.Last edited by celestian; January 2nd, 2018 at 22:01.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
January 2nd, 2018, 23:29 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,604
Yes, there is. There is a whole set of API calls that I must have forgot to document a while back, but I'll put them on my to do list. I don't have the time to document right now, but the output might be enough to get you what you need.
DB
getCategory (node/path)
setCategory (node/path, categoryname/categorytable)
getChildCategories (node/path)
updateChildCategory (node/path, categoryname/categorytable, usealltrees)
addChildCategory (node/path, categoryname/categorytable)
removeChildCategory (node/path, categoryname/categorytable)
getDefaultChildCategory (node/path)
setDefaultChildCategory (node/path, categoryname/categorytable)
databasenode
getCategory ()
setCategory (categoryname/categorytable)
getChildCategories ()
updateChildCategory (categoryname/categorytable, usealltrees)
addChildCategory (categoryname/categorytable)
removeChildCategory (categoryname/categorytable)
getDefaultChildCategory ()
setDefaultChildCategory (categoryname/categorytable)
Regards,
JPG
-
January 3rd, 2018, 00:45 #3
Thanks, I'll tinker with it and see what I can come up with. The above one "sounds" like what im looking for. I'll dig around for examples in the code and see if I can sort out how to use it.
For now I've created my own temporary node list by category name.
The reason I'm doing this is so I can take all the "Story" entries, by category and create a reference manual block from them. I'll use the Categories as the sub-chapters with each story record in that category as an entry. This allows the user to edit things in the story editor, using all the formatting tools and what not and then create a ref-manual from it so it looks the same what is does in the story list. I REALLY hate doing ref-manuals by hand
The next part of this will be to prompt much like you do for an export and let you include npc/spells/skills/whatever in the reference manual block.
My proof of concept has worked but there is still a lot to do for final rev... and it would be easier also if I could write/create the needed directory and files (client.xml, definitions.xml/etc) for this. Not sure that's possible yet but for now I simply copy/past the <library> and <reference> block to a client.xml and it works.
This was a sample. I just used some random generation tools to create some Story entries, stuck them in categories and performed the process I mentioned.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
January 3rd, 2018, 01:02 #4
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
This looks cool. Is it CoreRPG compatible?
-
January 3rd, 2018, 01:40 #5---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
January 3rd, 2018, 03:16 #6
Got a few more things added and decided to try and run it on the builder campaign for S4 and here is what it looked like. Not that I needed the adventure module as a ref manual but mostly to see how it would work. I'm going to fiddle with sorting and see how it'll work on all the story entries I imported for the 10 or so handbooks from Core Rules CD.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
January 3rd, 2018, 03:48 #7
-
January 3rd, 2018, 07:24 #8
This is pretty nice work.
Ultimate License. Running Hyperborea and CoC. Asks lots of questions. Mgpotter.com. PureVPN is a tested solution to run games when traveling. https://billing.purevpn.com/aff.php?aff=33044
-
January 3rd, 2018, 12:40 #9
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
We really need this celestian. I nominate you as a treasure to the community
-
January 4th, 2018, 00:58 #10
Sorted out some sorting issues (harhar) and looks pretty decent.
Doesn't look like I can create directories/files within FG (figured) to write these files but I'll keep poking at it. For now looks like it'll save it to a node in the db.xml and you have to copy/paste that node block into the client.xml for the ref-manual. Once I get a more final version (probably an extension for CoreRPG) I'll write a short instructional (maybe a vid).
Gonna spend sometime to try and figure out the options Moon posted and see if I can get it to work better than my work-a-round of building my own list based on category name.---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks