Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 223 224 [225] 226 227 ... 243

Author Topic: DFHack 50.13-r2.1  (Read 824424 times)

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3360 on: February 16, 2023, 04:47:44 pm »

I know the DFHack devs are focusing on .50.xx, but is there any chance you could do a small QoL improvement for those that prefer .47.05 ?

When a dwarf makes an artifact that's a family heirloom, I put a display case in their room for it.  Finding the artifact among the dozens of pages of Non-Sortable artifacts is a real pain that gets more painful as the decades pass... can it be made sortable?

This would really make the game less frustrating and I still love .47.05
Logged
FPS in Gravearmor (850+ dwarves) is 3-6 (v0.47.05 lives on).
"I've never really had issues with the old DF interface (I mean, I loved even 'umkh'!)" ... brewer bob
As we say in France: "ah, l'amour toujours l'amour"... François D.

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3361 on: February 16, 2023, 04:49:08 pm »

If someone comes up with a patch that works for start dwarf counts less than 7 (such as, oh I don't know, one), that I might be more interested in...

But... you can.  I just did it in the debugger.  The only trick is, you need to embark with at least 6 animals.  (4 purchased animals and the 2 wagon animals.)

Poking at it a bit, the obvious solution is to patch n into the startdwarf location and (255-n) in the last byte of the LEA instruction, exactly 16 bytes later.

On inspection, that would work.  The limit would be 126 127 dwarves before the LEA starts adding instead of subtracting.

Fragile as anything, though.  There's no telling what the optimizer will do to the code in future releases.  I sure wouldn't want to hardcode a 16 byte offset in hopes that it magically will always work.

Thank you for looking at this.
Not to mention it's not remotely likely to work with any future linux builds, which will presumably be built with gcc (or perhaps clang) and thus won't have the same optimizer as MSVC.

I can't say I blame MSVC here, though; the compiler is not under any obligation to make code that can be blithely patched in arbitrary ways by poking at it with a stick, especially when optimization is requested. The resulting code is smaller than any of the alternatives and, as far as I know, is not slower.
Logged

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3362 on: February 16, 2023, 04:53:38 pm »

I know the DFHack devs are focusing on .50.xx, but is there any chance you could do a small QoL improvement for those that prefer .47.05 ?

When a dwarf makes an artifact that's a family heirloom, I put a display case in their room for it.  Finding the artifact among the dozens of pages of Non-Sortable artifacts is a real pain that gets more painful as the decades pass... can it be made sortable?

This would really make the game less frustrating and I still love .47.05
It is unlikely that we will make any further official releases for 47.05 for any reason other than to fix a serious bug. We had to significantly redesign our workflow automation to make builds for v50, which means we no longer have the ready means to make release builds for prior versions. Any release for 47.05 would have to be hand-rolled, and we're not likely to go to all the trouble required to do that for anything less than the discovery of a showstopper-level bug.
Logged

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3363 on: February 16, 2023, 09:35:39 pm »

I know the DFHack devs are focusing on .50.xx, but is there any chance you could do a small QoL improvement for those that prefer .47.05 ?

When a dwarf makes an artifact that's a family heirloom, I put a display case in their room for it.  Finding the artifact among the dozens of pages of Non-Sortable artifacts is a real pain that gets more painful as the decades pass... can it be made sortable?

This would really make the game less frustrating and I still love .47.05
It is unlikely that we will make any further official releases for 47.05 for any reason other than to fix a serious bug. We had to significantly redesign our workflow automation to make builds for v50, which means we no longer have the ready means to make release builds for prior versions. Any release for 47.05 would have to be hand-rolled, and we're not likely to go to all the trouble required to do that for anything less than the discovery of a showstopper-level bug.
Thanks for the reply.  It's hard being a dinosaur.
Logged
FPS in Gravearmor (850+ dwarves) is 3-6 (v0.47.05 lives on).
"I've never really had issues with the old DF interface (I mean, I loved even 'umkh'!)" ... brewer bob
As we say in France: "ah, l'amour toujours l'amour"... François D.

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3364 on: February 17, 2023, 03:03:24 pm »

Where is the "init.d" directory mentioned in the documentation supposed to be created? It says "main DF directory" but it does not work for me. The only occurence of init.d I find in the code is for "raw/init.d".

Or what is the best way to run a lua command on startup? Should I rather create a "dfhack-config/init/dfhack-....init" file containing ":lua ..."?
I'm asking again. Sorry for spamming, I think it may have been forgotten at the end of the previous page.

and you again somehow got the last slot on the page : p

You *can* use the "init.d" directory, but I think the best solution for you, as you surmised, would be to add a file to "dfhack-config/init/dfhacksomething.init"
« Last Edit: February 17, 2023, 03:15:48 pm by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3365 on: February 17, 2023, 03:07:30 pm »

Thanks for the reply.  It's hard being a dinosaur.

Note that we made a branch for 0.47.05-compatible code, so if you do want to make a code change that implements a feature, you can check out that branch, make whatever changes are needed, and build it yourself. Docs for how to do that are here: https://docs.dfhack.org/en/0.47.05-r8/docs/dev/Compile.html

The branch is named "v0.47.05", so you'll need to switch to that branch from the default "develop" branch.
Logged

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3366 on: February 17, 2023, 07:23:34 pm »

Thanks for the reply.  It's hard being a dinosaur.

Note that we made a branch for 0.47.05-compatible code, so if you do want to make a code change that implements a feature, you can check out that branch, make whatever changes are needed, and build it yourself. Docs for how to do that are here: https://docs.dfhack.org/en/0.47.05-r8/docs/dev/Compile.html

The branch is named "v0.47.05", so you'll need to switch to that branch from the default "develop" branch.

Thank you myk.  It's nice to have an option, even if I would need to learn to program in C++
Logged
FPS in Gravearmor (850+ dwarves) is 3-6 (v0.47.05 lives on).
"I've never really had issues with the old DF interface (I mean, I loved even 'umkh'!)" ... brewer bob
As we say in France: "ah, l'amour toujours l'amour"... François D.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3367 on: February 21, 2023, 03:41:17 am »

ok so screwing around with DF 50 and decided to poke around with jumping into viewscreens again.
this here is the game mode view screen script which lets you force DF to bring up the game mode menu screen.
which has some interesting interactions mid fort mode session as if you embark again near your current fort the game will load in the next land mass chunk
Spoiler (click to show/hide)
Code: ("game-menu.lua") [Select]
local old_screen=dfhack.gui.getCurViewscreen()
local new_screen=df.viewscreen_choose_game_typest:new()
old_screen.child=new_screen
new_screen.parent=old_screen

new_screen.gametypes:insert("#",0)
new_screen.gametypes:insert("#",2)

which leads to the next port of an old script. the mobile campboats got remade into a nanofort shuttle script which lets one take a nano fort and move it around the embark screen when combined with the game menu script to jump back into the embark menu again you can unretire your nano fort and connect said fort to the previous fort.
another thing of note for doing this I been calling the process of unloaded map chunks digging and exploring the void and kinda been seeing this set up as Void forts where your main void fort is latching on to these other forts as a source for supplies and equipment and when you have your fill with the place you just move everyone back to the main void fort location and retire.
edit 4/21/2023: I went back and edited the name of the old station name script to reflect that these forts don't need to be nano to move around.
Spoiler (click to show/hide)
Code: ("StationMove.lua") [Select]
--nano-boat-station-for-void-forts

local dlg=require("gui.dialogs")

function teleportboatnames2()
local Ark={}
for k,v in pairs(df.global.world.world_data.sites) do
if v.name.first_name=="STATION" then
BoaName=dfhack.TranslateName(v.name)
table.insert (Ark,{dfhack.TranslateName(v.name).." "..v.name.nickname,nil,v})

end
end
local f=function(Name,C)
  MobileFortNano(C[3])
  --teleportboatlista(C[3])
end
dlg.showListPrompt("list of stations","Select Station(s) to settle here",COLOR_WHITE,Ark,f)
end

function MobileFortNano(siteID)
local MapCure=df.global.gview.view.child.location
local MapCurx=MapCure.region_pos.x
local MapCury=MapCure.region_pos.y
local MapCurEmbark=MapCure.embark_pos_min
local Fortsite=siteID.index
df.global.world.world_data.sites[Fortsite].pos.x=MapCurx
df.global.world.world_data.sites[Fortsite].pos.y=MapCury
df.global.world.world_data.sites[Fortsite].rgn_min_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].rgn_max_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].rgn_min_y=MapCurEmbark.y
df.global.world.world_data.sites[Fortsite].rgn_max_y=MapCurEmbark.y
df.global.world.world_data.sites[Fortsite].global_min_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].global_max_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].global_min_y=MapCurEmbark.y
df.global.world.world_data.sites[Fortsite].global_max_y=MapCurEmbark.y
end

