Ok so I gave it a try and the lines at the top and bottom that mention tools make dfhack spit out errors and i got the file to not have errors but nothing happens.
This is the code:
function morul(unit)
utils = require 'utils'
if unit==nil then
unit=getCreatureAtPointer()
end
unit.name.first_name = "Morul"
unit.name.words[0] = 1416 --[T_WORD:CHANNEL:catten]
unit.name.words[1] = 1304 --[T_WORD:BEND:mat]
labor_rating = 15
military_rating = 70
skill = { 0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,54,55,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,95,96,97,98,99,100,101,102,103,104,105,109,110,111,112,113,114,115 }
military = { 38,39,41,42,43,44,45,46,54,99,100,101,102,103,104,105 }
for sk,sv in ipairs(skill) do
new_rating = labor_rating
for _,v in ipairs(military) do
if v == sv then
new_rating = military_rating
end
end
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = sv, rating = new_rating, experience = (new_rating * 500) + (new_rating * (new_rating - 1)) * 50}, 'id')
end
for sk,sv in ipairs(unit.status.current_soul.skills) do
printall(sv)
end
end
If I put the k cursor over the guy and then run that script file how you said to above then nothing happens. The game is paused when i do it but nothing happens. So what did i do wrong?