Page 1 of 1
"Overwriting" a birth descriptor
Posted: Tue Dec 11, 2012 11:53 pm
by bricks
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.
Re: "Overwriting" a birth descriptor
Posted: Wed Dec 12, 2012 2:52 am
by aardvark
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:
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)
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.
Re: "Overwriting" a birth descriptor
Posted: Wed Dec 12, 2012 3:15 am
by bricks
Thanks!