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.13-r5  (Read 867612 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
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]