Bay 12 Games Forum

Please login or register.

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

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

Salmeuk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r2.1
« Reply #3630 on: April 18, 2024, 11:53:43 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.

so I am glad to see this option win!! here are my thoughts

1. copy pasting labor assignments AND profession titles across multiple dwarves, quickly.

   thus enabling the creation of large groups of laborers with duplicated assignment settings and titles

2. allow for a 'free labor' on / off switch for the entire fortress, allowing a quick return to the default (anarchic) state, should you need to just get things completed

3. a screen-space efficient overview of enabled labors. seeing the dwarves laid out in a spreadsheet-esque fashion seems to be the most practical

4. perhaps a separate screen to review dwarf skills, or needs even, but I would hesitate to include too much overlapping information.

again, the previous iteration of dfhack's labor management interface from the 47.05 versions was superb and well designed in all regards.... props to whomever created that beast of an interface. I only wish premium had taken more heed
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r3
« Reply #3631 on: April 23, 2024, 11:11:42 am »

DFHack 50.13-r1.1 released!

Highlights: Point and click quantum stockpiles, Extended unit info summary.

Get it from:

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

If you are subscribed to the DF default branch on Steam, please subscribe to the DFHack default branch as well. If you are subscribed to the DF beta branch, please subscribe to the DFHack adventure-beta branch.
« Last Edit: April 25, 2024, 12:47:13 am by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.12-r3
« Reply #3632 on: May 09, 2024, 07:20:31 pm »

DFHack 50.13-r2 released!

Highlights: Localization support, Adventure mode support, Export unit and item descriptions, Quick switch favorites for building planner materials.

Get it from:

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

If you are subscribed to the DF default branch on Steam, please subscribe to the DFHack default branch as well. If you are subscribed to the DF beta branch, please subscribe to the DFHack adventure-beta branch.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.13-r2
« Reply #3633 on: May 15, 2024, 10:06:54 am »


ok made some more modifications to warmist's tofort script in hopes of dfhack using beta testers of adv mode could ... have fun with switching into one of their dwarves and go on an adventure... or something, maybe even just swap into fort mode  from adv mode and finally butcher the game you caught. this is basically untested in 51 and possibly Very unstable as I have no idea if this works in 51, kinda hope it does.

oh and probably make a backup of your saves before messing with this.
edit: ok so recently learn of the unit active 0 slot change and had to touch up this script still kinda in the blind on 51 structures.
Code: ("tofort18.lua") [Select]
-- changes from advmode to fort safely and back (hopefully)
--[[Now to warn you about saving and loading in either game mode might lead
    to some side issues, for saving in fort mode switching to adv mode needs the adv to be `bodyswap`
    back in again. for Saving in Adv to switch to Fort mode you probably be safe-ish if the site.
    isn't a nano fort or a site that isn't 3x3 small. otherwise the game will try to resize the map.
    oh and switching to fort mode on any pre-gen site larger than 4x4 might implode one pc if
    you don't have like 20 gigs of memory for the 16x16 embark size.

ok so this version of this script has be updated again so that caravans and visitors and migrants
could show up at any edge of the map... and maybe leave from any spot... of the z level you assign the site too.
should be warned while I mostly iron out the Caravan crash which ties into entities than anything that messes with plotinfo.
there still some unknowns left in the game
so uhh I probably should get to figuring out how to map the surface (properly) at some point...
should be said This is a modified copy of Warmist's Tofort script and this one is made for messing around the world.
there's a more Fort mode focus one called TopFort which dives into switching into player forts... and sometimes lord claimed campsites.

5/15/2024: rework the script to align to 50 new df structures and changed one designation clear function so it functions with out a cursor.
this wouldn't really work in 50 but maybe, there's potential chance of it working in the beta 51 build that has adv mode.
6/9/2024: unit.active[0] doesn't work so time to update this once again AGAIN
]]--

if df.global.gamemode==df.game_mode.ADVENTURE then
local adv= df.global.world.units.adv_unit
local comp={}
local plotinfo=df.global.plotinfo

function advGlobalPos()
    local wd=df.global.world.world_data
    return wd.adv_region_x*16+wd.adv_emb_x,wd.adv_region_y*16+wd.adv_emb_y
end
--function inSite()
--    local tx,ty=advGlobalPos()
--    for k,v in pairs(df.global.world.world_data.sites) do
--        local tp2={v.global_min_x, v.global_min_y, v.global_max_x, v.global_max_y}
--        if tx>=tp2[1] and tx<=tp2[3] and
--            ty>=tp2[2] and ty<=tp2[4] then
--            return v
--        end
--    end
--end
--local site=inSite()
--if site==nil then
--    qerror("No site you are in found.")
--end
local nomad={}
local h_ent
--local test= tonumber(...)
if plotinfo.main.fortress_entity~=nil or plotinfo.main.fortress_site~=nil then
plotinfo.main.fortress_entity=nil
plotinfo.main.fortress_site=nil
end
nomad=df.global.world.entities.all[test]
--for k,v in pairs(df.global.world.history.figures[adv.hist_figure_id].entity_links) do
--if v~=histfig_entity_link_memberst and not v==nil then
--nomad=df.global.world.entities.all[v.entity_id]

--print(test)
--else if v==histfig_entity_link_memberst then
--nomad=df.global.world.history.figures[adv.hist_figure_id].entity_links[0]
--end
--end
--end

if plotinfo.main.fortress_entity==nil then
    for k,v in pairs(df.global.world.entities.all) do
        --if v.type==df.historical_entity_type.SiteGovernment and v.id==nomad.id then --maybe match race too?
        if v.id==nomad.id then --maybe match race too?
            if nomad.positions.own==nil then
break else
h_ent=v
            break
        end
        end
if v.id~=nomad.id then
if v.type==df.historical_entity_type.SiteGovernment then

h_ent=v
end
end
    end
    if h_ent==nil then
        qerror("Valid historical entity not found. sorry...")
    end
    plotinfo.main.fortress_entity=h_ent
else
    h_ent=plotinfo.main.fortress_entity
end

function cleardesignate(adv)
local scorch=df.global.world.map.map_blocks
    for k,v in pairs(scorch) do
if v.flags.designated==true then
v.flags.designated=false
end
    for k2,v2 in pairs(v.designation) do
    for k3,v3 in pairs(v2) do
if v3.dig>0 or v3.smooth>0 then
v3.dig=0
v3.smooth=0
end
end
end
end
dfhack.run_command('revflood')

end


function cleardesignate-old(adv)
--local adv=df.global.world.units.active[0]
local adv= df.global.world.units.adv_unit
df.global.plotinfo.main.mode=10
df.global.selection_rect.start_x=0
df.global.selection_rect.start_y=0
df.global.selection_rect.start_z=610
df.global.selection_rect.end_x=-14300
df.global.selection_rect.end_y=9000
df.global.selection_rect.end_z=0
df.global.cursor.x=400
df.global.cursor.y=400
df.global.cursor.z=0
dfhack.gui.getCurViewscreen():feed_key(1)
df.global.cursor.x=adv.pos.x
df.global.cursor.y=adv.pos.y
df.global.cursor.z=adv.pos.z
dfhack.gui.getCurViewscreen():feed_key(1)
dfhack.run_command('revflood')

end
local carter={}
function addToEntity(entity,unit,addtoLead)
    local nem=dfhack.units.getNemesis(unit)
    local hfig=nem.figure
        for k,v in pairs(hfig.entity_links) do
if v.entity_id==entity.id then break else
carter=true
end
end
if carter==true then
hfig.entity_links:insert("#",{new=df.histfig_entity_link_memberst,entity_id=entity.id,link_strength=100})
    entity.nemesis_ids:insert("#",nem.id)
    entity.nemesis:insert("#",nem)
    entity.histfig_ids:insert("#",hfig.id)
    entity.hist_figures:insert("#",hfig)
