Page 1 of 1
learnTalent at Birth?
Posted: Sat Jan 11, 2020 2:42 am
by Pisastrish
How can I modify a class that already exists to gain a talent at birth without overloading the file? I'm looking to do this with a talent like teleport anglowen, so having it learn a category and automatically put points in it doesn't work.
Re: learnTalent at Birth?
Posted: Sat Jan 11, 2020 11:19 am
by HousePet
Short answer, if you know how to edit a class already:
getBirthDescriptor("subclass", "<replace with class name>").talents["<replace with talent id>"] = 1
Long answer, if you are using a separate file to store all the class changes in one neat package:
Start with the ToME:load hook.
In the ToME:load hook put:
local Birther = require "engine.Birther"
Birther:loadDefinition("path to birth editing file here")
Inside this birth editing file put:
getBirthDescriptor("subclass", "<replace with class name>").talents["<replace with talent id>"] = 1
If you just want to do nothing else, you can simplify it:
class:bindHook('ToME:load', function(self, data)
local Birther = require 'engine.Birther'
Birther:getBirthDescriptor("subclass", "<replace with class name>").talents["<replace with talent id>"] = 1
end)
Re: learnTalent at Birth?
Posted: Sat Jan 11, 2020 7:15 pm
by Pisastrish
Thank you!