Anyway to Make Changes to Talent Types besides Overloading?

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
deus-misereatur
Yeek
Posts: 10
Joined: Fri Jul 09, 2021 2:25 am

Anyway to Make Changes to Talent Types besides Overloading?

#1 Post by deus-misereatur »

Hi everyone again!

I've been looking to makes some changes to the talent type file (e.g., data/talents/spells/spells.lua) and can't seem to find any way to enforce said changes aside from forcing an overload. Is this the only way to do so?

The change I am looking to make is to enforce consistency with regards to the minimum required level to learn a new talent type category. For example, spell/stone has a min_lev = 10 while spell/deeprock does not, even though both talent types have talents that can only be learnt at level 10. I am aware that this is entirely a superficial change, but the OCD in me is simply crying.

Thanks in advance!

Shad3
Higher
Posts: 55
Joined: Thu Jan 13, 2022 3:45 am

Re: Anyway to Make Changes to Talent Types besides Overloading?

#2 Post by Shad3 »

The way you do it is by accessing its talents_types_def table entry in ActorTalents.
For example,

Code: Select all

local tt = Talents.talents_types_def["spell/earth"]
gets the spell/earth talent type table.
Then you can add tt.min_lev = 100 or whatever you need to do.
It's typically run as part of your talent definitions.
Do note that some talent type attributes may not behave as you might expect it to. For example, removing spell/earth is_spell (setting it to nil) won't make the talents that are already loaded not a spell, because it gets set at talent creation. You'll need to make nil each talent's is_spell instead (talents_def is the table for all talent definiitions).

edit: an example

Code: Select all

-- some surgery to Heavy Armor talent description
local heavy = Talents.talents_def["T_ARMOUR_TRAINING"]
if heavy then
	local info = heavy.info
	heavy.info = function(self, t)
		local classrestriction = ""
		if self.descriptor and self.descriptor.subclass == "Weaver" then
			classrestriction = classrestriction.."\n(Note that weavers will be unable to perform many of their talents in massive armour.)"
		end
		return info(self, t)..classrestriction
	end
end

deus-misereatur
Yeek
Posts: 10
Joined: Fri Jul 09, 2021 2:25 am

Re: Anyway to Make Changes to Talent Types besides Overloading?

#3 Post by deus-misereatur »

It's working! Thanks again! Really, your help is very, very much appreciated!

Post Reply