end
    if addtoLead then
        local lead_id
        for k,v in pairs(entity.positions.own) do
            if v.flags.IS_LEADER==true then
                lead_id=v.id
                break
            end
        end
        if lead_id~=nil then
            for k,v in pairs(entity.positions.assignments) do
                if v.position_id==lead_id  then
                        v.histfig=hfig.id
                    break
                end
            end
        end
    end
end

plotinfo.civ_id=adv.civ_id
plotinfo.race_id=adv.race
df.global.pause_state=true


plotinfo.unk_races:insert("#",adv.race)
plotinfo.site_id=site.id
if plotinfo.main.fortress_site==nil then plotinfo.main.fortress_site=site end
if site.entity_links==nil then site.entity_links:insert("#", {new=true, df.entity_site_link, target=site.id, entity_id=plotinfo.fortress_entity.id,entity_site_link_flags.residence, entity_site_link_flags.trade_partner }) end
plotinfo.group_id=h_ent.id
plotinfo.game_state=2


if #plotinfo.tasks.discovered_plants==0 then
df.global.plotinfo.tasks.discovered_creature_foods:insert("#",0)
df.global.plotinfo.tasks.discovered_creatures:insert("#",0)
df.global.plotinfo.tasks.discovered_plants:insert("#",0)
df.global.plotinfo.tasks.discovered_plant_foods:insert("#",0)
end
if #plotinfo.alerts.list==0 then
    plotinfo.alerts.list:insert("#",{new=true,name="Dummy alert"})
    plotinfo.alerts.next_id=1
end


    local nem2=dfhack.units.getNemesis(adv)
    local hfig2=nem2.figure
    local nomad2=hfig2.entity_links[0]
    local nomad3=hfig2.entity_links
    local Test={}
    for co2,mp2 in pairs(nomad3) do
--print(mp2.entity_id,h_ent.id)
        if mp2.entity_id~=h_ent.id then Test=true else
            Test=false
            end
        end   
        if Test==true then
            addToEntity(h_ent,adv,true)
        end
    for co,mp in pairs(df.global.world.units.active) do
if mp.population_id==h_ent.id then
mp.flags2.resident=false
end
if mp.civ_id==h_ent.id or adv.civ_id==mp.civ_id then
mp.flags2.resident=false
end
        if mp.relationship_ids.GroupLeader==adv.id then
            local comp=mp
        if test==true then
            addToEntity(h_ent,comp,false)
        end
    end
end
function filleco(tbl,low,high)
  for v =low, high do
    tbl.general_items:insert("#",2)
  end
     tbl.weapons:insert("#",2)
    tbl.armor:insert("#",2)
    tbl.handwear:insert("#",2)
    tbl.footwear:insert("#",2)
    tbl.legwear:insert("#",2)
    tbl.headwear:insert("#",2)
    tbl.prepared_food:insert("#",2)
    tbl.wood:insert("#",2)
    tbl.thread_cloth:insert("#",2)
    tbl.paper:insert("#",2)
    tbl.parchment:insert("#",2)
    tbl.bone:insert("#",2)
    tbl.tooth:insert("#",2)
    tbl.horn:insert("#",2)
    tbl.pearl:insert("#",2)
    tbl.shell:insert("#",2)
    tbl.leather:insert("#",2)
    tbl.silk:insert("#",2)
    tbl.yarn:insert("#",2)
    tbl.inorganic:insert("#",2)
    tbl.meat:insert("#",2)
    tbl.fish:insert("#",2)
    tbl.plants:insert("#",2)
    tbl.drinks:insert("#",2)
    tbl.extract_animal:insert("#",2)
    tbl.mill_animal:insert("#",2)
    tbl.cheese_animal:insert("#",2)
    tbl.extract_plant:insert("#",2)
    tbl.mill_plant:insert("#",2)
    tbl.cheese_plant:insert("#",2)
    tbl.pets:insert("#",2)

