Thread: Get General Node
-
October 29th, 2019, 15:50 #1
- Join Date
- Dec 2015
- Location
- Boston, MA
- Posts
- 167
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>
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 = ????
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
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.
-
October 30th, 2019, 05:40 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
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; ...
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks