I had the need to keep a fort alive for a very long time recently, and only had a few dwarves to work with, and some were getting pretty old.
So, I rejuvenated them!
--rejuvenate.lua
--This script will make any dwarf ~20 years old
--by vjek, version 1, 20120617
--usage is: target a unit in DF, and execute this script in dfhack
--via ' lua /path/to/script '
--the target birthyear will be changed to the current year minus 20
--praise Armok!
function rejuvenate()
local current_year,newbirthyear
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting with extreme prejudice.")
return
end
current_year=df.global.cur_year
newbirthyear=current_year - 20
unit.relations.birth_year=newbirthyear
print (unit.name.first_name.." is now ~20 years old")
end
rejuvenate()
This script can be called by
targeting a dwarf in DF and simply:
rejuvenate , if the script is placed into \hack\scripts\
or if you choose, with ' lua \path\to\rejuvenate.lua '
Tested in 34.10, does not appear to cause any problems with my adult dwarves, after a year of in-game time has passed, and through several saves/loads.
WARNING: This script has NOT been tested on dwarven children.