if df.global.gview.view.child==nil then
print("this script requires you to be in the raid menu to work")
else
teleportboatnames2()
end
and
Code: ("StationSetup.lua") [Select]
local dlg=require("gui.dialogs")

function nameStation()
df.global.world.world_data.sites[df.global.plotinfo.site_id-1].name.first_name="STATION"
df.global.world.world_data.sites[df.global.plotinfo.site_id-1].name.nickname="VoidShuttle"
dlg.showMessage("Travel-Hack","Converting fort into VoidStation")
end
nameStation()
so Station move script functions in embark menu as you set up your embark size and select the destination while not confirming the warning prompt that shows up as you use that to lock the coord in place so the script can function.
the script will then pull a list of 'Stations' to put into that spot, you probably want to then back to selecting a spot to embark to actually embark.
the second script is for setting up the nano fort to be a 'Nano Fort Station' so you can select said site from the pool of other Stations.
the process works as running the script while playing the nano fort then I guess save and or retire the nano fort.

should be warned void fort playstyle is a bit open to either being a novelty gimmick or potentially run ending levels of dangerous if you don't keep tabs on your important citizens while preparing to break off from the site you latch on too.
oh and you can totally dig into the void/un-allocated space doing this.
 the script works on nano forts so making it take any size of your fort to move would take a bit more work and probably more ram space to load up two larger forts next to each other.