end
function filleco2(tbl,low,high)
  for v =low, high do
    --tbl[v].unk1=site.pos.x
    --tbl.unk1:insert("#",site.pos.x)
    --tbl.unk2:insert("#",site.pos.y)
    tbl.general_items:insert("#",nil)
     --tbl[v].unk2=site.pos.y
  end
 
     tbl.weapons:insert("#",nil)
    tbl.armor:insert("#",nil)
    tbl.handwear:insert("#",nil)
    tbl.footwear:insert("#",nil)
    tbl.legwear:insert("#",nil)
    tbl.headwear:insert("#",nil)
    tbl.prepared_food:insert("#",nil)
    tbl.wood:insert("#",nil)
    tbl.thread_cloth:insert("#",nil)
    tbl.paper:insert("#",nil)
    tbl.parchment:insert("#",nil)
    tbl.bone:insert("#",nil)
    tbl.tooth:insert("#",nil)
    tbl.horn:insert("#",nil)
    tbl.pearl:insert("#",nil)
    tbl.shell:insert("#",nil)
    tbl.leather:insert("#",nil)
    tbl.silk:insert("#",nil)
    tbl.yarn:insert("#",nil)
    tbl.inorganic:insert("#",nil)
    tbl.meat:insert("#",nil)
    tbl.fish:insert("#",nil)
    tbl.plants:insert("#",nil)
    tbl.drinks:insert("#",nil)
    tbl.extract_animal:insert("#",nil)
    tbl.mill_animal:insert("#",nil)
    tbl.cheese_animal:insert("#",nil)
    tbl.extract_plant:insert("#",nil)
    tbl.mill_plant:insert("#",nil)
    tbl.cheese_plant:insert("#",nil)
    tbl.pets:insert("#",nil)

end

function fill(tbl,low,high)
  for v =low, high do
    tbl:insert("#",0)
    tbl:insert("#",v)
    tbl:insert("#",143)
    tbl:insert("#",v)
  end
end
function fill2(tbl,low,high)
  for v =low, high do
    tbl:insert("#",v)
    tbl:insert("#",143)
    tbl:insert("#",v)
    tbl:insert("#",0)
  end
end
function fillz(tbl,low,high)
  for v =low, high do
    tbl:insert("#",adv.pos.z)
    tbl:insert("#",adv.pos.z)
    tbl:insert("#",adv.pos.z)
    tbl:insert("#",adv.pos.z)
  end
end
function fillunk(tbl,low,high)
  for v =low, high do
    tbl[v].unk1=site.pos.x
    tbl[v].unk2=site.pos.y
  end
end
function fillanimal(tbl,low,high)
  for v =low, high do
    tbl:insert("#",1)
  end
end
function fillstone(tbl,low,high)
  for v =low, high do
    tbl:insert("#",0)
  end
end

function fillTrain(tbl,tbl2,low,high)
  for v =low, high do
    tbl2:insert("#",0)
tbl:insert("#",5)
  end
end


function mapcheck2()

fill(df.global.plotinfo.unk_mapedge_x,0,143)
fill2(df.global.plotinfo.unk_mapedge_y,0,143)
fillz(df.global.plotinfo.unk_mapedge_z,0,143)

fill(df.global.plotinfo.map_edge.surface_x,0,143)
fill2(df.global.plotinfo.map_edge.surface_y,0,143)
fillz(df.global.plotinfo.map_edge.surface_z,0,143)

for _,Lay in pairs(df.global.plotinfo.map_edge.layer_x) do

fill(Lay,0,143)
end
for _,Lay in pairs(df.global.plotinfo.map_edge.layer_y) do
fill2(Lay,0,143)
end
for _,Lay in pairs(df.global.plotinfo.map_edge.layer_z) do
fillz(Lay,0,143)
end
end
function sigh()
 mapcheck()
 mapcheck2()
for k,v in pairs(df.global.plotinfo.unk_mapedge_x) do

end
for k,v in pairs(df.global.plotinfo.map_edge.surface_z) do
df.global.plotinfo.map_edge.surface_z[k]=adv.pos.z
--v=152
end
end
function mapcheck()
fillunk(df.global.plotinfo.unk2a8c[0],0,143)
fillunk(df.global.plotinfo.unk2a8c[1],0,143)
fillunk(df.global.plotinfo.unk2a8c[2],0,143)
fillunk(df.global.plotinfo.unk2a8c[3],0,143)

