Page 1 of 1

How do you give a class access to a talent category?

Posted: Mon Jan 06, 2020 6:21 pm
by GlitchyVirus
I'm trying to give Shadowblades access to the Poison tree, but even though it seems like I've done everything right, it's still not showing up. Am I missing something here?

The code I have is:
local Particles = require "engine.Particles"

getBirthDescriptor("subclass", "Shadowblade").talents_types["cunning/poisons"]={false, 0.3}
-This is located in \data\birth\classes\rogue.lua of my add-on
-data is set to true in the init.lua
-If it matters, I've been able to make changes to prodigies successfully with no problems

I appreciate any help that can be offered. Thank you!

Re: How do you give a class access to a talent category?

Posted: Tue Jan 07, 2020 5:33 pm
by nsrr
Poisons are one of the few talent types that goes in a special field because it's an Unlockable, iirc. If we look at the Rogue subclass we see:

Code: Select all

unlockable_talents_types = {
		["cunning/poisons"]={true, 0.3, "rogue_poisons"},
	},
Try something like that?

Re: How do you give a class access to a talent category?

Posted: Tue Jan 07, 2020 10:00 pm
by Zizzo
GlitchyVirus wrote:-This is located in \data\birth\classes\rogue.lua of my add-on
-data is set to true in the init.lua
That… seems wrong. data/ in my experience is supposed to be used for stuff like definitions of new talents and birth descriptors. I think the engine supports "superloading" a talent definition file by putting it in the right subdirectory under superload/data/talents/ (AFAICT, basically it loads your definition file after the module's definition file in the same context, so that you can modify previous definitions in place), which seems like what you're trying for here, but I don't know if that works the same way for birth descriptor definition files.

Myself, I've always done that sort of thing via hooks. See for instance my Mindstar Mindslayer addon, which adds Mindstar Mastery to Mindslayers (hence the name). So you'd have something in hooks/load.lua like:

Code: Select all

class:bindHook('ToME:load', function(self, data)
  local Birther = require 'engine.Birther'
  local desc = Birther:getBirthDescriptor('subclass', 'Shadowblade')
  desc.talents_types["cunning/poisons"] = { false, 0.3 }
end)
possibly modified as per nsrr's note above.

Re: How do you give a class access to a talent category?

Posted: Tue Jan 07, 2020 11:52 pm
by HousePet
You can put it in data. I do.

What is likely missing is the load hook telling it to use the code in that file.

An example of mine:

local Birther = require "engine.Birther"
class:bindHook("ToME:load", function(self, data)
Birther:loadDefinition("/data-arcanum/birth/classes/mage.lua")
end)

This would be in the hooks\load.lua file.

Re: How do you give a class access to a talent category?

Posted: Thu Jan 09, 2020 2:25 am
by Zizzo
HousePet wrote:local Birther = require "engine.Birther"
class:bindHook("ToME:load", function(self, data)
Birther:loadDefinition("/data-arcanum/birth/classes/mage.lua")
end)

This would be in the hooks\load.lua file.
Oh, sure, that works too. I just assumed that the OP would have mentioned that if that was the route they were going.