STAR TREK 2d20

Thread: Script Error

  1. #1

    Script Error

    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.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    From the full version of that file it is

    Code:
    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

  3. #3
    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?

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
  •  
DICE PACKS BUNDLE

Log in

Log in