end
Tab={}
Tab2={}
for k,Lay2 in pairs(df.global.plotinfo.map_edge.layer_z) do
for k2,Lay3 in pairs(df.global.plotinfo.unk2a8c[0]) do
if k then break else
Tab:insert("#",k)
end
Tab2:insert("#",k2)
return Tab,Tab2
end
end
if #df.global.plotinfo.map_edge.layer_z[0] == 0 then
print("map edge empty proceed to fill")
sigh()
 else
print("welp map edge currently full")
 end

 if plotinfo.main.fortress_entity.squads==0 then
for Sqa,Ds in pairs (df.global.world.squads.all) do
if Ds.entity_id==plotinfo.main.fortress_entity.id then
plotinfo.main.fortress_entity.squads:insert("#",{new=true,Ds})
end
end
end
if #plotinfo.tasks.discovered_plants==0 then

--for k,Lay2 in ipairs(df.global.world.raws.creatures.all) do
--return k
--end
local Anim=#df.global.world.raws.creatures.all
local Plan=#df.global.world.raws.plants.all
fillanimal(df.global.plotinfo.tasks.discovered_creatures,0,Anim)
fillanimal(df.global.plotinfo.tasks.discovered_creature_foods,0,Anim)

fillanimal(df.global.plotinfo.tasks.discovered_plants,0,Plan)
fillanimal(df.global.plotinfo.tasks.discovered_plant_foods,0,Plan)
--for k,Lay2 in ipairs(df.global.world.raws.plants.all) do
--return k
--end
--end
end
function fillTrain(tbl,tbl2,low,high)
  for v =low, high do
    tbl2:insert("#",0)
tbl:insert("#",5)
  end
end


 
if #plotinfo.kitchen.item_types==0 then
plotinfo.kitchen.item_types:insert("#",0)
plotinfo.kitchen.item_subtypes:insert("#",0)
plotinfo.kitchen.mat_types:insert("#",0)
plotinfo.kitchen.mat_indices:insert("#",0)
plotinfo.kitchen.exc_types:insert("#",0)
end
if #plotinfo.infiltrator_histfigs==0 then
plotinfo.infiltrator_histfigs:insert("#",0)
plotinfo.infiltrator_histfigs:insert("#",0)
plotinfo.infiltrator_years:insert("#",0)
plotinfo.infiltrator_years:insert("#",0)
plotinfo.infiltrator_years_ticks:insert("#",0)
plotinfo.infiltrator_years_ticks:insert("#",0)
end
if #plotinfo.economic_stone==0 then
for k,Lay2 in ipairs(df.global.world.raws.inorganics) do
fillstone(df.global.plotinfo.economic_stone,0,k)
--return k
end
end


if #plotinfo.economy_prices.price_adjustment.general_items==0 then

filleco(df.global.plotinfo.economy_prices.price_adjustment,0,114)
filleco2(df.global.plotinfo.economy_prices.price_setter,0,114)

end
--fix training info
if h_ent.training_knowledge == nil then
    h_ent.training_knowledge={new=true}
end
if #plotinfo.main.fortress_entity.training_knowledge.level==0  then
local Anim=#df.global.world.raws.creatures.all
fillTrain(plotinfo.main.fortress_entity.training_knowledge.level,plotinfo.main.fortress_entity.training_knowledge.unk_10,0,Anim-1)
end

df.global.gamemode=df.game_mode.DWARF
df.global.gametype=df.game_type.DWARF_MAIN
if df.global.gview.view.child.child==nil then df.global.gview.view.child=df.viewscreen_dwarfmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
 end
 cleardesignate()
    print("Mode change complete.")
else
    local adv=dfhack.gui.getSelectedUnit(true)
    if adv then
        --swap units...
    end
    df.global.gamemode=df.game_mode.ADVENTURE
    df.global.gametype=df.game_type.ADVENTURE_MAIN
