Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 210 211 [212] 213 214 ... 242

Author Topic: DFHack 50.12-r3  (Read 806459 times)

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r4
« Reply #3165 on: May 01, 2022, 04:10:26 am »

GitHub did drop password-based auth over HTTPS within the past year (you have to use a token or an alternative to push now) - I'm assuming that's what Bumber is referring to. They also dropped the git:// protocol more recently.

I definitely want to keep HTTPS as the default in Compile.rst for the reasons Myk said - for read-only access, it is the simplest and does not require extra setup steps. If you'd like to update Contributing.rst with instructions on switching to SSH (maybe references to existing GitHub docs?), that would be welcomed.

Looks like the easiest way is just to create a PAT and use that instead of your password when pushing:
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

This doesn't require switching from https.

The relevant documents for SSH are:
https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Those show how to use set-url to switch the remote to SSH, generate the key, and use ssh-agent to tie your key to a passphrase.
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 0.47.05-r4
« Reply #3166 on: May 04, 2022, 11:33:22 pm »

DFHack 0.47.05-r5 released!

This release brings improvements to autofarm, quickfort, autochop, autonick, blueprint, and others. There are also many new widgets available for Lua GUI script writers.

Modders! This release includes custom-raw-tokens: a brand new library for reading mod-added tags in the raws. This allows you to write scripts that modify the game when tagged items are used.

Binaries available on the release page

Changelog:
Spoiler (click to show/hide)
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3167 on: May 22, 2022, 04:01:46 pm »



don't know why I never tested adding a view to the game but yeah
I think this mini script probably decent enough of a step to get to switching between fort mode and adventure mode.
 and possibly bringing back the old dfhack fort retire, and uhhh give players the means to quicksave in adventure mode.

ok so as I was writing this I got hit with two issues, one being if fort mode side ever unpause you will auto ruin the run which will end the run which could be fixed with a test to see if fort mode is unpaused then re-pausing it.
and if you made a quicksave you pretty much have to do a manual save after that to clean the save state or the game will crash if you try to fast travel.

Code: ("Adv2Fortswap.lua") [Select]
if  dfhack.world.isFortressMode() then
df.global.gview.view.child=df.viewscreen_dungeonmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
df.global.gamemode=1
df.global.gametype=1
else
df.global.gview.view.child=df.viewscreen_dwarfmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
df.global.gamemode=0
df.global.gametype=0
end

so here's the code beware this could lead to some other unstable stuff down the road I haven't tested or found but I think for a fort mode player perspective this should let one just jump into playing anyone if you set the unit up as an adventurer or well unit active 0



edit: additional quick test to see how well switching between adv mode and fort mode goes.

extremely experimental adv mode quicksave test which requires use of the previous script to fix the autosaves when you reload.
Code: ("advquicksave.lua") [Select]
-- Makes the game immediately save the state.
--[====[

Adv quicksave
=========
If called in adv mode, makes DF immediately switches to fort mode then saves the game by setting a flag
normally used in seasonal auto-save. then switches back to adv mode big warning the saves that are backup are set to fort mode so probably best run say a mode set script to switch back to adv mode then save the game again as last I check that seems to fix one crash after switching back to adv mode and fast traveling a bit.

]====]

local gui = require("gui")

--luacheck: defclass={run:bool}
QuicksaveOverlay = defclass(QuicksaveOverlay, gui.Screen)

function QuicksaveOverlay:render()
    if not self.run then
        self.run = true
        save()
        self:renderParent()
        self:dismiss()
    end
end

if not dfhack.isMapLoaded() then
    qerror("World and map aren't loaded.")
end
function adv2fort ()
if  dfhack.world.isFortressMode() then
df.global.gview.view.child=df.viewscreen_dungeonmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
df.global.gamemode=1
df.global.gametype=1
else
df.global.gview.view.child=df.viewscreen_dwarfmodest:new()
df.global.gview.view.child.parent=df.global.gview.view
df.global.gamemode=0
df.global.gametype=0
end
end
if not dfhack.world.isFortressMode() then
adv2fort()
end

