Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 235 236 [237] 238 239 ... 243

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

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.10-r1 (with Linux support)
« Reply #3540 on: September 23, 2023, 12:34:58 pm »

EDIT: Ah goddamit, I'm probably looking at upgrading my distro to the next major version. Because apparently manually forcing an update to glibc is a sure-fire way to experience Fun in the DF sense of the word on Linux.
It's not that old, DF should have been built using an older version.

Yeah, we're working with Bay 12 to standardize on a more widely compatible build environment. It's not as easy as just switching build systems, though, since DF actually *uses* functionality only available in more recent versions of glibc and the c++ standard library.

I had trouble with running a modtools command. Can you apply one in the tutorial?
any script can be run with the dfhack.run_script() command, modtools or otherwise (see https://docs.dfhack.org/en/latest/docs/dev/Lua%20API.html#general-script-api). Which one were you having trouble running? Does the script have the "unavailable" tag (https://docs.dfhack.org/en/stable/unavailable-tag-index.html#cap-m )? If so, it hasn't been updated yet and you can't expect it to work.

Quote
I missed the definition of the variable modId in the final example.
It's just a string that's set to the name of your mod. There are a few examples of the variable being set in the modding guide. Ctrl-F for "modid".

Quote
de mod deactivates by closing the game, but doesnt reactivatie. Id like to have my script always active, if my main mod is loaded .
This is what the onStateChange handler is for in https://docs.dfhack.org/en/stable/docs/guides/modding-guide.html#putting-it-all-together
There's more information about this mechanism here: https://docs.dfhack.org/en/latest/docs/dev/Lua%20API.html#enabling-and-disabling-scripts
Logged

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: DFHack 50.10-r1 (with Linux support)
« Reply #3541 on: September 25, 2023, 06:21:22 pm »

I guess it does not work without dfhack either (GLIBC_2.34 is required by dwarfort, not only libdfhack.so). According to distrowatch, Linux Mint 21.2 Victoria (released two month ago) has glibc 2.35. I guess you have Linux Mint 20.3 Una from 2022, it only has glibc 2.31. It's not that old, DF should have been built using an older version.

Edit: Ubuntu 20.04 uses glibc 2.31, so it is older than 2022. Still, it should be the best target version.
if i understand what i've heard correctly, the dwarf fortress linux builds were built using Ubuntu 22.04, so you need to be at least as new as Ubuntu 22.04 to ride this particular ride.

the problem with using, e.g. Ubuntu 20.04 for doing builds is that the gcc in that release is too old to compile Dwarf Fortress. DF uses C++17 and C++20 (and even C++23, but only on Windows at present) features that are not implemented in the version of gcc that ships with Ubuntu 20.04 LTS. from my understanding, there simply isn't a gcc release that both supports the C++ features that DF uses and is also compatible with any glibc older than 2.34. last i heard there was some experimentation around using clang, but that too was not conclusive
« Last Edit: September 25, 2023, 06:26:51 pm by ab9rf »
Logged

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 50.10-r1 (with Linux support)
« Reply #3542 on: September 26, 2023, 11:02:59 am »

Using flatpak runtime 22.08 can be solution for older distributions. I managed to run DF+DFHack on Linux Mint 20.3 (in a vm) with it.

Spoiler: How to (click to show/hide)

There are issues with flatpak though: since DF is no longer redistributable, I cannot share the built package, and the lack of support for XDG directories make it require some tricks to work (and I may be missing some writable directories, I did not do much testing).
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.10-r1 (with Linux support)
« Reply #3543 on: October 03, 2023, 12:09:10 pm »

DFHack 50.11-r1 released!

Full support for all 50.11 releases, including Linux.

Get it from:

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

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r1 | 50.11-r2rc1 (pre-release)
« Reply #3544 on: October 12, 2023, 03:41:56 pm »

DFHack 50.11-r2rc1 released!

Full support for all 50.11 releases. Highlight: Search! Search! Search!

Get it from:

Full installation instructions: https://docs.dfhack.org/en/latest/docs/Installing.html
« Last Edit: October 13, 2023, 02:10:20 am by myk »
Logged

Crystalizedmire

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r1 | 50.11-r2rc1 (pre-release)
« Reply #3545 on: October 18, 2023, 02:57:53 pm »

Is there any way of using DFHack to turn my dwarves into vampires?
Logged
she/her

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r1 | 50.11-r2rc1 (pre-release)
« Reply #3546 on: October 18, 2023, 03:40:50 pm »

Since vampire curses are generated anew with each world, the process for making a unit a vampire is not as straightforward as it could be. It helps a great deal if you already have a vampire accessible that you can examine. Then you can:
1. use gui/unit-syndromes to examine the vampire and take note of the syndrome ID that unit is afflicted with
2. use modtools/add-syndrome to apply that syndrome to the unit of your choice

If you don't have a vampire unit yet, maybe save your game, run migrants-now until you get a migrant vampire (use cursecheck to identify them), examine them with gui/unit-syndromes to get the syndrome ID, then load back your original save and modify your other unit.

docs are here: https://docs.dfhack.org/en/stable/docs/tools/modtools/add-syndrome.html#modtools-add-syndrome
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r1 | 50.11-r2rc1 (pre-release)
« Reply #3547 on: October 19, 2023, 10:06:55 am »

DFHack 50.11-r2 released!

Full support for all DF 50.11 releases.

Highlights: Search! Search! Search!, Preserve tomb assignments, Collapse all for stocks screen, Automatic tomb zones, Stranded citizen alert

Get it from:

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

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 50.11-r1 | 50.11-r2rc1 (pre-release)
« Reply #3548 on: October 19, 2023, 07:15:27 pm »

If you don't have a vampire unit yet, maybe save your game, run migrants-now until you get a migrant vampire (use cursecheck to identify them), examine them with gui/unit-syndromes to get the syndrome ID, then load back your original save and modify your other unit.

This will print the IDs of all vampire syndromes in the world:
Code: [Select]
:lua for k,v in ipairs(world.raws.syndromes.all) do for a,b in ipairs(v.ce) do if df.creature_interaction_effect_add_simple_flagst:is_instance(b) and b.tags1.BLOODSUCKER then print(k) end end end
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r2
« Reply #3549 on: October 19, 2023, 07:58:39 pm »

Oh nice, I could integrate that into `gui/sandbox` so you can spawn vampire/necromancer/whatever units directly.
Logged

yamster

  • Escaped Lunatic
    • View Profile
Re: DFHack 50.11-r2
« Reply #3550 on: October 22, 2023, 12:57:57 am »

Is there a way to use spawn cut gems or polished stones in a specific design?
Logged

Rumrusher

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

joostheger

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r2
« Reply #3552 on: October 25, 2023, 01:48:51 pm »

Question:

where can i find the content of some enums of df-structures, like:
unit_labor
entity_position_responsibility

which are which.
wiki doesnt seem to be complete, because dfstructures mentions 94 labors, but wiki mentions 80
Logged

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r2
« Reply #3553 on: October 25, 2023, 02:03:41 pm »

Use the search function on github, or download it and search locally. Some unit_labor values are unused.

unit_labor
entity_position_responsibility
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 50.11-r2
« Reply #3554 on: October 25, 2023, 02:19:24 pm »

You can also list them in-game. For example, open gui/launcher and run:

Code: [Select]
:lua @df.unit_labor
Logged
Pages: 1 ... 235 236 [237] 238 239 ... 243