df.global.gview.view.child=df.viewscreen_dwarfmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
    print("Mode change complete.")
end
« Last Edit: June 09, 2024, 11:38:27 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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r2.1
« Reply #3634 on: May 22, 2024, 11:50:38 pm »

DFHack 50.13-r2.1 was released today to fix a suspendmanager issue around stairs. Download at https://github.com/DFHack/dfhack/releases/tag/50.13-r2.1 (or on Steam as usual).
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 50.13-r2.1
« Reply #3635 on: June 04, 2024, 01:31:50 pm »

Spoiler: "old version" (click to show/hide)
Code: ("nomad-compass2.lua") [Select]
local dlg=require("gui.dialogs")
--testing-for-map-charting-for-nomad
--ok so this script is made for the pile of nomad scripts to aid in finding 'realizations in the pre-gen sites'
-- so if one wants to visit a tavern, or the main keep or locate where in the 17x17 grid is the market stalls you could with this script.
-- for the 'realization' seeking to work you need to nomadically move into the site you're looking for which then the game will load in the realization data.
-- if you see no realization data if you click on or select any of the other sites in the first menu that means they don't have one or you're not in the site.
-- the coord numbers are based on the distance from the player site -x is west x is east and -y is north and y is south if you see a 0 then you're right on top of the edge of that site.
-- the player site will always show 0 0 0 0 as it subtracting it's coords with itself. 
--this script is also built off the structure of an old just summon script.
function justsummoning()
local center = df.global.plotinfo.main.fortress_site
local Ark={}
local Radar= 32
for k,v in pairs(df.global.world.world_data.sites) do
if center.global_min_x - v.global_min_x < Radar and  center.global_min_x - v.global_min_x > -Radar and center.global_max_x - v.global_max_x < Radar and center.global_max_x - v.global_max_x > -Radar and center.global_min_y - v.global_min_y < Radar and center.global_min_y - v.global_min_y > -Radar and  center.global_max_y - v.global_max_y < Radar and center.global_max_y - v.global_max_y > - Radar then
local mapnotes1 = v.global_min_x - center.global_min_x
local mapnotes2 = v.global_max_x - center.global_max_x
local mapnotes3 = v.global_min_y - center.global_min_y
local mapnotes4 = v.global_max_y - center.global_max_y
local Sitetype={"Player Fort","Dark Fort","Cave","MountainHall","ForestRetreat","Town","Important Location","Lair/Shrine","MercFort","Camp","Monument"}
BoaName=dfhack.TranslateName(v.name)
table.insert (Ark,{dfhack.TranslateName(v.name).." "..Sitetype[v.type+1].." site id:"..v.resource_pile_id.." "..mapnotes1.." "..mapnotes2.." "..mapnotes3.." "..mapnotes4,nil,v,search_key = dfhack.TranslateName(v.name):lower()})
end
end
local f=function(Name,C,center)
 justsummoning2(C[3],center)