local ui_main = df.global.ui.main
local flags4 = df.global.d_init.flags4


local function restore_autobackup()
    if ui_main.autosave_request and dfhack.isMapLoaded() then
        dfhack.timeout(10, 'frames', restore_autobackup)
    else
        flags4.AUTOBACKUP = true
    end

end

function save()
    -- Request auto-save
    ui_main.autosave_request = true

    -- And since it will overwrite the backup, disable it temporarily
    if flags4.AUTOBACKUP then
        flags4.AUTOBACKUP = false
        restore_autobackup()
    end

    print 'The game should save the state now.'
end

QuicksaveOverlay():show()
dfhack.timeout(10, 'frames',adv2fort)


edit: ok so went and fix some issues that came up with this script mostly the fort mode side tends to break if you attempt to zoom on a unit, and the solution was I was missing the parent section on the viewscreen open legends had this solved since 2015 and I should have scan that lua script for tips.
so this should probably work for fort mode players who want to switch from fort mode to adv mode then back to fort mode if they don't leave the fort site and also if they assign an unit on field as an adventurer.

there's a tofort script warmist made that would benefit on this update but like I'm currently checking that one out and seeing if there's any more unforeseen errors that comes from using that and making minor tweaks.

oh while I'm here I should probably post the script I use to clear designation spam from using these scripts
Code: ("select-map.lua") [Select]
df.global.ui.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=-1430
df.global.selection_rect.end_y=900
df.global.selection_rect.end_z=0
df.global.cursor.x=400
df.global.cursor.y=400
df.global.cursor.z=0

this script should select the entire map and let you clear designations with little scrolling as possible... though this will clear previously set designations so probably best to use this for returning to a fort after finishing up or making an adv closet to shove the adv in, to make the designation spam that would pop up from the adventurer's field of view be smaller to deal with and not lead to the entire fort digging up the place.

edit: ok so went back and updated the clear designation script to include the script selecting the clear designation menu so all you need to do is just hit enter after running the script... but also click on the header of the window of DF as any mouse support will mess with the cursor placement.

also here's the current attempt at modifying warmist's tofort script with viewscreen switching here
should be warned it's unstable to a degree so far in my testing it's possible to at least build on just about any site and any scripts that un-residents the whole town would be advised to be used.

like this one
Code: [Select]
function DeresidentCiv(unit,trgunit)
local adv=df.global.world.units.active[0].civ_id
for k,v in pairs(df.global.world.units.active) do
if v.civ_id==adv then

if v== nil then
error("Invalid creature")
end
v.flags2.resident=false
end
end
return true
end
edit edit: ok so I ended up making two different versions of warmist's tofort(well 8ish this one is 6.0) and this one has the accidental mechanic of letting you keep access to your fort's military and squad while you explore the world in adv mode and switch back into fort mode, setting up means to do Squad level attack commands if you brought along your fort military on the trip or lets you enlist folks on site and command them to fight.

this is still a work in progress as it's potential to say lose progress or crash, or accidentally maroon your citizens in locations.
edit: ok so after some time I think I got most of my concerns with switching between fort mode and adv mode and now probably don't need to run a bunch of extra scripts after running the modified tofort script warmist made
which I updated and added under the title tofort7.lua so all you really need is for going from fort mode to adv mode is that you assign an adventurer first using any bodyswap script.

edit: ok so uhh went and added another additional tofort modification called tofort8.
« Last Edit: June 20, 2022, 12:06:51 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 0.47.05-r5
« Reply #3168 on: May 23, 2022, 08:31:28 pm »

Just a public service announcement, we're planning on turning down Ruby support within the next few DFHack releases. If you don't know what this means, then it probably won't affect you at all, and you don't need to worry about it and you can stop reading now : )

For those of you still reading, here's the longer explanation. There are currently two scripting languages supported by DFHack: Lua and Ruby. Lua is (by a large margin) the better supported of the two languages. Most of DFHack's scripts are written in Lua. Some developers have preferred writing scripts in Ruby, and there was enough support for Ruby scripts to modify DF game state and call a subset of the DFHack API. However, the Ruby runtime has become very difficult to maintain and is causing compatibility issues on some systems. The plan is:
1) rewrite DFHack's Ruby scripts in Lua (commands you run on the DFHack prompt won't change)
2) print a warning if a Ruby script is run
3) sometime in the future, remove the Ruby plugin entirely