that said you could make a large first fort then move and second embark a nano void fort next to that site to tap into the resources.

oh and be careful on z level stuff moving around the world map and connecting to other forts might lead to having one fort higher or lower than the other and might require digging into the other site to connect to it.
oh and if you want to preserve the stuff you made and the units you gotten, you may want to move into the second/last/latest fort in the chain of game mode caused fort re-embarkings.
anything built in the void is temporary on retire and back in 47 visiting the place in adv mode led to the locations being filled back in to the normal terrain. so you might end up with dwarves trapped in soil and rock.

so have fun exploring the world through void traveling into other forts(or just connecting the fort directly to the other fort side by side)

oh yeah I should dump the script that hides other sites and unhides them so you can embark on pre-gen sites and loot them as well

Code: ("hide-sites.lua") [Select]
for k,v in pairs(df.global.world.world_data.sites) do
if v.type~=0 then
v.flags[0]=true
end
end


Code: ("reveal-sites.lua") [Select]
for k,v in pairs(df.global.world.world_data.sites) do
if v.type~=0 then
v.flags[0]=false
end
end

these scripts will hide and reveal sites that are not player sites.
should also note if you hide the sites at the start of the game and play fort mode for a bit longer and retire and unretire the game will spawn in more sites, so you could end up with means to raid and attack folks and also accidentally embark over a tomb or dark pit's burial grounds.


edit : ok here's a short script that converts explore ruin missions to be one that let's you conquer them,

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.type==2 then
if rm.data.InvasionOrder.unk_1==5 then
rm.data.InvasionOrder.unk_1=2
end
end
end

just run this while in the world map screen in DF 50. for the folks who overkilled a location and didn't get the chance to conquer it and or not feeling like reclaiming and retiring a ruin site.


edit: ok so here's an update to station move that lets you move any size void fort
Code: ("stationmovemath.lua") [Select]
local dlg=require("gui.dialogs")


