PDA

View Full Version : Script Error



flekhabren
January 8th, 2018, 18:52
I'm at a loss and hope someone can give me insight. I've over looked something in my latest update to some code.

When I open a character from the character list, to the main page, the console pops up with this message 1 or 5 times depending on the character. "Script Error: [string "scripts/manager_era.lua"]:377: attempt to index a nil value"

Historically this has shown me errors in my code to fix but the issue is that my extension manager_era.lua only has 341 lines of code.

Additionally the error message pops up once when i switch to the skills tab of a character sheet. It will only happen once per instance of the campaign. I will not get the error again until I reload the campaign.

damned
January 8th, 2018, 21:31
From the full version of that file it is


function getSkills(bUncommon)
local era_skills = {};
--Debug.console("getSkills: ", currentEra);

local childNode = DB.findNode(currentEra);
--Debug.console("getSkills: ", childNode);
if childNode then
for k,v in pairs(DB.getChildren(childNode, "skilllist")) do
--Debug.console("getSkills: skill name ", k, v);
local sClass, sRecord = DB.getChild(v, "shortcut").getValue();
--Debug.console("getSkills: skill name ", sClass, sRecord);

--Debug.console("getSkills: skill name ", v, DB.getChild(sRecord, "isuncommon").getValue());
local rIsUncommon = DB.getChild(sRecord, "isuncommon");
--Debug.console("getSkills: skill isuncommon ", v, DB.getChild(sRecord, "isuncommon"));
if ((rIsUncommon == nil) or (rIsUncommon.getValue() == 0) or bUncommon ) then
--Debug.console("getSkills: skill ", v, DB.getChild(sRecord, "isuncommon").getValue());
--Debug.console("getSkills: skill name", sRecord, DB.getChild(sRecord, "name"));
--Debug.console("getSkills: skill name", sRecord, DB.getChild(sRecord, "name").getValue());
era_skills[DB.getChild(sRecord, "name").getValue()] = DB.findNode(sRecord);
end
end
end
--Debug.console("getSkills: era_skills ", era_skills);

return era_skills;
end

flekhabren
July 22nd, 2018, 04:52
I've had another recurrence of an error from this file. Line 328 same as before.

Unfortunately I cant recall what I did last time to resolve it. Though if its a different line that might be a non issue?