The warning in (2) should only ever be seen by players who have written their own ruby scripts. We'll keep the warning in place for a while, hopefully giving those players enough time to migrate their scripts to Lua.

If you have any strong objections to this plan, please make your voice heard here or on the GitHub issue.
Logged

catagris

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3169 on: May 27, 2022, 12:18:49 am »

I am running into an issue, when I run the command ./dfhack I get the error:
Code: [Select]
env: ‘./libs/Dwarf_Fortress’: No such file or directory
The install directory is
Code: [Select]
/usr/share/games/dwarf-fortress/gamedata
My GCC version is
Code: [Select]
gcc (Debian 10.2.1-6) 10.2.1 20210110
I installed dfhack version
Code: [Select]
dfhack-0.47.05-r5-Linux-64bit-gcc-7.tar.bz2
Thank you for any help
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3170 on: May 27, 2022, 01:21:44 am »

This sounds like a symlink problem. In the directory where you run ./dfhack, what is the output of

ls -l . ./libs

? Are there symlinks that point to non-existent directories?
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3171 on: May 27, 2022, 04:02:12 am »

The install directory is
Code: [Select]
/usr/share/games/dwarf-fortress/gamedata
I installed dfhack version
Code: [Select]
dfhack-0.47.05-r5-Linux-64bit-gcc-7.tar.bz2
You can't install DFHack directly onto the Debian DF packages - those packages change the locations of DF's files in ways that DFHack can't find them.

If you want to use DFHack on Debian, you either need to do a manual install of DF in your home and install/run DFHack on that, or find or create a DFHack deb package that somehow accounts for where the DF deb package put the DF files. For example, the experimental DF deb package puts the missing file in /usr/lib/games/dwarf-fortress/libs/Dwarf_Fortress, and that /usr/games/dwarf-fortress is probably a script that creates a folder in your home that mimics the default DF folder layout so that DF can find it's files.

Edit: Or use the LinuxDwarfPack release deb package instead - though that's a bit behind, you can find more recent versions here.
« Last Edit: May 27, 2022, 04:16:21 am by Ziusudra »
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.

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3172 on: June 08, 2022, 03:10:25 am »

The recent FotF talk about keyboard and mouse support (especially, iirc, about the possibility of removing the ability to move the cursor with the keyboard) has got me wondering…

How will DFHack be affected by the Steam release?
Logged
Really hoping somebody puts this in their signature.

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3173 on: June 08, 2022, 10:25:08 am »

It's certainly been on my mind. Most viewscreens will have to be re-reverse engineered. A lot of code interacts with the input system, intercepting keys or feeding keys into the UI. Depending on how the input system is changing, that might all have to get adapted.

Quickfort should work fine for #dig, #build, and #zone blueprints since they modify memory structures directly. #query and #config blueprints do actually send keystrokes, so that might need rework. #place blueprints have a hybrid approach (memory is modified directly to create the stockpiles, but they are configured via the UI), so they'll need some thought too.

We did spend some time preparing for potential toolchain changes (e.g. compiler version), but Toady confirmed that no toolchain changes are planned for the steam release. That will help things go a little faster (if it remains true) since memory layouts are unlikely to change for existing structures.

The short of it is that we won't really know what we have to do until we get our hands on a release binary. I do expect a lot of work verifying the functionality of each and every plugin and script. If functionality is broken in ways that are not easy to fix, we might do a limited release that only includes stuff that works, adding elements back to the release as we adapt them.

In preparation, I've started writing more integration tests for scripts. That will help cut down on the manual testing required. If we do limited releases, the scripts with integration tests will likely get released first since we can be more confident that they will *keep* working as we make other internal changes.
« Last Edit: June 08, 2022, 10:33:49 am by myk »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3174 on: June 08, 2022, 09:35:00 pm »

