DICE PACKS BUNDLE
  1. #1

    Finding spells in modules different between FGC and FGU?

    My PF2CreatureParser extension uses the following function to find modules containing spells:

    Code:
    function InitSpellNodes()
    	addToParseLog("InitSpellNodes starting...");
    
    	-- Find any modules with spells available.
    	aSpellNodes = {};
    	for _,v in pairs(Module.getModules()) do
    		local aModule = Module.getModuleInfo(v);
    		addToParseLog("Checking " .. aModule.name);
    		if aModule.loaded and aModule.hasdata then
    			local nodeRoot = DB.getRoot(aModule.name);
    			local nodeSpells = DB.findNode("reference.spells@" .. aModule.name);
    			if nodeSpells then
    				addToParseLog("Loaded spells from " .. aModule.name);
    				table.insert(aSpellNodes, nodeSpells);
    			end
    		end
    	end
    
    	addToParseLog("InitSpellNodes complete.");
    end
    When I have the PF2 Core Rulebook module loaded this code works correctly in FGC (i.e. it outputs the 'Loaded spells...' message to the parselog), but not in FGU. Is this a known issue? Is there a more compatible way of doing what I'm trying to do?

  2. #2
    The hasdata and hastokens has been deprecated in FGU; since they are not needed. If you remove the aModule.hasdata check; then it should still work in both.

    Regards,
    JPG

  3. #3
    Roger that, thanks.

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
  •  
Starfinder Playlist

Log in

Log in