5E Product Walkthrough Playlist
Page 1 of 3 123 Last
  1. #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
    db.xml has the entries like this snippet.

    Code:
    	<encounter>
    		<category name="Cat-2" baseicon="0" decalicon="0">
    			<id-00001>
    However, what I'd like to have is a list of categories instead of a list of the nodes and having to ask each node what category it is. How can you get a list of categories from <encounter> node? Or can you?

    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.

  2. #2
    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

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    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
    getChildCategories (node/path)
    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.

  4. #4

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    This looks cool. Is it CoreRPG compatible?

  5. #5
    Quote Originally Posted by Bidmaron View Post
    This looks cool. Is it CoreRPG compatible?
    Right now it's just AD&D Core but I don't see why I couldn't create a extension for it for CoreRPG when I'm done. I tend to do my initial work there
    ---
    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.

  6. #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.

  7. #7

  8. #8
    Myrdin Potter's Avatar
    Join Date
    Oct 2015
    Location
    East Bay, SF
    Posts
    1,978
    Blog Entries
    4
    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

  9. #9

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    We really need this celestian. I nominate you as a treasure to the community

  10. #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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in