Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Rumrusher

Pages: [1] 2 3 ... 411
1
Utilities and 3rd Party Applications / Re: DFHack 50.11-r6
« on: March 25, 2024, 08:54:26 am »
ok so it seems like I wrote an open-legends script that actually opens legends and a open fort mode script that kinda opens fort mode afterwards.
but like
Code: ("open-leg.lua") [Select]
local old_screen=dfhack.gui.getCurViewscreen()
local new_screen=df.viewscreen_legendsst:new()
old_screen.child=new_screen
new_screen.parent=old_screen
new_screen.page:insert("#",{new=true,header="Open Legends",mode=0,index=-1,scroll_position_list=0,scrolling_list=false,
scroll_position_text=0,
scrolling_text=false
})
Code: ("open-fortmode.lua") [Select]
df.global.gamemode=df.game_mode.DWARF
df.global.gametype=df.game_type.DWARF_MAIN
local old_screen=dfhack.gui.getCurViewscreen()
--local new_screen=df.viewscreen_choose_game_typest:new()
local new_screen=df.viewscreen_dwarfmodest:new()
old_screen.child=new_screen
new_screen.parent=old_screen

like you run the first script to open legends, and run the second script to go back to fort mode.
but given the the original open legends had warnings about save corruption that also applies with using these scripts

2
Utilities and 3rd Party Applications / Re: DFHack 50.11-r6
« on: March 14, 2024, 08:11:24 pm »
Code: ("cook-served-tavern.lua") [Select]
--this script is a rough concept of seeing if one could serve food to others
-- this script will search for prepared meals and slam them into a cup a tavern keeper is holding
-- which kinda requires monitoring the tavern keeper to see if they are holding a cup to use this script.
-- for the person who wants a resturant feel to the fort or got goblins and want to see them eat stuff.
--potentially unstable and may leave uncleared general refs in cups which makes them look like they are full.

local crab=df.global.plotinfo.main.fortress_site
local lobster=df.global.world.activities.all
local shrimp=df.global.world.items.other.FOOD
  local items={}
  for _,checked_item in pairs(df.global.world.items.other.IN_PLAY) do
    if df.item_foodst:is_instance(checked_item) and not df.general_ref_activity_eventst:is_instance(checked_item.general_refs) then
      table.insert(items,checked_item)
    end
  end

for _3,craft in pairs(lobster) do
if craft.type==10 then
for _4,act in pairs(craft.events) do
act.unk_v42_1:insert("#",{new=true, item_id=items[dfhack.random.new():random(#items)].id ,unk_1=1, unk_2=0} )

local u_ref=df.general_ref_activity_eventst:new()
u_ref.activity_id=craft.id
u_ref.event_id=act.event_id

local u_store=df.general_ref_contains_itemst:new() -- the cup
local u_contain=df.general_ref_contained_in_itemst:new() -- the stuff in the cop
u_store.item_id=items[dfhack.random.new():random(#items)].id
u_contain.item_id=act.unk_v42_1[0].item_id
local salmon2=df.global.world.items.other.IN_PLAY

for _dc,serve3b in pairs(salmon2) do
if serve3b.id==act.unk_v42_1[0].item_id then
local tuna3=serve3b.general_refs
tuna3:insert(#tuna3,u_store)
end
end

local salmon=act.unk_v42_1[0].item_id

for _5,serve in pairs(items,act.unk_v42_1) do
for _6,serve2 in pairs(act.unk_v42_1) do
 if serve.id==serve2.item_id then
 serve.general_refs:insert(#serve.general_refs,u_ref)
serve.general_refs:insert(#serve.general_refs,u_contain)
end
end
end
end
end
end
ok so here's a script that started off on a normal idea of can I control what tavern serve to folks?
which spiral into a series of hard coded responses to stuff where I just give up and just default to just shoving the food into the cup the tavern keeper is serving and wash my hands of this concept.

so now it's possible to watch a 40 stack prepared meal's value go down due to someone drinking it all away.


3
DF Announcements / Re: Dwarf Fortress 50.12 Released
« on: March 07, 2024, 12:32:27 am »
that patch for vampires hiding properly is pretty funny given that's mostly a premium sided bug, the classic side didn't have that pigment issue with vampires.
though I do ponder what this patch do to make vampires more hidden for the classical port of this game?

4
Utilities and 3rd Party Applications / Re: DFHack 50.11-r6
« on: February 12, 2024, 07:31:36 am »
Spoiler: "gif showcase" (click to show/hide)
Code: ("tradebook.lua") [Select]
--book made for messing with trading warning might mess things up down the road with the save... this script uses warmist spellbook gui script as a basic layout
local dlg=require("gui.dialogs")
function traderlocate()-- seeks traders
for k,v in pairs (df.global.world.units.active) do
if v.flags1.merchant==true then
return v
end
end
end
function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end
function getItemAtKPos(x,y,z) -- gets the item index @ x,y,z coord
local vector=df.global.world.item.all -- load all items
local kickpos=df.global.world.units.active[0].pos
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==kickpos.x and cy==kickpos.y and cz==kickpos.z then --compare them
return vector[i] --return index
end
end
return nil
end
function getCreatureAtPos(x,y,z) -- gets the creature index @ x,y,z coord
local vector=df.global.world.units.all -- load all creatures
for i = 0, #vector-1 do -- look into all creatures 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 then --compare them
return vector[i] --return index
end
end
return nil
end
function getItemAtPos(x,y,z) -- gets the item index @ x,y,z coord
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 then --compare them
return vector[i] --return index
end
end
return nil
end
function Mount (rider,horse)--swiped the old dragging script for this
rider.relationship_ids.Draggee=horse.id
horse.relationship_ids.Dragger=rider.id
return
end
function traderpack()
unit_1 = traderlocate()
if unit_1 == nil then
print ("You must make a merchant. Use merch-add first.")
return
end
unit_2 = getCreatureAtPos(getxyz())
if unit_2 == nil then
print ("You must place the cursor over the second target.")
return
end
dfhack.with_suspend(Mount, unit_1, unit_2)
end
function merchadd()
 local unit=getCreatureAtPos(getxyz())
unit.flags1.merchant=true
end
function merchminus()
 local unit=getCreatureAtPos(getxyz())
unit.flag.merchant=false
end
function traderadd()--you run this in the trade menu
local Trado=df.global.game.main_interface.trade
for k,v in pairs (df.global.world.units.active) do
if v.flags1.merchant==true then
Trado.merchant_trader=v
Trado.civ=df.global.world.entities.all[v.civ_id]
Trado.havetalker=1
end
end
end
function caravan()
for k,v in pairs (df.global.world.units.active) do
if v.flags1.merchant==true then
Vcivid=v.civ_id
caravan2(Vcivid)
end
end
end
function Caravanfinish()
 df.global.plotinfo.caravans[0].time_remaining=100
end
function caravan2(Vcivid)
local Carav=df.caravan_state:new()
 df.global.plotinfo.caravans:insert("#",{new=true, total_capacity=10000, trade_state = 1, time_remaining= 4000, mood=100, entity=Vcivid})
end
local options = {}
local argparse = require('argparse')
local commands = argparse.processArgsGetopt({...}, {
    {'d', 'dead', handler=function() options.dead = true end}
})
listofspells={
{text="trade:merch-add", spell=merchadd,key="CUSTOM_T"},
{text="trade:merch-minus", spell=merchminus,key="CUSTOM_R"},
{text="trade:packholder-add", spell=traderpack,icon='*'},
{text="trade:caravan-add", spell=caravan,icon='*'},
{text="trade:caravan-finish", spell=Caravanfinish,icon='*'},
{text="trade:menu-swap", spell=traderadd,icon='*'},
}
dlg.showListPrompt("Spelz","Choze spel",nil, listofspells,function(index,choice) choice.spell() end)

ok so I normally would have an example gif showcasing what you can do here but uhhh shrugs. example gifs updated for now.

these series of commands allows one to assign a unit as a merchant, assign someone to be dragged by the merchant, add an caravan entry which lets one set up trade, and if you have issues getting access to the trade menu allows one to toggle into trading, oh and also speed up the trade session so the merchant can just leave.

beware this set of scripts can lead to 'merchant wandering off to do something else, losing out the means to gift items to the trader because they are part of the came civ, lose lifestock and folks because they were dragged away off site, trying to figure out a new playstyle that uses this and having FUN doing so, not working well when actual caravan shows up or you make more than one caravan instance, and the usual unstable warning I give with my scripts.'
any way probably should figure out how to put items in the trader side so I could exchange wares with visitors... next

5
DF General Discussion / Re: Future of the Fortress
« on: January 27, 2024, 12:34:34 pm »
So with the demi-god being converted into tutorial mode is there like an option to have the old demi-god settings? So that future runs aren't just stuck to the two lesser point pool options or risk dealing with the tutorial again?

the force tutorialization stuff kinda threw a monkey wrench in my common demi-god adv runs a bit
that said I wonder what this means for multiple adv party members if one of them is a demi-god? Does that lead to the Tori the goddess of Tutor popping in to explain a feature if a player tabs over to the demi-god?

I think the changes to demigods are going to be more like you're the hearthperson to a deity who you can talk to any time, and they will send you on quests with minor and medium blessings as rewards (could probably reuse divination blessings.) I think that playing a hearthperson was the intended experience for new players in older editions, so it would make sense to make the demigod changes work like that. Probably when you open a UI element there will be a tutorial popup explaining what it does like in fort mode, for all three difficulties.
gonna pop in to say as an old player, the hearthperson stuff was just added because folks wanted traditional quests and the 'not actually quests' but telling you events that happen in the world 'ask for troubles' stuff had made many  new players confused in the past, it just that the quests the lords gave out were also the ones that demand a bit more game mastery than the 'kill 7 rats' gamer assumptions so not many folks were not able to complete them.
and these quests were agreements so that just stuck out in the quest log agreements showing you never did figure out how to solve this lord's puzzle.

having deities be a version of that on top of being a tutorial is going to be Rough since with lords folks who get fed up with their quests could just take matters in their own hands and just take over the site... and dispose of them.
deities don't have that much luxury of just shutting up.

6
DF General Discussion / Re: Future of the Fortress
« on: January 25, 2024, 07:52:26 pm »
So with the demi-god being converted into tutorial mode is there like an option to have the old demi-god settings? So that future runs aren't just stuck to the two lesser point pool options or risk dealing with the tutorial again?

the force tutorialization stuff kinda threw a monkey wrench in my common demi-god adv runs a bit
that said I wonder what this means for multiple adv party members if one of them is a demi-god? Does that lead to the Tori the goddess of Tutor popping in to explain a feature if a player tabs over to the demi-god?

7
DF Adventure Mode Discussion / Re: What's going on in your adventure?
« on: January 09, 2024, 11:58:29 pm »
Honestly I'm surprised he didn't attack you. Megabeast hostility usually overrides everything else and they attack everyone/everyone attacks them
so all the sapient beings in the game have potential to shift to being peaceful if they join a civ group, also giants being semi-megabeasts might not give them full 'Megabeast' properties.

them joining a church in a ruin probably could happen due to settling in a place that had a church

I'm not surprised the giant didn't attack them given they aren't considered wild.

I remember spending time talking semi-megabeasts into joining civs in my past days of playing adv mode.

8
so kinda wonder if Dark ages V has a DF 50 classic build for the folks who pick up DF50 from bay12games?

9
Utilities and 3rd Party Applications / Re: DFHack 50.11-r4
« on: December 10, 2023, 01:18:56 am »
ok realize I been testing this script for some time now and uhh here's two scripts that reveal the world map of hidden sites and adds an embark note marker to them to show where they are when you zoom in,
Code: ('revealsites.lua') [Select]
for k,v in pairs(df.global.world.world_data.sites) do
if v.type~=0 then
v.flags[0]=false
end
if v.type==2 or v.type==6 or v.type==7 or v.type==9 or v.type==10 then
Mum=df.global.world.world_data.embark_notes
Mum:insert("#",{new=true,tile=32, fg_color=12, bg_color=2, name=dfhack.TranslateName(v.name),left=v.rgn_min_x,right=v.rgn_max_x,top=v.rgn_min_y,bottom=v.rgn_max_y})
local clu2=Mum[#Mum-1]
clu2.pos.x=v.pos.x
clu2.pos.y=v.pos.y
end
end

and another for mapping out the realization buildings on big pre-gen sites which requires one to embark on top of the site first to scan the large site for realizations... it's mostly a voidfort assistant script. also this will hide the site as the embark notes seem to be under the normal site rectangle I guess in premium the visual is like transparent so this is probably not necessary but shrugs.
Code: ('map-a-site2.lua') [Select]
for k,v in pairs(df.global.world.world_data.sites) do
if v.type==1 or v.type==3 or v.type==4 or v.type==5 or v.type==10 then
if v.realization==nil then else
v.flags[0]=true

for ok,oe in pairs(v.realization.buildings) do
local regionx=math.floor(oe.min_x/47)
local regionx2=math.floor(oe.max_x/47)
local regiony=math.floor(oe.min_y/47)
local regiony2=math.floor(oe.max_y/47)
local regionmath1=math.floor((v.global_min_x+regionx)/16)
local regionmath2=math.floor((v.global_max_x+regionx2)/16)
local regionmath3=math.floor((v.global_min_y+regiony)/16)
local regionmath4=math.floor((v.global_max_y+regiony2)/16)
local globalmath1=math.floor((v.global_min_x+regionx)-(regionmath1*16))
local globalmath2=math.floor((v.global_max_x+regionx2)-(regionmath2*16))
local globalmath3=math.floor((v.global_min_y+regiony)-(regionmath3*16))
local globalmath4=math.floor((v.global_max_y+regiony2)-(regionmath4*16))
function embarknote(oe,v,regionmath1,regionmath3,globalmath1,globalmath2,globalmath3,globalmath4)
local buildcolor=oe.type
Mum=df.global.world.world_data.embark_notes
Mum:insert("#",{new=true,tile=buildcolor, fg_color=10, bg_color=5, name=dfhack.TranslateName(v.name),
left=globalmath1,
right=globalmath2,
top=globalmath3,
bottom=globalmath4})
local clu2=Mum[#Mum-1]

clu2.pos.x=regionmath1
clu2.pos.y=regionmath3

end
print (oe.type)
if oe.type~=16 then
embarknote(oe,v,regionmath1,regionmath3,globalmath1,globalmath2,globalmath3,globalmath4)
end

end
end
end
end



I have been working on an revise of the armview script where it just points at the army on march so one could embark on top of your squad... but I feel like if the player didn't set the calendar timer to 0 ticks this will just end up not working for them on top of that the squad will just march out of the new embark so you got a small window of time to mess with them.



Code: ('build-store-c.lua') [Select]
--this script uses old dfhack code to store items on to the wagon via keyboard cursors.
--probably more stable than the other scripts that store items onto the wagon but requires it to be on the floor.
local contain={}
 function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end

function stuffwagon(curx,cury,curz)

for de,oe in pairs(df.global.world.buildings.all) do
if oe.name == 'Target' then


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==curx and cy==cury and cz==curz then --compare them
dfhack.items.moveToBuilding(vector[i],oe) --return index
end
end

end
end
end

stuffwagon(getxyz())

edit 12/28/2023 : here's a version of the wagon store script that now just stuff items into buildings if you select them with the cursor... probably if you don't have the keyboard cursor script the mining one.
this here mess could say let you stuff things that normally can't be traded into the trade depot if you name the trade depot Target.


10
DF Modding / Re: What's going on in your modding?
« on: November 14, 2023, 11:08:21 pm »
How could they vanish from the save?
so far from what I look into it seems like the two skeleton archer humans I resurrected was resurrected away from their unit body so the game just went 'welp time to unload them from this location'
like their historical figure data and the nemesis records seem to not have the unit data attached to them any more so on reload of the session save they just poofed.
I didn't have much of this issue once I started resurrecting the bodies right where I found them.

11
DF Modding / Re: What's going on in your modding?
« on: November 14, 2023, 10:02:22 am »
so kinda learn how to do manual fort mode necromancy by tapping into cursed tombs to use interactions that tie to messing with corpses.

the experience is a bit thrilling but also challenging given vanilla interactions for resurrection and reanimation have a threshold of how preserved the body should be before you can't mess with them with the dark arts.
and it usually stops at mangled body parts.

I could probably pursue the other forms of interaction to see if one could tap into just target creatures. though as of now this means I could mess with spell craft mods that dip heavy into resurrection and reanimation. also botch resurrecting someone and they vanished after loading the save again

12
Utilities and 3rd Party Applications / Re: DFHack 50.11-r2
« on: November 13, 2023, 08:09:08 am »
Hello everyone! Was wondering if there are any plans to add classic keyboard support and keybinds to the .50 version of the game? Really missing those old keybinds.
so I went and made a DF50 keyboard cursor script that just a modified version of a different gui liquids script that display an x where the in game cursor is currently placed.

13
Utilities and 3rd Party Applications / Re: DFHack 50.11-r2
« on: November 09, 2023, 02:51:40 am »
sitting here thinking about 'yeah it does take a while for DF to boot up' but then I just figured that due to how I store DF which is on an external drive.
but I guess loading DF onto the cloud probably takes a bit more longer than just having it on the harddrive or some external drive.

14
Utilities and 3rd Party Applications / Re: DFHack 50.11-r2
« on: November 04, 2023, 09:42:31 am »
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.


Code: ("cage-unit.lua") [Select]
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.



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.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.

15
Utilities and 3rd Party Applications / Re: DFHack 50.11-r2
« on: October 25, 2023, 05:35:06 am »
ok so kinda been working on a script that lets one swap sites, so far it seem mostly useful for switching on to pre-gen sites,



Code: (siteswap.lua) [Select]
local nomad={}
local dlg=require("gui.dialogs")

local h_ent=nil
--local test= tonumber(...)

function teleportboatnames3()
local Ark={}
for k,v in pairs(df.global.world.world_data.sites) do
BoaName=dfhack.TranslateName(v.name, true)
table.insert (Ark,{dfhack.TranslateName(v.name, true).." "..v.name.nickname,nil,v,search_key = BoaName:lower()})
end
local f=function(Name,C)
  WarpEntityNames(C[3])
end
dlg.showListPrompt("list of stations","Select Station(s) to settle here",COLOR_WHITE,Ark,f,nil,nil,true)
end

function WarpEntityNames(Siteid)
local entity=Siteid.entity_links
local Ark1={}
for k1,v1 in pairs(entity) do
local BoaName1=dfhack.TranslateName(df.global.world.entities.all[v1.entity_id].name, true)
table.insert (Ark1,{dfhack.TranslateName(df.global.world.entities.all[v1.entity_id].name, true).." "..df.global.world.entities.all[v1.entity_id].name.nickname,nil,v1.entity_id,search_key = BoaName1:lower()})
end
local f=function(Name,C)
  unretire_all(C[3],Siteid)
end
dlg.showListPrompt("list of groups","Select group(s) to switch here",COLOR_WHITE,Ark1,f,nil,nil,true)
end


function stationmove()
if df.global.gview.view.child.child==nil then
print("this script requires you to be in the raid menu to work")
else
teleportboatnames3()
end
end


function MouseSeek3(siteID)
for x,y in pairs(df.global.world.entities.all) do
for x2,y2 in pairs(siteID) do
if y.name.first_name=="CREW" and y.id==y2.entity_id then
local EntMouse2=y2.entity_id
if y2.former_flag.residence==true then
y2.former_flag.residence=false
y2.flags.residence=true
end
return EntMouse2
end
end
end
end
function MouseSeek4(siteID)
for x,y in pairs(siteID) do
if y.flags.land_for_holding==true then
local EntMouse3=y.entity_id
print(EntMouse3)
return EntMouse3
end
if y.former_flag.land_for_holding==true then
y.former_flag.land_for_holding=false
y.flags.land_for_holding=true

end
end
end
function unretire_all(enti,siteID)
local Selectpark=df.global.world.entities.all[enti]
if df.global.plotinfo.main.fortress_entity~=nil or df.global.plotinfo.main.fortress_site~=nil then
df.global.plotinfo.main.fortress_entity=nil
df.global.plotinfo.main.fortress_site=nil
end
df.global.plotinfo.main.fortress_site=siteID
df.global.plotinfo.main.fortress_entity=Selectpark
df.global.plotinfo.site_id=siteID.id
df.global.plotinfo.group_id=enti
if MouseSeek4(siteID.entity_links)==nil then
df.global.plotinfo.civ_id=enti else
df.global.plotinfo.civ_id=MouseSeek4(siteID.entity_links)
end

aftermath()
end

function DeresidentAll(unit,trgunit)
for k,v in pairs(df.global.world.units.active) do
if v== nil then
error("Invalid creature")
end
v.flags2.resident=false
end
return true
end

function clearpopups()
df.global.world.status.popups:resize(0)
df.global.game.main_interface.options.open=false
df.global.game.main_interface.options.context=0
df.global.plotinfo.game_over=false
end

teleportboatnames3()
function aftermath()
df.global.cur_season_tick=3998
dfhack.gui.getCurViewscreen():feed_key(2)
 df.global.pause_state=false
print("unpaused", df.global.enabler.frame_last)
df.global.pause_state=false
if df.global.pause_state==true then
df.global.pause_state=false
end
dfhack.timeout(20,"frames",function() df.global.pause_state=false  end)
dfhack.timeout(33,"frames",function() df.global.pause_state=true DeresidentAll() print("unpaused") end)
dfhack.timeout(40,"frames",function() df.global.pause_state=true DeresidentAll()  clearpopups() print("unpaused") end)
dfhack.timeout(100,"frames",function() df.global.pause_state=true DeresidentAll()  clearpopups() print("unpaused") end)
dfhack.timeout(500,"frames",function() df.global.pause_state=true DeresidentAll()  clearpopups() print("unpaused") end)
dfhack.timeout(1,"ticks",function() dfhack.gui.getCurViewscreen():feed_key(278)
 DeresidentAll()

print("paused",  df.global.enabler.frame_last) end)
end


so you might also need these

Code: (clearpopups.lua) [Select]
function clearpopups()
df.global.world.status.popups:resize(0)
df.global.game.main_interface.options.open=false
df.global.game.main_interface.options.context=0
df.global.plotinfo.game_over=false
end
clearpopups()

Code: (deresident.lua) [Select]
function DeresidentAll(unit,trgunit)
for k,v in pairs(df.global.world.units.active) do
if v== nil then
error("Invalid creature")
end
v.flags2.resident=false
end
return true
end
dfhack.gui.getCurViewscreen():feed_key(278)
print("unpaused")
df.global.pause_state=false
dfhack.timeout(1,"ticks",function()  end)
 DeresidentAll()
 print("paused")

these two are already in the main script but I spent a bit too long trying to bypass the game over screen and the process on how I did that was toggling the entire site to have the resident unit flag off and clearing the prompt off the screen which these two scripts will do... the one for clearing the screen is the clearpopups one and the hopefully working toggle off residence unit flag so you can get citizens again is the second one.

will note this is extremely unstable in that expect repercussions of bypassing the game over screen every time you jump to a new site, swapping to a player fort might require using revflood and moving the camera to the game field.
oh yeah be careful with loading in a 17x17 size sites(towns, hamlets, hilltops, forest retreats, dark fortresses, dark pits, mountain halls) you might eat all your ram and memory trying to load those sites.
it best to have a pc with like 30 gigs of ram or something beefy to handle like 8 gigs being used on the spot for memory.

if you got like a reveal all sites script you could gain access to reading the names of camps and have a chance at loading into those also.

oh and another thing if you're playing a vanilla raw expect none of the noble stuff to work or partially working if you jump into any non dwarf entity group and expect it to mostly to not work if you land on a dwarven one.
in comparison to the nomad and void fort scripts this one a bit more sandbox-like given complete control over the civs you generated than just your dwarves/modded in civilizations.
so learn how it feels to control a necro tower then realize you got no pick or axe or anvil.

any way here's body swap but for sites.

Pages: [1] 2 3 ... 411