ok so poking around with the switching between adv mode and fort mode script warmist made years ago, and stumble upon some weird quirk from not filling out the ui.main.fortress_entity and ui.main.fortress_site data.

mostly that if those are still connected to the previous fort site this will connect to the squads and military and nobles from that site.
also the civ id, site id, group id mostly controls who you control on the current site.
so technically it's possible to dfhack switch between groups of different civilians from different civ ids then control them in fort mode.
but also assign them to the military and add them to the main civ that's off site... or assign them to the noble position off site.

though it does feel a bit bittersweet given if I knew about this sooner I could have been interweaving fort mode and adv mode together with dfhack back when warmist originally made the tofort script.

but other than wishful thinking of the past, I ended up tweaking it so the script will check to see if you're on the correct site and assign the correct fortress entity and fortress site to fort mode.
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 0.47.05-r5
« Reply #3175 on: June 08, 2022, 10:45:30 pm »

The recent FotF talk about keyboard and mouse support (especially, iirc, about the possibility of removing the ability to move the cursor with the keyboard) has got me wondering…

How will DFHack be affected by the Steam release?
If the initial release is Windows-only, that will significantly slow development. We may not be able to make much progress at all until there are releases for other platforms because a lot of us are using Linux, and most of our CI only runs in Linux too.

There was a suggestion that came up on Discord within hours of the FotF post about re-adding the keyboard cursor with a plugin. I think it would be doable - we effectively already support the opposite of this with mousequery. Any tools that rely on the existing keyboard cursor for user input (gui/liquids, gui/teleport, etc.) will probably need to be adjusted to work with the mouse and/or a keyboard cursor plugin.
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.

Quarque

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3176 on: June 11, 2022, 07:46:45 am »

Is this the right place to report a bug in the eventful module? If you use the registerReaction(reaction_name,callback) to modify a reaction, it seems that the callback function never receives the 7th argument (call_native).

Can be reproduced with the following script, that should make brewing require water:

Spoiler (click to show/hide)
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3177 on: June 11, 2022, 09:34:50 am »

Thanks for bringing this to our attention! It's best to report issues like this on the issue tracker so we can assign someone to look into it. That way, you'll also get notified when the issue is fixed!

(Btw I looked at the code, and you're absolutely right. The parameter just isn't being passed)

Actually actually, there are two callbacks, onReactionCompleting, which passes call_native, and onReactionComplete, which does not (because by the time that event fires, the native callback has already been called). Iow, I'll look into this more. It might be a documentation issue.
« Last Edit: June 11, 2022, 10:09:42 am by myk »
Logged

Quarque

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3178 on: June 11, 2022, 10:03:12 am »

Thank you for checking so quickly! I will report the issue on the tracker.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r5
« Reply #3179 on: June 14, 2022, 01:01:45 pm »

ok wrote a script that grabs the squad members from your fort and plops them into your adv mode session
though after running into a bunch of roadblocks the rough coding only checks for the df.global.ui.squad data than say scanning through squads and checking his figs being tied to the adventurer.
so the use of this script is for mainly for grabbing an militia commander adventurer and enlisting folks into your fort's military then summoning them to your location, and making it so your fort's militia could show up and be used when you switch over to fort mode with the previously posted modified tofort scripts which sets up doing site invasions.

Code: [Select]
function SummonSquad()
for ks,vs in pairs(df.global.world.armies.all) do
if vs.flags[0]== true  then
if df.global.ui.squads.list~=nil then
for li2,nk2 in pairs (df.global.ui.squads.list) do
for li3,nk3 in pairs (nk2.positions) do
Awombo=df.global.world.nemesis.all[vs.members[0].nemesis_id].figure
if nk3.occupant~=-1 or nk3.occupant==Awombo.id then
wombo=df.global.world.history.figures[nk3.occupant].nemesis_id
Awombo=df.global.world.history.figures[nk3.occupant].nemesis_id
vs.members:insert("#",{new=true,nemesis_id=wombo})
end
end
end
end
end
end
end

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 ... 210 211 [212] 213 214 ... 242