end
dlg.showListPrompt("Compass ","here a list of local sites around a 16 embark tile radius: min x max x , min y max y",COLOR_WHITE,Ark,f,nil,nil,true)
end
function justsummoning2(v,center)
local center = df.global.plotinfo.main.fortress_site
local Sitetype={"cottage plot","castle wall","castle tower","castle_courtyard","house","Temple","tomb","shop house","warehouse","market square","pasture","waste","courtyard","well","vault","great tower","trenches","tree house","hillock house","mead hall","fortress entrance","library","tavern","counting house","guild hall","city tower","shrine","shrugs","dormitory","dinging hall","Necro Tower"," barrow"}
local Ark2={}
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
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 regionmath1a=math.floor((v.global_min_x+regionx))
local regionmath2a=math.floor((v.global_max_x+regionx2))
local regionmath3a=math.floor((v.global_min_y+regiony))
local regionmath4a=math.floor((v.global_max_y+regiony2))
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))
local mapnotes1a = regionmath1a - center.global_min_x
local mapnotes2a = regionmath2a - center.global_max_x
local mapnotes3a = regionmath3a - center.global_min_y
local mapnotes4a = regionmath4a - center.global_max_y
if oe.building_info==nil then
table.insert (Ark2,{"no name".." "..Sitetype[oe.type+1].." "..mapnotes1a.." "..mapnotes2a.." "..mapnotes3a.." "..mapnotes4a,nil,v,search_key = dfhack.TranslateName(v.name):lower()})
else
if df.site_realization_building_info_hillock_housest:is_instance(oe.building_info) then
local Sitetype2={"shrugs","Civic Mound","Castle Mound","Drinking Mound"}
table.insert (Ark2,{" "..Sitetype2[oe.building_info.type+1].."/"..Sitetype[oe.type+1].." "..mapnotes1a.." "..mapnotes2a.." "..mapnotes3a.." "..mapnotes4a,nil,v,search_key = dfhack.TranslateName(v.name):lower()})
else if df.site_realization_building_info_tree_housest:is_instance(oe.building_info) then
local Sitetype2={"Treehouse","Home Tree","Shaping Tree","Market Tree","shrugs","Shrugs 2"}
table.insert (Ark2,{dfhack.TranslateName(oe.building_info.name).." "..Sitetype2[oe.building_info.type+1].."/"..Sitetype[oe.type+1].." "..mapnotes1a.." "..mapnotes2a.." "..mapnotes3a.." "..mapnotes4a,nil,v,search_key = dfhack.TranslateName(v.name):lower()})
end
end
end
end
end
local f=function(Name,C)
end
dlg.showListPrompt("Compass zoomed","here a list of local site realization around a 32 embark tile radius: min x max x , min y max y",COLOR_WHITE,Ark2,f,nil,nil,true)
end
end
justsummoning()

well this script took me way too long to finish, but here's a support script for nomad where you get a good idea of where most of the sites are around you while navigating in fort mode.
and an extra check the realization of a site feature so you could navigate inside a 17x17 site.
be it the script goes off x and y coords related to the distance from the player site's coords so the 4 corners of the game field are being tracked.
the script also explains the type of structures and sites in the area with the 'no name' ones being the ones with no additional building info.

