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

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
GlitchyVirus
Posts: 2
Joined: Mon Jan 06, 2020 6:18 pm

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

#1 Post 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!

nsrr
Sher'Tul
Posts: 1126
Joined: Mon Sep 21, 2015 8:45 pm
Location: Middle of Nowhere

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

#2 Post 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?

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

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

#3 Post 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.
"Blessed are the yeeks, for they shall inherit Arda..."

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

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

#4 Post 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.
My feedback meter decays into coding. Give me feedback and I make mods.

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

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

#5 Post 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.
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply