Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 50.13-r1  (Read 811110 times)

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r5
« Reply #3615 on: February 04, 2024, 08:16:52 pm »

custom work details to be saved/restored to/from disk

Very possible. I just did something similar for difficulty settings and standing orders.

Quote
egg-layers that are assigned to a pen/pasture only claim nestboxes that are within that pen/pasture?

This one I'm less sure about. I don't know exactly how egg layers choose their nestboxes. I've noticed that *most* of the time, they'll claim the one that `autonestbox` assigns them to, but not always. I'd have to look into it.

Could you create feature requests for these two at https://github.com/DFHack/dfhack/issues ? Right now we're focused on getting ready for DF 50.12, and I don't want to forget about these.
Logged

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r5
« Reply #3616 on: February 05, 2024, 09:38:29 am »

custom work details to be saved/restored to/from disk

Very possible. I just did something similar for difficulty settings and standing orders.

Quote
egg-layers that are assigned to a pen/pasture only claim nestboxes that are within that pen/pasture?

This one I'm less sure about. I don't know exactly how egg layers choose their nestboxes. I've noticed that *most* of the time, they'll claim the one that `autonestbox` assigns them to, but not always. I'd have to look into it.

Could you create feature requests for these two at https://github.com/DFHack/dfhack/issues ? Right now we're focused on getting ready for DF 50.12, and I don't want to forget about these.

Done and done.
Logged
Really hoping somebody puts this in their signature.

Quantum Drop

  • Bay Watcher
  • Deep Sixed.
    • View Profile
Re: DFHack 50.11-r6
« Reply #3617 on: February 11, 2024, 06:29:10 am »

Quick question for anyone familiar with the 47.05 releases: is there any way I can use DFhack to transform a creature into a generated creature?

The specific scenario being that I'm trying to turn a human into a generated Experiment from the world.dat file; modtools/transform-unit doesn't seem to like the creature name in the raws due to the spacing and I've no clue how to make gui/gm-editor work.
Logged
I am ambushed by humans, and for a change, they do not drop dead immediately. I bash the master with my ladle, and he is propelled away. While in mid-air, he dies of old age.

Ziusudra

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r6
« Reply #3618 on: February 11, 2024, 04:36:21 pm »

modtools/transform-unit doesn't seem to like the creature name in the raws due to the spacing
You can enclose strings such as that in quotes to pass them into a tool. Like with createitem ROUGH "INORGANIC:LAPIS LAZULI".
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.11-r6
« Reply #3619 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
« Last Edit: February 12, 2024, 07:50:58 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.11-r6
« Reply #3620 on: March 06, 2024, 03:23:36 pm »

« Last Edit: March 07, 2024, 12:42:25 pm by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r6
« Reply #3621 on: March 12, 2024, 04:10:57 am »

DFHack 50.12-r2rc1 (beta) released!

Ready for testing: agitation-rebalance, fix/stuck-worship, work details import/export, autoretrain livestock, labor and skill restrictions for workshops

Get it from:

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.11-r6
« Reply #3622 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.

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.11-r6
« Reply #3623 on: March 21, 2024, 12:20:24 pm »

DFHack 50.12-r2.1 released!

Highlights: Taking the frustration out of irritation, fixing longstanding vanilla bugs, instrument component lookup, automatically retrain partially trained livestock, skill level and labor type restrictions for workshops.

Get it from:

Full installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html
« Last Edit: March 26, 2024, 06:38:47 am by myk »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.11-r6
« Reply #3624 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
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.11-r6
« Reply #3625 on: March 26, 2024, 06:47:28 am »

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
})

I believe this is the bit that the existing open-legends script is missing. This might finally allow that script to work! Thanks!
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r2.1
« Reply #3626 on: April 04, 2024, 03:59:16 am »

DFHack 50.12-r3rc1 (beta) released!

Highlights: Dig through warm or damp tiles without interruption, open legends mode directly from an active fort, unlink levers.

Get it from:

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

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r2.1
« Reply #3627 on: April 05, 2024, 05:02:53 pm »

I just opened a discussion for requirements for the new unit overview screen here: https://www.reddit.com/r/dwarffortress/comments/1bwue80/dfhack_adventure_mode_poll_results_and_next_steps/

Anyone who doesn't want to comment on reddit can of course reply here too.
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r2.1
« Reply #3628 on: April 11, 2024, 03:32:23 pm »

DFHack 50.12-r3 released!

Highlights: Open legends mode directly from an active fort, Dig through warm or damp tiles without interruption, Unlink buildings from levers.

Get it from:

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

elilla

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r3
« Reply #3629 on: April 18, 2024, 02:18:08 pm »

It seems that if I create rock nuts with "createitem SEEDS BUSH_QUARRY 10", I can't mill the resulting seeds? am I missing something?

moreover I tried modding almond seeds to be oil-bearing and I found if I create almond seeds with "createitem PLANT_GROWTH ALMOND:NUT", the resulting almonds are millable.  but I do "createitem SEEDS ALMOND", they aren't.  the resulting items look the same in the UI.
Logged
Pages: 1 ... 240 241 [242] 243