"Overwriting" a birth descriptor

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
bricks
Sher'Tul
Posts: 1262
Joined: Mon Jun 13, 2011 4:10 pm

"Overwriting" a birth descriptor

#1 Post 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.
Sorry about all the parentheses (sometimes I like to clarify things).

aardvark
Wyrmic
Posts: 200
Joined: Wed Aug 22, 2012 12:16 am

Re: "Overwriting" a birth descriptor

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

bricks
Sher'Tul
Posts: 1262
Joined: Mon Jun 13, 2011 4:10 pm

Re: "Overwriting" a birth descriptor

#3 Post by bricks »

Thanks!
Sorry about all the parentheses (sometimes I like to clarify things).

Post Reply