Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 242 243 [244]

Author Topic: DFHack 50.14-r1.1  (Read 879746 times)

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r2.1
« Reply #3645 on: August 04, 2024, 02:51:31 am »

DFHack 50.13-r4 released!

Highlights: Table of contents in gui/journal, timestream bugfixes and improvements.

Get it from:

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.13-r4
« Reply #3646 on: August 09, 2024, 02:27:37 am »

Spoiler: "old-version" (click to show/hide)

Code: ("raidmove_v50point2.lua") [Select]
--for this to work you need the dfhack terminal open to bounce between 2 windows to align the mouse into position fullscreen is not advised.
function MobileFort()
--local MapCurx=df.global.gview.view.child.child.map_x
local MapCurx=df.global.gview.view.child.child.focus_ax
--local MapCury=df.global.gview.view.child.child.map_y
local MapCury=df.global.gview.view.child.child.focus_ay
--local Fortsite=df.global.plotinfo.site_id
local Fortsite2=df.global.plotinfo.main.fortress_site
Fortsite2.pos.x=MapCurx
Fortsite2.pos.y=MapCury
end

if df.global.gview.view.child.child==nil then
print("this script requires you to be in the raid menu to work")
else
MobileFort()
end
here is a version of the raid menu site move script for the idea of hopefully helping folks get folks attacking or visiting their site even if they are a bit remote, and possibly help folks who decided to embark near or on the ocean tiles.
edit: realize I could touch up the code a bit to cut down some redundancy.

edit 8/13/2024: ok so finish polishing up site-create a script that ask you to input numbers related to embark tiles ( the actual number being inserted to missions is 3 times bigger than the site embark number) and using the raid menu which is like 16 x bigger than the embark tiles to eye ball where your squad of soldiers will be going for settling a new site.
from my trials and error I learn the sites need to be 2+ world tiles away from the player site, and away from ocean tiles to form a site, if they are on a remote island depending on distance you can't send folks over to there... due to the set up the squad you made settlers are gone and will not show up in the holding as potential workers to recall back.
Code: ("site-create.lua") [Select]
--'site create' is a long running script that mess with the raid option similar to site explore and site reclaim this one lets the player throw citizens out into the wild and hope they make something.
--this script probably works best as an extreme exile script as you're not getting those citizens back when you use this.
-- probably best to set this up with captains if your coord settings landed the expedition into a ocean or end up too close to your fort which can happen if you have it set under 2 world tiles radius away from the player site
-- oh yeah this requires explore missions to kick off and you need to assign the squad before running the script as the game prevents you from assigning them post some how.
local dlg=require("gui.dialogs")

function migrate(C,C2)
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
if rm.data.goal_site_invasion.invasion_intent==5 then
local startx=rm.data.goal_site_invasion.source_abs_smm_x
local starty=rm.data.goal_site_invasion.source_abs_smm_y
local startid = df.global.plotinfo.main.fortress_site.id
rm.data.goal_create_new_site.source_abs_smm_x=startx
rm.data.goal_create_new_site.source_abs_smm_y=starty
rm.data.goal_create_new_site.desired_parent_stid=startid
rm.data.goal_create_new_site.flag[0]=false
rm.data.goal_create_new_site.flag[1]=true
rm.data.goal_create_new_site.flag[2]=false
rm.goal=14
rm.flag.site_realized_over_goal=true
rm.flag.done_for_dwarf_mode=true
rm.pos_x=startx+(C*3)
rm.pos_y=starty+(C2*3)

end
end
end
end
function fill(tbl,low,high,title)
  for v =low, high do
    table.insert (tbl,{title..v,nil,v,search_key =v})
  end
end

function bob()
local Ark={}
fill(Ark,-160,0,"west")
fill(Ark,0,160,"east")
local f=function(Name,C)
 bob2(C[3])
end
dlg.showListPrompt("Chart ","here a list of local numbers around -20= west to 20=east embark tiles on the x axis ",COLOR_WHITE,Ark,f,nil,nil,true)
end

function bob2(Ca)
local Ark2={}
fill(Ark2,-160,0,"north")
fill(Ark2,0,160,"south")
local f=function(Name,C)
 migrate(Ca,C[3])
