ok so it seems like I forgot to dump
this cage unit script... though I guess it seem to have a weird quirk with non-historical figures where it just also selects an artifact slab.
so it's mostly stable-ish but probably save before using it.
local dlg=require("gui.dialogs")
--script that selects a unit from the active unit list and shove them in the currently selected cage
--for nameless units probably nickname them to make it easier to pick them out of the list
--might crash and or try to shove an artifact item in the list if you mess with non-historical figure units
function deitysummoning()
local Ark={}
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
table.insert (Ark,{dfhack.TranslateName(v.name).." "..v.name.nickname,nil,v})
--end
end
local f=function(Name,C)
shove(C[3])
end
dlg.showListPrompt("unit list","Select a unit for shoving into a cage",COLOR_WHITE,Ark,f)
end
function shove(unit)
df.global.game.main_interface.unit_selector.unid:insert("#",unit.id)
end
deitysummoning()
local dlg=require("gui.dialogs")
--script that selects a unit from the active unit list and shove them in the currently selected cage
--for nameless units probably nickname them to make it easier to pick them out of the list
--might crash and or try to shove an artifact item in the list if you mess with non-historical figure units
function deitysummoning()
local Ark={}
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
if v.flags1.inactive==false then
table.insert (Ark,{dfhack.TranslateName(v.name).." "..v.name.nickname ..df.global.world.raws.creatures.all[v.race].creature_id,nil,v})
end
end
local f=function(Name,C)
shove(C[3])
end
dlg.showListPrompt("unit list","Select a unit for shoving into a cage",COLOR_WHITE,Ark,f)
end
function shove(unit)
for ko,vo in pairs(df.global.world.buildings.other.IN_PLAY) do
if vo.id==df.global.game.main_interface.view_sheets.viewing_bldid then
vo.assigned_units:insert("#",unit.id)
end
end
end
deitysummoning()
so for folks who want to cage trap any visitors that shows up and or wildlife with out needing to go through the cage trap set up.
edit: crud uhh I need more space for this next post
so uhh finish working on a necromancy in fort mode script and a bunch of gui side scripts that mess with that.

