Thanks. I am looking through your warlock mod now trying to understand this.
So, for example: would a mod that only contains one file in \hack\scripts\classes called learn-skill.lua with the following code work as a mod? (this is the code from your warlock mod)
-- classes/learn-skill.lua v0.8 | DFHack 43.05
local utils = require 'utils'
validArgs = utils.invert({
'help',
'unit',
'spell',
'override',
'verbose'
})
local args = utils.processArgs({...}, validArgs)
if args.unit and tonumber(args.unit) then
unit = df.unit.find(tonumber(args.unit))
else
print('No unit declared')
return
end
if args.spell then
spell = args.spell
else
print('No spell declared')
return
end
verbose = false
if args.verbose then verbose = true end
if args.override then
yes = true
else
yes = dfhack.script_environment('functions/class').checkRequirementsSpell(unit,spell,verbose)
end
if yes then
success = dfhack.script_environment('functions/class').changeSpell(unit,spell,'add',verbose)
if success then
-- Erase items used for reaction
end
else
if verbose then print('Unit does not meet the spell requirements') end
end
There doesn't appear to be anything added to the dfhack.init file that "turns this code on"?
multilevel 10
#s#eason-palette start
twbt unit_transparency 1
twbt workshop_transparency 1
twbt redraw_all 1
multilevel shadowcolor 0 0 0 0.6
multilevel fogcolor 0.1 0.1 0.17
multilevel fogdensity 0.30 0.25 0.75
#r#ealcolors
fix-sentient-butcher
startdwarf 7
points 1504
In other words, can a single .lua file be enough on it's own for dfhack to use without any changes to anything else including the dfhack.init file?