edit: oh yeah made an army company version for tracking roaming armies surrounding the fort and updated the non army one for diving through sites that aren't a forest retreat, with bonus hilltop realization data.
Code: ("nomad-compass-army.lua") [Select]
local dlg=require("gui.dialogs")
--testing-for-map-charting-for-nomad
--ok so this script is made for the pile of nomad scripts to aid in finding 'realizations in the pre-gen sites' now for finding army groups
--this script may or may not show armies if you try to visit those locations
--this script is also built off the structure of an old just summon script.
function justsummoning()
local center = df.global.plotinfo.main.fortress_site
local Ark={}
local Radar= 32
for de,oe in pairs(df.global.world.army_controllers.all) do
if oe.mission_report == nil then else
for k,v in pairs(df.global.world.armies.all) do
local convert1= math.floor(v.pos.x/3)
local convert2= math.floor(v.pos.y/3)
if center.global_min_x - convert1 < Radar and  center.global_min_x - convert1 > -Radar and  center.global_max_x - convert1 < Radar and  center.global_max_x - convert1 > -Radar and center.global_min_y - convert2 < Radar and  center.global_min_y - convert2 > -Radar and  center.global_max_y - convert2 < Radar and center.global_max_y - convert2 > -Radar or  oe.id == v.controller_id then
local mapnotes1 = convert1 - center.global_min_x
local mapnotes2 = convert1 - center.global_max_x
local mapnotes3 = convert2 - center.global_min_y
local mapnotes4 = convert2 - center.global_max_y
local Sitetype={"Player Fort","Dark Fort","Cave","MountainHall","ForestRetreat","Town","Important Location","Lair/Shrine","MercFort","Camp","Monument"}
BoaName=dfhack.TranslateName(df.global.world.nemesis.all[v.members[0].nemesis_id].figure.name)
table.insert (Ark,{dfhack.TranslateName(df.global.world.nemesis.all[v.members[0].nemesis_id].figure.name).." number:".. (#v.members) .." Creature type:".. df.global.world.raws.creatures.all[df.global.world.nemesis.all[v.members[0].nemesis_id].figure.race].creature_id .." "..mapnotes1.." "..mapnotes2.." "..mapnotes3.." "..mapnotes4,nil,v,search_key = dfhack.TranslateName(df.global.world.nemesis.all[v.members[0].nemesis_id].figure.name):lower()})
end
end
end
end
local f=function(Name,C,center)
end
dlg.showListPrompt("Compass ","here a list of local armies around a 32 embark tile radius: min x max x , min y max y",COLOR_WHITE,Ark,f,nil,nil,true)
end
function justsummoning2(v,center)
local center = df.global.plotinfo.main.fortress_site
local Sitetype={"cottage plot","castle wall","castle tower","castle_courtyard","house","Temple","tomb","shop house","warehouse","market square","pasture","waste","courtyard","well","vault","great tower","trenches","tree house","hillock house","mead hall","fortress entrance","library","tavern","counting house","guild hall","city tower","shrine","shrugs","dormitory","dinging hall","Necro Tower"," barrow"}
local Ark2={}
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
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 regionmath1a=math.floor((v.global_min_x+regionx))
local regionmath2a=math.floor((v.global_max_x+regionx2))
local regionmath3a=math.floor((v.global_min_y+regiony))
local regionmath4a=math.floor((v.global_max_y+regiony2))
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))
local mapnotes1a = regionmath1a - center.global_min_x
local mapnotes2a = regionmath2a - center.global_max_x
local mapnotes3a = regionmath3a - center.global_min_y
local mapnotes4a = regionmath4a - center.global_max_y
if oe.building_info==nil then
table.insert (Ark2,{"no name".." "..Sitetype[oe.type+1].." "..mapnotes1a.." "..mapnotes2a.." "..mapnotes3a.." "..mapnotes4a,nil,v,search_key = dfhack.TranslateName(v.name):lower()})else
local Sitetype2={"Treehouse","Home Tree","Shaping Tree","Market Tree","shrugs","Shrugs 2"}
table.insert (Ark2,{dfhack.TranslateName(oe.building_info.name).." "..Sitetype2[oe.building_info.type+1].."/"..Sitetype[oe.type+1].." "..mapnotes1a.." "..mapnotes2a.." "..mapnotes3a.." "..mapnotes4a,nil,v,search_key = dfhack.TranslateName(v.name):lower()})
end
end
end
local f=function(Name,C)
end
dlg.showListPrompt("Compass zoomed","here a list of local site realization around a 32 embark tile radius: min x max x , min y max y",COLOR_WHITE,Ark2,f,nil,nil,true)
end
end
justsummoning()
« Last Edit: June 08, 2024, 11:32:29 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-r2.1
« Reply #3636 on: June 19, 2024, 09:10:22 pm »

DFHack 50.13-r3rc1 (beta) released!

Highlights: Designating digging and constructions with shapes, Interactive map editing, Quick find and zoom for people, locations, and artifacts, Controlling rate of immigration, Plant and tree manipulation, Locale-sensitive number formatting.

Get it from:

On Steam, this beta release is available on the DFHack beta channel (for DF 50.13) and the adventure-beta channel (for DF 51.01-beta).

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html
« Last Edit: June 19, 2024, 09:12:51 pm by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.13-r2.1
« Reply #3637 on: June 28, 2024, 05:00:13 pm »

DFHack 50.13-r3rc3 (beta) released!

Highlights: Fix FPS death with timestream, Trade depot pathability visualization for wagons.

Get it from:

On Steam, this beta release is available on the DFHack beta channel (for DF 50.13) and the adventure-beta channel (for DF 51.01-beta).

Manual installation instructions: https://docs.dfhack.org/en/stable/docs/Installing.html
« Last Edit: Today at 04:07:01 am by myk »
Logged
Pages: 1 ... 241 242 [243]