function teleportboatnames3()
local Ark={}
for k,v in pairs(df.global.world.world_data.sites) do
if v.name.first_name=="STATION" then
BoaName=dfhack.TranslateName(v.name)
table.insert (Ark,{dfhack.TranslateName(v.name).." "..v.name.nickname,nil,v})
end
end
local f=function(Name,C)
  MobileFortNano(C[3])
end
dlg.showListPrompt("list of stations","Select Station(s) to settle here",COLOR_WHITE,Ark,f)
end
function stationmove()
if df.global.gview.view.child==nil then
print("this script requires you to be in the raid menu to work")
else
teleportboatnames3()
end
end


function MobileFortNano(siteID)
--local MapCurx=df.global.gview.view.child.location._x
local MapCure=df.global.gview.view.child.location
--local MapCure=df.global.gview.view.child.child.location
local MapCurx=MapCure.region_pos.x
local MapCury=MapCure.region_pos.y
local MapCurEmbark=MapCure.embark_pos_min
local MapCurEmbark2=MapCure.embark_pos_max
local Fortsite=siteID.index
local FortSize=df.global.world.world_data.sites[Fortsite]
local math1=FortSize.rgn_min_x-FortSize.rgn_max_x
local math1a=FortSize.rgn_min_y-FortSize.rgn_max_y
local math2=MapCurEmbark.x-MapCurEmbark2.x
local math2a=MapCurEmbark.y-MapCurEmbark2.y
if math1==math2 and math1a==math2a then
--print("works")
df.global.world.world_data.sites[Fortsite].pos.x=MapCurx
df.global.world.world_data.sites[Fortsite].pos.y=MapCury
df.global.world.world_data.sites[Fortsite].rgn_min_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].rgn_max_x=MapCurEmbark2.x
df.global.world.world_data.sites[Fortsite].rgn_min_y=MapCurEmbark.y
df.global.world.world_data.sites[Fortsite].rgn_max_y=MapCurEmbark2.y
df.global.world.world_data.sites[Fortsite].global_min_x=MapCurEmbark.x
df.global.world.world_data.sites[Fortsite].global_max_x=MapCurEmbark2.x
df.global.world.world_data.sites[Fortsite].global_min_y=MapCurEmbark.y
df.global.world.world_data.sites[Fortsite].global_max_y=MapCurEmbark2.y
else
dlg.showMessage("Travel-Hack-Error","incorrect fort size change to correct size")

print('incorrect fort size change to correct size')
end
end

stationmove()
« Last Edit: April 21, 2023, 11:53:40 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

Inatun

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3368 on: February 22, 2023, 12:56:43 pm »

Is there a way to create a specific amount of mud on a tile? I'm running a test on new soil quality mechanics that involves artificially irrigated stone and I want fine control over how much mud is made just to reduce variables.

Schmaven

  • Bay Watcher
  • Abiding
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3369 on: February 22, 2023, 08:34:05 pm »

The liquids spawning command should do what you want.  I think there's only 3 levels of mud: pile of mud; dusting of mud; and no mud.  A dusting is created by first contact with water.  Subsequent contacts produce the thicker mud.
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha1 (pre-release)
« Reply #3370 on: February 24, 2023, 07:24:55 pm »

DFHack 50.07-alpha2 released!

Clear things away with gui/mass-remove:


Trade with less clicking:


Lay down designs with gui/dig:


Get it here: https://github.com/DFHack/dfhack/releases/tag/50.07-alpha2
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha2 (pre-release)
« Reply #3371 on: March 01, 2023, 05:42:26 pm »

Code: ("force-petition.lua") [Select]
--this script is made as means to petition folks to join a fort manually requires mining cursor to work
--doesn't work on folks who don't have a historical figure so watch out.
--this script re-uses warmist and other folks in the dfhack community functions to get access to the cursor
local ui=plotinfo
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 getCreatureAtPos(x,y,z) -- gets the creature index @ x,y,z coord
--local x,y,z=getxyz() --get 'X' coords
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 petition()
local ui=plotinfo

