ThinkTank
December 28th, 2013, 02:46
Im having a problem identifying a lua script error. The script in question being charsheet_skill.
function onMenuSelection(selection, subselection)
if selection == 6 and subselection == 7 then
local node = getDatabaseNode();
if node then
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
node.delete();
else
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
close();
end
end
This section, in particular:
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
Is causing the error:
Script Error: [string "charsheet/scripts/charsheet_skill.lua"]:46: attempt to index local 'parentskillnum' (a nil value)
When attempting to delete a created skill list item from the list using the radial command.
Where should I be looking to fix this?
function onMenuSelection(selection, subselection)
if selection == 6 and subselection == 7 then
local node = getDatabaseNode();
if node then
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
node.delete();
else
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
close();
end
end
This section, in particular:
local parentskillnum=DB.findNode(parentskill.getValue()) .getChild("subskillnumber");
parentskillnum.setValue(parentskillnum.getValue()-1);
Is causing the error:
Script Error: [string "charsheet/scripts/charsheet_skill.lua"]:46: attempt to index local 'parentskillnum' (a nil value)
When attempting to delete a created skill list item from the list using the radial command.
Where should I be looking to fix this?