Starfinder Playlist
  1. #1

    Get General Node

    I am trying to call a generalized node. For example in my character sheet main XML file:

    Code:
    			<basicnumber name="skill_acrobatics_foc" source="skills.acrobatics.foc">				
    				<anchored to="skill_acrobatics_exp" position="right" offset="9,0" width="15" />				
    				<nodrag />
    				<nodrop />
    				<default>0</default>
    				<min>-5</min>
    				<max>5</max>
            		<tabtarget>
              			<next>skill_acrobatics_exp</next>
              			<prev>skill_melee_exp</prev>
            		</tabtarget>                                
    			</basicnumber>	
    			<basicnumber name="skill_acrobatics_tn" source="skills.acrobatics.tn">				
    				<anchored to="skill_acrobatics_foc" position="right" offset="9,0" width="20" />				
    				<nodrag />
    				<nodrop />
                    <noreset />
                    <nokeyedit />
                    <rollable/>
    				<script>
    					function onDoubleClick(x,y)
    						Library.taskcheck(dragInfo, window)
    					end
    				</script>
    			</basicnumber>
    In Library.taskcheck, so far I have:

    Code:
    function taskcheck(draginfo, winFrame)
        local nodeWin = winFrame.getDatabaseNode();
        local node = DB.findNode(".");
    	local rActor = ActorManager.getActor("pc", nodeWin);
    	local rolling20 = DB.getValue(node, "curdie.curr");
    	local sides = 20;
    	local TN = DB.getValue(node, "TN");
        local FC = ????
    I want to be able to set FC to the node of this specific skill (acrobatics.foc), but I want to be able to use this function for all the skills. (Acrobatics, melee, etc.). How do I call that node, based on where the function derives from?

    They are all setup the same skills.SKILL.foc. I tried setting up a source tag and in the lua file doing:

    Code:
    if source and source[1] then
         FC = "skills." .. source[1] .. ".foc";
    end
    But that get returned as nil.

    I threw a debug command into the if statement to see what it would generate, and it's not even running the if statement.
    Last edited by statik37; October 29th, 2019 at 15:57.
    Wesley Toma-Lee
    Lead Developer
    Nerd Eye Industries
    https://www.nerdeyeindustries.com

  2. #2
    I'm not sure exactly what you are doing, so I'm completely guessing as to what your code should look like. There's not much context. Perhaps something like this:

    Code:
    					function onDoubleClick(x,y)
    						Library.taskcheck(dragInfo, window, getValue())
    					end
    Code:
    function taskcheck(draginfo, winFrame, nSkillValue)
        local nodeWin = winFrame.getDatabaseNode();
        local rActor = ActorManager.getActor("pc", nodeWin);
        local rolling20 = DB.getValue("curdie.curr");
        local sides = 20;
        local TN = DB.getValue(node, "TN");
        local FC = nSkillValue;
        ...
    Regards,
    JPG

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
  •  
FG Spreadshirt Swag

Log in

Log in