--this is a gui warmist spellbook modification to house a bunch of Curse tomb modification scripts/rumpack/DisTomb
-- there one spell the create tomb cursor one that you want to do first or the other spell scripts wouldn't work
-- the other spells are used for editing the curse tomb you selected if you make more uhh hope you remember which triggering point is which.
local dlg=require("gui.dialogs")
function getItemAtPos(x,y,z) -- gets the item index @ x,y,z coord
--local x,y,z=getxyz() --get 'X' coords
local vector=df.global.world.items.all -- load all items
for i = 0, #vector-1 do -- look into all items offsets
local curpos=vector[i].pos --get its coordinates
local cx=curpos.x
local cy=curpos.y
local cz=curpos.z
if cx==x and cy==y and cz==z and df.item_corpsest:is_instance(vector[i]) or cx==x and cy==y and cz==z and df.item_corpsepiecest:is_instance(vector[i]) then --compare them
return vector[i] --return index
end
end
--print("item not found!")
return nil
end
function Tomb2()
local Ark2={}
for k,v in pairs(df.global.world.cursed_tombs) do
--BoaName=dfhack.TranslateName(v.name)
table.insert (Ark2,{k.." "..k,nil,v})
--end
end
local f=function(Name,C)
Tombmaker5(C[3])
end
dlg.showListPrompt("Tomb list","Select a tomb to start the next part",COLOR_WHITE,Ark2,f)
end
function Tomb3()
local Ark2={}
for k,v in pairs(df.global.world.cursed_tombs) do
--BoaName=dfhack.TranslateName(v.name)
table.insert (Ark2,{k.." "..k,nil,v})
--end
end
local f=function(Name,C)
Tombmaker2(C[3])
end
dlg.showListPrompt("Tomb list","Select a tomb to start the next part",COLOR_WHITE,Ark2,f)
end
function Tomb3a()
local Ark2={}
for k,v in pairs(df.global.world.cursed_tombs) do
--BoaName=dfhack.TranslateName(v.name)
table.insert (Ark2,{k.." "..k,nil,v})
--end
end
local f=function(Name,C)
CorpsePoint(C[3])
end
dlg.showListPrompt("Tomb list","Select a tomb to start the next part",COLOR_WHITE,Ark2,f)
end
function Tomb4()
local Ark2={}
for k,v in pairs(df.global.world.cursed_tombs) do
--BoaName=dfhack.TranslateName(v.name)
table.insert (Ark2,{k.." "..k,nil,v})
--end
end
local f=function(Name,C)
Tombfinder(C[3])
end
dlg.showListPrompt("Tomb list","Select a tomb to start the next part",COLOR_WHITE,Ark2,f)
end
function Tomb5()
local Ark2={}
for k,v in pairs(df.global.world.cursed_tombs) do
--BoaName=dfhack.TranslateName(v.name)
table.insert (Ark2,{k.." "..k,nil,v})
--end
end
local f=function(Name,C)
Tombmove(C[3])
end
dlg.showListPrompt("Tomb list","Select a tomb to start the next part",COLOR_WHITE,Ark2,f)
end
function Tombmaker2(e)
local Ark2={}
for k,v in pairs(df.global.world.items.other.IN_PLAY) do
if df.item_corpsest:is_instance(v) or df.item_corpsepiecest:is_instance(v) then -- checked_item.flags.in_building then
--if v.unit_id=nil then else
--if v.hist_figure_id=nil then end
for k2,v2 in pairs(df.global.world.units.active) do
if v.unit_id==v2.id and v2.flags1.inactive==true then
BoaName=dfhack.TranslateName(v2.name)
table.insert (Ark2,{dfhack.TranslateName(v2.name).." "..v2.name.nickname,nil,v.id})
end
end
end
end
local f=function(Name,corpse)
e.coffin_skeletons:insert("#",corpse[3])
end
dlg.showListPrompt("Corpse list","Select a body to add to the cursed tomb",COLOR_WHITE,Ark2,f)
end
function Tombfinder(e)
e.triggered=false
end
function Tombmaker5(e)
local Ark2={}
for k1,v1 in pairs(df.global.world.raws.interactions) do
for k,v in pairs(v1.effects) do
--if df.interaction_effect_animatest:is_instance(v.effects) or df.interaction_effect_resurrectst:is_instance(v.effects) then -- checked_item.flags.in_building then
if df.interaction_effect_animatest:is_instance(v) or df.interaction_effect_resurrectst:is_instance(v) then -- checked_item.flags.in_building then
table.insert (Ark2,{v1.name.." "..v1.id,nil,v1.id})
end
end
end
local f=function(Name,C)
e.disturbance=C[3]
end
dlg.showListPrompt("spell list","Select a interaction for shoving into a tomb",COLOR_WHITE,Ark2,f)
end
function Tombmove(e)
e.coffin_pos.x=df.global.cursor.x
e.coffin_pos.y=df.global.cursor.y
e.coffin_pos.z=df.global.cursor.z
local v1=df.global.cursor.x-1
local v2=df.global.cursor.y-1
local v3=df.global.cursor.x+1
local v4=df.global.cursor.y+1
local v5=df.global.cursor.z
e.trigger_regions[0].x_min=v1
e.trigger_regions[0].y_min=v2
e.trigger_regions[0].z_min=v5
e.trigger_regions[0].x_max=v3
e.trigger_regions[0].y_max=v4
e.trigger_regions[0].z_max=v5
end
function SpellSeal()
function Tombmaker(v1,v2,v3,v4,v5,corpse,necro)
Mum=df.global.world.cursed_tombs
Mum:insert("#",{new=true,triggered=false,disturbance=necro,site_id=df.global.plotinfo.site_id})
local clu2=Mum[#Mum-1]
if necro==nil then
necro=Tombmaker6(clu2)
end
clu2.coffin_pos.x=df.global.cursor.x
clu2.coffin_pos.y=df.global.cursor.y
clu2.coffin_pos.z=df.global.cursor.z
clu2.trigger_regions:insert("#",{new=true,
x_min=v1,
y_min=v2,
z_min=v5,
x_max=v3,
y_max=v4,
z_max=v5})
end
function Tombmaker6(e)
local Ark2={}
for k,v in pairs(df.global.world.raws.interactions) do
if df.interaction_effect_animatest:is_instance(v.effects) or df.interaction_effect_resurrectst:is_instance(v.effects) then -- checked_item.flags.in_building then
table.insert (Ark2,{v.name.." "..v.id,nil,v.id})
end
end
local f=function(Name,C)
e.disturbance=C[3]
end
dlg.showListPrompt("spell list","Select a spell for shoving into a tomb",COLOR_WHITE,Ark2,f)
end
Tombmaker(df.global.cursor.x-1,df.global.cursor.y-1,df.global.cursor.x+1,df.global.cursor.y+1,df.global.cursor.z,nil,12)
--dofile("hack/scripts/rumpack/DisTomb.lua")
end
function CorpsePoint(e)
corpse=getItemAtPos(pos2xyz(df.global.cursor))
e.coffin_skeletons:insert("#",corpse.id)
end
function doNothing()
print("doing nothing real good but here have a message")
end
listofspells={
{text="nothing", spell=doNothing,icon='*'},
{text="Necro:Alter Spell", spell=Tomb2,key="CUSTOM_V"},
{text="Necro:Add Corpses", spell=Tomb3,key="CUSTOM_M"},
{text="Necro:Add Corpses-cursor", spell=Tomb3a,key="CUSTOM_X"},
{text="Necro:Reset Curse", spell=Tomb4,key="CUSTOM_T"},
{text="Necro:Move Tomb-cursor", spell=Tomb5,key="CUSTOM_O"},
{text="Necro:CreateTomb-cursor", spell=SpellSeal,key="CUSTOM_N"},
}
dlg.showListPrompt("Directions","Choze order",nil, listofspells,function(index,choice) choice.spell() end)
ok so the list of working spell commands
'alter spell' is the script that lets you choose an interaction to be slotted in the 'disturbance' section of the curse tomb which takes in from what I tested resurrection and animation focus spells the script filters the others out for just those with those effects
'add corpses' and 'add corpses-cursor' will slot in a corpse and corpse piece into the cursed tomb data the cursor one lets you just use the in game keyboard cursor to select a corpse item.
the 'reset curse' will toggle the 'trigger' flag state to false. priming the cursed tomb to animate/resurrect(these are two different interactions) the corpses you added when someone step in the trigger zone
'move tomb-cursor' is to move the triggering zone good for re-aligning a spot to a place with more units wandering about to prox the spell and 'create tomb-cursor' is the command that creates a cursed-tomb though it's filled with mostly dummy data with idea of the player setting it up with the other spell commands also there the whole site id stuff which is align to the player's fort site... also the structure data I found isn't needed for the script but it probably goes to the civ zone building for the tomb.
overall was rough set of days getting this to work and figuring out if it work.
so now you can revive your dead dwarves if they didn't get mangled and turn them into revenants/intel undead and or mummies.
this probably goes well with mods that dip into resurrection and animation interactions.
so stability warning uhh you are messing with necromancy and making someone a necromancer in form of a mummy if you mess with this ... or a revenant. expect old grudges to spring up and folks getting murdered in droves.

edit 2024: updated the images
edit 2024 april/3: updated for df50.12 changes with the unit selector that broke the script.