"Overwriting" a birth descriptor
Moderator: Moderator
"Overwriting" a birth descriptor
I was looking at one of Canderel's mods, it shows how to overwrite part of a talent. Is there a way to do this for a birth descriptor; for example, changing starting equipment or providing more talent trees? I'm guessing a similar approach would work, but there are enough missing pieces here that I'm not confident I could solve it with cowboy empiricism. If there is some sort of general formula here, I'd love to know; I could see this being useful for introducing small changes into zones, items, NPCs, etc.
Sorry about all the parentheses (sometimes I like to clarify things).
Re: "Overwriting" a birth descriptor
Yep! My 5 point Armour Training addon changes the Armour Training talent level in some birth descriptors. The relevant code is in the hooks/load.lua file. Basically:
Changes to stuff in anonymous resolvers are a little trickier, but you can see one way to do them in that same file. updateNPC() has the relevant code on lines 102-121.
Code: Select all
local class = require 'engine.class'
local Birther = require 'engine.Birther'
class:bindHook("ToME:load", function(self, data)
local birther = Birther:getBirthDescriptor("subclass", "Classname")
... changes to birther go here ...
end)
Re: "Overwriting" a birth descriptor
Thanks!
Sorry about all the parentheses (sometimes I like to clarify things).