DICE PACKS BUNDLE
  1. #1

    Get Value from PC Skill List in CT

    Hi there,
    I didn‘t find any post directly explaining how to achieve this: I‘m working on a ruleset based on the 5E rules. On the PC sheet I have the 5E standard skill list. In the CT I want to add a control which needs to catch the skill ranks for a die roll.

    I understand how I can get an attribute value via crosslink and setLink, but I‘m wondering how to do this if I don‘t know the DB location beforehand (like I do for attributes).

    Any help or examples are highly welcome. :-)
    Last edited by Mephisto; January 27th, 2022 at 21:00.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Get the charsheet database entry for the PC record in the combat tracker. Then go to the skilllist node and iterate through each child checking the value of the child name field until you get to the skill you want to reference.

    Something like this:
    Code:
    for _,v in pairs(DB.getChildren(nodePCCharsheet, "skilllist")) do
    	if DB.getValue(v, "name", "") == sSkill then
    		-- Do your coding here - v is the skill node
    	end
    end
    Where nodePCCharsheet is the charsheet node for the PC and sSkill is the name of the skill you want to match. v will be a database node that points to skill child data, for example:

    Code:
    <name type="string">Perception</name>
    <prof type="number">1</prof>
    <stat type="string">wisdom</stat>
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    You know that you are awesome, don‘t you? :-).
    Last edited by Mephisto; November 10th, 2021 at 05:16.

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
  •  
5E Character Create Playlist

Log in

Log in