end
dlg.showListPrompt("Chart part 2 ","here a list of local numbers around -20= north to 20=south embark tiles on the y axis ",COLOR_WHITE,Ark2,f,nil,nil,true)
end
bob()
Spoiler: "gif showcase" (click to show/hide)
« Last Edit: August 13, 2024, 12:40:41 am by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r4
« Reply #3647 on: August 20, 2024, 03:37:26 pm »

Hi all! We're running a poll on Reddit for upcoming gui/journal features. Please drop by to vote and leave a comment with other ideas you'd like to see implemented.

https://www.reddit.com/r/dwarffortress/s/gUIXMXP1oS
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.13-r4
« Reply #3648 on: August 31, 2024, 10:01:46 am »

Code: ("site-create2.lua") [Select]
--'site create' is a long running script that mess with the raid option similar to site explore and site reclaim this one lets the player throw citizens out into the wild and hope they make something.
--this script probably works best as an extreme exile script as you're not getting those citizens back when you use this.
-- probably best to set this up with captains if your coord settings landed the expedition into a ocean or end up too close to your fort which can happen if you have it set under 2 world tiles radius away from the player site
--this also has a world tile counter to see how many world tiles spaces away the coords are. best expand up to 3+ world tiles away and not in an ocean or deep in the mountain for this to work.
local dlg=require("gui.dialogs")

function migrate(C,C2)
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
if rm.data.goal_site_invasion.invasion_intent==5 then
local startx=rm.data.goal_site_invasion.source_abs_smm_x
local starty=rm.data.goal_site_invasion.source_abs_smm_y
local startid = df.global.plotinfo.main.fortress_site.id
rm.data.goal_create_new_site.source_abs_smm_x=startx
rm.data.goal_create_new_site.source_abs_smm_y=starty
rm.data.goal_create_new_site.desired_parent_stid=startid
rm.data.goal_create_new_site.flag[0]=false
rm.data.goal_create_new_site.flag[1]=true
rm.data.goal_create_new_site.flag[2]=false
rm.goal=14
rm.flag.site_realized_over_goal=true
rm.flag.done_for_dwarf_mode=true
rm.pos_x=startx+(C*3)
rm.pos_y=starty+(C2*3)

end
end
end
end
function fill(tbl,low,high,title)
  for v =low, high do
    table.insert (tbl,{title..v.." "..(v/16),nil,v,search_key =v})
  end
end

function bob()
local Ark={}
fill(Ark,-160,0,"west")
fill(Ark,0,160,"east")
local f=function(Name,C)
 bob2(C[3])
end
dlg.showListPrompt("Chart ","here a list of local numbers around -160= west to 160=east embark tiles on the x axis ",COLOR_WHITE,Ark,f,nil,nil,true)
end

function bob2(Ca)
local Ark2={}
fill(Ark2,-160,0,"north")
fill(Ark2,0,160,"south")
local f=function(Name,C)
 migrate(Ca,C[3])
end
dlg.showListPrompt("Chart part 2 ","here a list of local numbers around -160= north to 160=south embark tiles on the y axis ",COLOR_WHITE,Ark2,f,nil,nil,true)
end
bob()
so since last time I re-wrote the script to now show off how many spaces you are world tile wise so counting by 20 wouldn't lead to all those extra  4s adding up to a 16
still uses the explore mission to kick off the site creation switch so best have a world with some places to explore.

edit: it seems my old scripts for site-reclaim and site-explore are using outdated df structures and need to be swap out.
Code: ("site-reclaim.lua") [Select]
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
if rm.data.goal_site_invasion.invasion_intent==5 then
rm.data.goal_site_invasion.invasion_intent=2
end
end
end
Code: ("site-explore.lua") [Select]
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
rm.data.goal_site_invasion.invasion_intent=5
end
end
« Last Edit: September 14, 2024, 08:51:05 pm by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r5rc1
« Reply #3649 on: September 09, 2024, 01:28:37 am »

DFHack 50.13-r5rc1 beta is now available!

Highlights: Idle crafting, Room reservations, Ethics violation warnings.

Get it from:

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html