local Shell=getCreatureAtPos(getxyz())
local Agree=df.global.world.agreements.all
Agree:insert("#",{new=true,id='-10',next_party_id=2,next_details_id=1})
local dd=Agree[#Agree - 1]
print('oh no')
dd.id = df.global.agreement_next_id
df.global.agreement_next_id = df.global.agreement_next_id + 1
dd.details:insert("#",{new=true,type=3})
dd.parties:insert("#",{new=true})
dd.parties:insert("#",{new=true})
dd.details[0].data.Citizenship=df.agreement_details_data_citizenship:new()
dd.details[0].data.Citizenship.applicant=0
dd.details[0].data.Citizenship.government=1
dd.details[0].data.Citizenship.site=df.global.plotinfo.site_id
dd.parties[0].histfig_ids:insert("#",0)
dd.parties[0].histfig_ids[0]=Shell.hist_figure_id
dd.parties[1].id=1
dd.parties[1].entity_ids:insert("#",0)
dd.parties[1].entity_ids[0]=df.global.plotinfo.group_id
df.global.plotinfo.petitions:insert("#",dd.id)

end
function petition2()
local ui=plotinfo

local Shell=getCreatureAtPos(getxyz())
local Agree=df.global.world.agreements.all
Agree:insert("#",{new=true,id='-10',next_party_id=2,next_details_id=1})
local dd=Agree[#Agree - 1]
print('oh no')
dd.id = df.global.agreement_next_id
df.global.agreement_next_id = df.global.agreement_next_id + 1
dd.details:insert("#",{new=true,type=2})
dd.parties:insert("#",{new=true})
dd.parties:insert("#",{new=true})
dd.details[0].data.Residency=df.agreement_details_data_residency:new()
dd.details[0].data.Residency.reason=3
dd.details[0].data.Residency.applicant=0
dd.details[0].data.Residency.government=1
dd.details[0].data.Residency.site=df.global.plotinfo.site_id
dd.parties[0].histfig_ids:insert("#",0)
dd.parties[0].histfig_ids[0]=Shell.hist_figure_id
dd.parties[1].id=1
dd.parties[1].entity_ids:insert("#",0)
dd.parties[1].entity_ids[0]=df.global.plotinfo.group_id
df.global.plotinfo.petitions:insert("#",dd.id)

end
petition2()
petition()

well here's a revised DF50 version of the force petition script I made some time ago.

it uses the mining cursor to function and mostly works on folks with a historical figure so non-hist figs might not join.

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

Jazz Cat

  • Bay Watcher
  • Adept stringed instrumentalist
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha2 (pre-release)
« Reply #3372 on: March 06, 2023, 07:33:15 pm »

I apologize if this has been asked before, but is there a utility in the works that removes the work detail system entirely so it can be replaced with other stuff (ie, Kloker or Therapist)?
Logged
Give your dwarves a pet
My holiday mod (only offensive to elves)
The check-laundry script

Quote
Just give the Crossbow weapon the [AMMO:CROSSBOW] tag in the raws. You can make a crossbow that shoots crossbows.

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha2 (pre-release)
« Reply #3373 on: March 06, 2023, 08:41:29 pm »

DF has a flag that can disable the work details system to allow for external control. both DT and DFHack's autolabor set this flag so they can work. There has been some discussion about some sort of central mechanism for handling the flag state so multiple applications won't step on each other's edits. For now, it's probably up to the player to ensure they're only using one of the "flag clients" at a time.
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r8 | 50.07-alpha2 (pre-release)
« Reply #3374 on: March 11, 2023, 07:09:03 pm »

DFHack 50.07-alpha3 released!

Easily plan out buildings before you have materials with buildingplan:


Ensure your screw pumps are magma-safe with just one click:


Control the quality of items used as materials:


Select which materials you want to build with:


Select specific items if you want to:


Symmetrical shapes with gui/dig:


Get it here: https://github.com/DFHack/dfhack/releases/tag/50.07-alpha3
« Last Edit: March 16, 2023, 08:59:31 pm by myk »
Logged
Pages: 1 ... 223 224 [225] 226 227 ... 243