learnTalent at Birth?
Moderator: Moderator
-
- Thalore
- Posts: 157
- Joined: Wed Sep 28, 2016 8:07 pm
learnTalent at Birth?
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?
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)
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)
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Thalore
- Posts: 157
- Joined: Wed Sep 28, 2016 8:07 pm
Re: learnTalent at Birth?
Thank you!