On Steam, this beta release is available on the DFHack beta channel (for DF 50.13), the adventure-beta channel (for DF 51.01-beta), and the 50.14testing channel (for DF 50.14-beta).
« Last Edit: September 16, 2024, 02:48:59 am by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r5
« Reply #3650 on: September 15, 2024, 10:05:35 pm »

DFHack 50.13-r5 is now available!

Highlights: Idle crafting, Room reservations, Ethics violation warnings, Matchmaking interface.

Get it from:

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html

On Steam, this release is available on the DFHack default None channel (for DF 50.13), the adventure-beta channel (for DF 51.01-beta), and the 50.14testing channel (for DF 50.14-beta).
« Last Edit: September 16, 2024, 02:48:32 am by myk »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.13-r5
« Reply #3651 on: September 21, 2024, 09:59:33 am »

Code: ('train-caged.lua') [Select]
local dlg=require("gui.dialogs")
--this script is an experiment on testing the training mechanic in the game, so far works with caged non citizens of the fort. there also moments where the trainer will have issues and forget to bring food to the cage
-- if this happens then you kinda have to convert the caged unit to something trainable using dfhack then go through the vanilla process of selecting a trainer
-- you could also just delete the training assignment with in df.global.plotinfo.equipment with gm-editor and the alt-d input but that one of the more riskier bits of this
-- oh and folks that petition to join the fort don't need to constant training, but those that fully revert might need to be shove back in the cage so get some really good cage trap setups.
-- or caging scripts
function trainerselect()
local Ark={}
local civcheck=df.global.plotinfo.civ_id
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
if v.civ_id==civcheck and 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..""..df.global.world.raws.creatures.all[v.race].name[0],nil,v.id})

end
end
table.insert (Ark,{"ANY",nil,"ANY"})

local f=function(Name,C)
cagedselect(C[3])
end

dlg.showListPrompt("trainer list","Select a unit for trainer role",COLOR_WHITE,Ark,f)
end
function cagedselect(e)
local Ark2={}
local civcheck=df.global.plotinfo.civ_id
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
if v.civ_id~=civcheck and v.flags1.caged and v.flags1.inactive==false then
table.insert (Ark2,{dfhack.TranslateName(v.name).." "..v.name.nickname ..df.global.world.raws.creatures.all[v.race].creature_id..""..df.global.world.raws.creatures.all[v.race].name[0],nil,v.id})
end
end
local f2=function(Name,C)
  shove(C[3],e)
end

dlg.showListPrompt("caged list","Select a caged unit for training",COLOR_WHITE,Ark2,f2)

end

function shove(af,aw)
local  train=df.global.plotinfo.equipment.training_assignments
if aw=="ANY" then
train:insert("#",{new=true,animal_id=af,trainer_id=-1})
train[#train-1].flags.any_trainer=true
else
train:insert("#",{new=true,animal_id=af,trainer_id=aw})
end
end
trainerselect()
Code: ('cage-wild.lua') [Select]
local dlg=require("gui.dialogs")
--script that selects all wild creatures from the active unit lists and shove them in the currently selected cage
-- warning this doesn't have a filter on visible units and will select ALL wild units on the site
-- so you might have to scrub pass some cavern critters if you don't want your citizens wrestling beings way too large and deadly
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 and v.flags1.caged==false and v.civ_id~=df.global.plotinfo.civ_id and v.civ_id==-1 then

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("#",v.id)
end
end

end
end
end
deitysummoning()

well here's two scripts I been working on  well one I been working on a bunch the other is just to make use of it when it works.
the train caged script can work at least anywhere, but the cage wild requires you to look at the 'building cage' before running it.
wrote this stuff when I notice the game was training one of my sapient citizens when I didn't have any indicator saying they were going to be trained or still be trained but they had one before transforming into a sapient creature.
do hope one day I could figure out how to get into the training menu prompt but until then this is an "alternative to just toggling the tame unit flag, or force petitioning the unit" script

edit: due to some structure changes train cage script needs a few adjustments


Code: ('train-caged2.lua') [Select]
local dlg=require("gui.dialogs")
--this script is an experiment on testing the training mechanic in the game, so far works with caged non citizens of the fort. there also moments where the trainer will have issues and forget to bring food to the cage
-- if this happens then you kinda have to convert the caged unit to something trainable using dfhack then go through the vanilla process of selecting a trainer
-- you could also just delete the training assignment with in df.global.plotinfo.equipment with gm-editor and the alt-d input but that one of the more riskier bits of this
-- oh and folks that petition to join the fort don't need to constant training, but those that fully revert might need to be shove back in the cage so get some really good cage trap setups.
-- or caging scripts
function trainerselect()
local Ark={}
local civcheck=df.global.plotinfo.civ_id
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
if v.civ_id==civcheck and 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..""..df.global.world.raws.creatures.all[v.race].name[0],nil,v.id})

