Jump to content

Problem with creating skill tree for a modded character


Recommended Posts

Hello
While trying to make a skill tree for a modded character I ran some kind of error:
 

[string "scripts/widgets/redux/skilltreebuilder.lua"]:592: attempt to index local 'panel' (a nil value)

I thoroughly followed this skill tree guide by Lyraedan and checked other people's code to see if I missed something.
I'm also made sure to decompile and compile skill tree background while renaming all png to corresponding names, but it didn't work.

I haven't find any solution to that on the forums, most likely because it's a pretty recent addition to the game, and I also tried fixing it myself for couple of days, but now I have to ask for possible solutions straight away it seems.
I'd be pretty grateful if someone help me out with this.
I'm attaching skill tree related code from my modmain, crash log and skill tree file.

-- Skilltree
local SkillTreeDefs = require("prefabs/skilltree_defs")


local OldGetSkilltreeBG = GLOBAL.GetSkilltreeBG
function GLOBAL.GetSkilltreeBG(imagename, ...)
    if imagename == "whispy_background.tex" then
       return "images/skilltreeimages/whispy_skilltree.xml"
    else
        return OldGetSkilltreeBG(imagename, ...)
    end
end


--RegisterSkilltreeIconsAtlas("images/skilltreeimages/whispy_skilltree.xml", "whispy")

local CreateSkillTree = function()
	print("Creating a skilltree for whispy")
	local BuildSkillsData = require("prefabs/skilltree_whispy") -- Load in the skilltree

    if BuildSkillsData then
        local data = BuildSkillsData(SkillTreeDefs.FN)

        if data then
            SkillTreeDefs.CreateSkillTreeFor("whispy", data.SKILLS)
            SkillTreeDefs.SKILLTREE_ORDERS["whispy"] = data.ORDERS
	    print("Created whispy skilltree")
        end
    end
end
CreateSkillTree();


-- Skilltree end

 

client_log.txt skilltree_whispy.lua

Link to comment
Share on other sites

Hi there!

I'm the author of the tutorial. I'll be more then happy to assist you in fixing this issue.

Your mod main setup looks spot on, your skilltree file looks correct.

Looking at your client log, I would guess its your texture xml files. I know that sometimes those things don't compile properly and you have to fix it by opening it up the xml by hand

Luke_Skilltree_Example.zipTo make things a little easier for you, I'm attaching a functional early version of my character mod that has a working skill tree. Its not finished yet but its something you can compare against.

 

I'll also attach this example to the tutorial for anyone else should they run into issues

Edited by Lyraedan
  • Health 1
Link to comment
Share on other sites

1 hour ago, Lyraedan said:

Hi there!

I'm the author of the tutorial. I'll be more then happy to assist you in fixing this issue.

Your mod main setup looks spot on, your skilltree file looks correct.

Looking at your client log, I would guess its your texture xml files. I know that sometimes those things don't compile properly and you have to fix it by opening it up the xml by hand

Luke_Skilltree_Example.zipTo make things a little easier for you, I'm attaching a functional early version of my character mod that has a working skill tree. Its not finished yet but its something you can compare against.

 

I'll also attach this example to the tutorial for anyone else should they run into issues

Hello!
I checked luke_skilltree and it has identical code as I did in my file:

<?xml version="1.0" encoding="utf-8"?>
<Atlas>
	<Texture filename="whispy_skilltree.tex" />
	<Elements>
		<Element name="background.tex" u1="0.001" u2="0.40964453125" v2="0.999" v1="0.27834375" variant="" />
		<Element name="overlay_left.tex" u1="0.41164453125" u2="0.438453125" v2="0.999" v1="0.27834375" variant="" />
		<Element name="overlay_right.tex" u1="0.440453125" u2="0.4667734375" v2="0.999" v1="0.27834375" variant="" />
		<Element name="whispy_background.tex" u1="0.4687734375" u2="0.879859375" v2="0.999" v1="0.266625" variant="" />
	</Elements>
</Atlas>

I decompiled the file you attached and then compiled it back with luke_background png changed to whispy_background png as a placeholder

Also I'm so glad you willing to help resolve this problem!
 

here's both of my xml and tex if you need them

whispy_skilltree.xml whispy_skilltree.tex

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...