end
end
table.insert (Ark,{"ANY",nil,"ANY"})

local f=function(Name,C)
cagedselect(C[3])
end

dlg.showListPrompt("trainer list","Select a unit for trainer role",COLOR_WHITE,Ark,f)
end
function cagedselect(e)
local Ark2={}
local civcheck=df.global.plotinfo.civ_id
for k,v in pairs(df.global.world.units.active) do
BoaName=dfhack.TranslateName(v.name)
if v.civ_id~=civcheck and v.flags1.caged and v.flags1.inactive==false then
table.insert (Ark2,{dfhack.TranslateName(v.name).." "..v.name.nickname ..df.global.world.raws.creatures.all[v.race].creature_id..""..df.global.world.raws.creatures.all[v.race].name[0],nil,v.id})
end
end
local f2=function(Name,C)
  shove(C[3],e)
end

dlg.showListPrompt("caged list","Select a caged unit for training",COLOR_WHITE,Ark2,f2)

end

function shove(af,aw)
local  train=df.global.plotinfo.training.training_assignments
if aw=="ANY" then
train:insert("#",{new=true,animal_id=af,trainer_id=-1})
train[#train-1].flags.any_trainer=true
else
train:insert("#",{new=true,animal_id=af,trainer_id=aw})
end
end
trainerselect()
still working on fixing a weird quirk that stops the workers from fetching food to the trainee in the cage.
« Last Edit: October 04, 2024, 11:06:12 am by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r5
« Reply #3652 on: September 25, 2024, 08:07:29 pm »

Steam Community Update 25 September 2024: "Bugfixes, Graphics for babies, crops and equipment ⛏ Dwarf Fortress Fortress Mode 50.14"

https://store.steampowered.com/news/app/975370/view/4657374909372690154

Full text:

Hey Urists,

<snip>

We also just released a video from programmer Putnam showing off a new feature we're working on, in which players will be able to use Lua in their mods to literally change the code to make custom behaviours and adapt the systems more expansively than ever. This also acts as the foundation for the upcoming procedural magic system which will be added to all modes. Watch the full video on Youtube: https://youtu.be/Z9rzhFwgfUk

See you in the next patch!

-Alexandra

What, if anything, does this mean for the future of DFHack?
Logged
Really hoping somebody puts this in their signature.

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r5
« Reply #3653 on: September 26, 2024, 08:38:32 pm »

DFHack 50.14-r1.1 is now available!

This is just a minimal compatibility update, plus a few bugfixes.

Get it from:

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html

On Steam, this release is available on the DFHack default None channel (for DF 50.14) and the adventure-beta channel (for DF 51.01-beta).
« Last Edit: September 27, 2024, 06:12:19 am by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r5
« Reply #3654 on: September 26, 2024, 08:41:05 pm »

a new feature we're working on, in which players will be able to use Lua

What, if anything, does this mean for the future of DFHack?

Some discussion here: https://github.com/DFHack/dfhack/discussions/4961
The short of it is that DF's use of Lua is currently focused on enabling programmatic creation of RAWs. There is no current overlap of DF's Lua usage and what you can do with DFHack. Maybe someday, but not any time soon.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.11-r2
« Reply #3655 on: October 09, 2024, 10:21:17 am »

-snip-

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.



Code: ("necrobook.lua") [Select]
--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.event.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.event.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.event.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.event.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.event.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.event.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.
so dfhack updated the structures and broke this script so here's an update to that for df50.14.
« Last Edit: October 11, 2024, 05:18:45 pm by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes
Pages: 1 ... 242 243 [244]