1. DFHack - Dwarf Fortress Modding Engine
  2. News

DFHack - Dwarf Fortress Modding Engine News

DFHack 50.09-r2rc1

New trade screens!!

The focus of this beta release is the trade workflow. There are two new DFHack screens to play with, one for selecting items to bring to the depot and one for selecting caravan and fort items for the actual trade transaction.

We need your feedback on these! Are they easy to use? Can you get all the items you want to the trade depot in a "reasonable" number of clicks? Are there more filters you'd like to see?

Note that while the "Bring goods to depot" screen is separate from the vanilla screen, the "Trade" screen can be used simultaneously with the vanilla interface. The checkboxes on the vanilla screen are updated "live" as you use the DFHack selection interface, and vice versa. Also, the vanilla screen trade summary at the bottom that shows whether the trader is likely to accept the deal is updated in realtime.

The DFHack "Bring goods to depot" screen is accessible by clicking on the text button that is just above the vanilla "Bring goods to depot" button (shown when you click on the trade depot). It also has the hotkey Ctrl-T

The DFHack trade screen is accessible from the vanilla trade screen, again by clicking on the text button on the right side of the screen or by pressing Ctrl-T.

Hopefully the screencaps attached to this post make everything clear. Suggestions for further usability improvements are always welcome!

Getting these screens done was truly a team effort, requiring significant reverse engineering for information on how export agreements affect price calculations, the logic behind export mandates, and the details regarding ethical trade restrictions, plus thousands of lines of business logic. Very heartfelt thanks to DFHack resident reverse engineers Quietust and ab9rf (rome of oxtrot), without whom none of this would have been possible!









System clipboard copy and paste

Now that DF is on SDL2, we get much better integration with operating system services. Edit fields, like the commandline text line in gui/launcher, now supports copy and paste. Ctrl-C to copy, Ctrl-X to cut, and Ctrl-V to paste. This means that you can find a sample commandline online, open up gui/launcher, and hit Ctrl-V to paste it in. No more manually copying it word by word!

We don't have a way to select ranges of text, so Ctrl-C will copy the entire line and Ctrl-X will cut the entire line. On the plus side, this means Ctrl-X is now a convenient way to clear any DFHack text field : )
Generated release notes
[h2]New Plugins[/h2]
  • 3dveins: reinstated for v50, this plugin replaces vanilla DF's blobby vein generation with veins that flow smoothly and naturally between z-levels
[h2]New Scripts[/h2]
  • caravan: new trade screen UI replacements for bringing goods to trade depot and trading
[h2]Fixes[/h2]
  • Fix extra keys appearing in DFHack text boxes when shift (or any other modifier) is released before the other key you were pressing
  • gui/autodump: when "include items claimed by jobs" is on, actually cancel the job so the item can be teleported
  • gui/gm-unit: fix commandline processing when a unit id is specified
  • suspendmanager: take in account already built blocking buildings
[h2]Misc Improvements[/h2]
  • widgets.EditField: DFHack edit fields now support cut/copy/paste with the system clipboard with Ctrl-X/Ctrl-C/Ctrl-V
[h2]API[/h2]
  • Items :: markForTrade(), Items :: isRequestedTradeGood(), Items :: getValue: see Lua notes below
  • Units :: getUnitByNobleRole, Units :: getUnitsByNobleRole: unit lookup API by role
[h2]Internals[/h2]
  • Price calculations fixed for many item types
[h2]Lua[/h2]
  • dfhack.items.getValue: gained optional caravan and caravan_buying parameters for prices that take trader races and agreements into account
  • dfhack.items.isRequestedTradeGood: discover whether an item is named in a trade agreement with an active caravan
  • dfhack.items.markForTrade: mark items for trade
  • dfhack.units.getUnitByNobleRole, dfhack.units.getUnitsByNobleRole: unit lookup API by role

DFHack 50.09-r1

This release is compatible with all distributions of Dwarf Fortress: Steam, Itch (note: as of this announcement, Bay12 has not yet updated their store on itch), and Classic.

Please report any issues (or feature requests) on the DFHack GitHub issue tracker. When reporting issues, please upload a zip file of your savegame and a zip file of your mods directory to the cloud and add links to the GitHub issue. Make sure your files are downloadable by "everyone with the link". We need your savegame to reproduce the problem and test the fix, and we need your active mods so we can load your savegame. Issues with savegames and mods attached get fixed first!
[h2]Announcements[/h2][h3]PSAs[/h3]
As always, remember that, just like the vanilla DF game, DFHack tools can also have bugs. It is a good idea to save often and keep backups of the forts that you care about.

Many DFHack tools that worked in previous (pre-Steam) versions of DF have not been updated yet and are marked with the "unavailable" tag in their docs. If you try to run them, they will show a warning and exit immediately. You can run the command again to override the warning (though of course the tools may not work). We make no guarantees of reliability for the tools that are marked as "unavailable".

The in-game interface for running DFHack commands (gui/launcher) will not show "unavailable" tools by default. You can still run them if you know their names, or you can turn on dev mode by hitting Ctrl-D while in gui/launcher and they will be added to the autocomplete list. Some tools do not compile yet and are not available at all, even when in dev mode.

If you see a tool complaining about the lack of a cursor, know that it's referring to the keyboard cursor (which used to be the only real option in Dwarf Fortress). You can enable the keyboard cursor by entering mining mode or selecting the dump/forbid tool and hitting Alt-K (the DFHack keybinding for toggle-kbd-cursor. We're working on making DFHack tools more mouse-aware and accessible so this step isn't necessary in the future.

[h2]Highlights[/h2]
Most changes in this release have to do with migrating to SDL2 and are not visible to the player.

Generated release notes
[h2]Misc Improvements[/h2]
  • `caravan`: new overlay for selecting all/none on trade request screen
  • `suspendmanager`: don't suspend constructions that are built over open space
[h2]Structures[/h2]
  • ``tiletype_shape``: changed RAMP_TOP and ENDLESS_PIT to not walkable to reflect how scripts actually need these types to be treated

DFHack 50.09sdl2-3-rc1

This release is identical to DFHack 50.09sdl2-2-rc1 except for compatibility with DF 50.09sdl2-3.
Please see https://steamcommunity.com/games/2346660/announcements/detail/3681177834687015555 for additional details.

As with the previous experimental release, if you have trouble typing symbols into DFHack text boxes, please reset your DF keybindings to defaults and try again. This is due to changes in how the new version of DF interprets keyboard input.

DFHack 50.09sdl2-2-rc1

Feature set is identical to DFHack 50.08-r4. Please see https://steamcommunity.com/games/2346660/announcements/detail/3681177834687015555 for details.

If you have trouble typing symbols into DFHack text boxes, please reset your DF keybindings to defaults and try again. This is due to changes in how the new version of DF interprets keyboard input.

DFHack 50.08-r4

This release is compatible with all distributions of Dwarf Fortress: Steam, Itch, and Classic.

Please report any issues (or feature requests) on the DFHack GitHub issue tracker. When reporting issues, please upload a zip file of your savegame and a zip file of your mods directory to the cloud and add links to the GitHub issue. Make sure your files are downloadable by "everyone with the link". We need your savegame to reproduce the problem and test the fix, and we need your active mods so we can load your savegame. Issues with savegames and mods attached get fixed first!
[h2]Announcements[/h2][h3]PSAs[/h3]
As always, remember that, just like the vanilla DF game, DFHack tools can also have bugs. It is a good idea to save often and keep backups of the forts that you care about.

Many DFHack tools that worked in previous (pre-Steam) versions of DF have not been updated yet and are marked with the "unavailable" tag in their docs. If you try to run them, they will show a warning and exit immediately. You can run the command again to override the warning (though of course the tools may not work). We make no guarantees of reliability for the tools that are marked as "unavailable".

The in-game interface for running DFHack commands (gui/launcher) will not show "unavailable" tools by default. You can still run them if you know their names, or you can turn on dev mode by hitting Ctrl-D while in gui/launcher and they will be added to the autocomplete list. Some tools do not compile yet and are not available at all, even when in dev mode.

If you see a tool complaining about the lack of a cursor, know that it's referring to the keyboard cursor (which used to be the only real option in Dwarf Fortress). You can enable the keyboard cursor by entering mining mode or selecting the dump/forbid tool and hitting Alt-K (the DFHack keybinding for toggle-kbd-cursor. We're working on making DFHack tools more mouse-aware and accessible so this step isn't necessary in the future.
[h2]Highlights[/h2][h3]logistics[/h3]



When you select a stockpile, you'll now see a panel that will let you toggle its automation features. Items and animals brought to that stockpile can be automatically marked for melting, trading, dumping, and/or training.

For example, you can set up cage traps for catching wild game. When you catch something, your dwarves will bring the caged animal to your Animals stockpile. If you enable automatic training on that stockpile, the animals will automatically get a trainer assigned to them. Combine this with autobutcher, which can mark the trained animals for butchering, and you now have a low-toil food supply chain for your kitchens!

Similarly, if you enable automatic trading for your trade goods stockpile, all items in the stockpile will be marked for trading and automatically brought to the trade depot when a merchant caravan arrives.
[h3]Dreamfort[/h3]



Dreamfort is the result of over a decade of experimentation and revision from some of Dwarf Fortress's most experienced players. It is a fully functional, pre-designed fortress you can build yourself from gui/quickfort blueprints. If you're having trouble with getting your forts to work smoothly, try building Dreamfort. The blueprints walk you through the process of creating the fortress so you can learn from its design, progression, and configuration. You can even reuse individual blueprints for the parts you especially like to extend your own designs.

The Dreamfort walkthroughs and blueprints bring you from embark all the way through to a 200-strong mountainhome. Screenshots for all the levels and links to more information here: https://docs.dfhack.org/en/stable/docs/guides/quickfort-library-guide.html#dreamfort.

If you want to explore it interactively, you can download a pre-built Dreamfort from DFFD: https://dffd.bay12games.com/file.php?id=15434.
[h3]suspendmanager[/h3]



Logic for when to suspend building jobs has been upgraded. Now suspendmanager is much smarter when you're building in areas with limited access paths. For example, if you fill a corridor or build a high wall, it will now correctly realize that a wall tile can block access to a another tile farther away.

Moreover, suspendmanager now also considers smoothing and engraving jobs. For example, if you attempt to build a statue on top of flooring that is designated for smoothing, it will now allow the smoothing job to be completed first before the statue blocks it.
Generated release notes
[h2]New Plugins[/h2]
  • logistics: automatically mark and route items or animals that come to monitored stockpiles. options are toggleable on an overlay that comes up when you have a stockpile selected.
[h2]Fixes[/h2]
  • buildingplan: don't include artifacts when max quality is masterful
  • dig-now: clear item occupancy flags for channeled tiles that had items on them
  • emigration: reassign home site for emigrating units so they don't just come right back to the fort
  • gui/create-item: allow blocks to be made out of wood when using the restrictive filters
  • gui/liquids: ensure tile temperature is set correctly when painting water or magma
  • gui/quickfort:
    • allow traffic designations to be applied over buildings
    • protect against meta blueprints recursing infinitely if they include themselves
  • gui/sandbox: allow creatures that have separate caste-based graphics to be spawned (like ewes/rams)
  • RemoteFortressReader: fix a crash with engravings with undefined images
  • workorder: prevent autoMilkCreature from over-counting milkable animals, which was leading to cancellation spam for the MilkCreature job
[h2]Misc Improvements[/h2]
  • Blueprint library:
    • dreamfort: full rewrite and update for DF v50
    • pump_stack: updated walkthrough and separated dig and channel steps so boulders can be cleared
    • aquifer_tap: updated walkthrough
  • autonick: additional nicknames based on burrowing animals, colours, gems, and minerals
  • combine: reduce max different stacks in containers to 30 to prevent contaners from getting overfull
  • dig-now: can now handle digging obsidian that has been formed from magma and water
  • gui/autodump: add option to clear the trader flag from teleported items, allowing you to reclaim items dropped by merchants
  • gui/control-panel:
    • add some popular startup configuration commands for autobutcher and autofarm
    • add option for running fix/blood-del on new forts (enabled by default)
  • gui/quickfort:
    • adapt "cursor lock" to mouse controls so it's easier to see the full preview for multi-level blueprints before you apply them
    • only display post-blueprint messages once when repeating the blueprint up or down z-levels
  • gui/sandbox: when creating citizens, give them names appropriate for their races
  • orders:
    • only display import/export/sort/clear panel on main orders screen
    • refine order conditions for library orders to reduce cancellation spam
  • prioritize: add wild animal management tasks and lever pulling to the default list of prioritized job types
  • quickfort: significant rewrite for DF v50! now handles zones, locations, stockpile configuration, hauling routes, and more
  • stockpiles: added barrels, organic, artifacts, and masterworks stockpile presets
  • suspendmanager:
    • now suspends construction jobs on top of floor designations, protecting the designations from being erased
    • suspend blocking jobs when building high walls or filling corridors
  • workorder: reduce existing orders for automatic shearing and milking jobs when animals are no longer available
[h2]Removed[/h2]
  • gui/automelt: replaced by an overlay panel that appears when you click on a stockpile
[h2]Structures[/h2]
  • abstract_building_libraryst: initialize unknown variables as DF does
  • misc_trait_type: realign
[h2]Documentation[/h2]
  • blueprint-library-guide: update Dreamfort screenshots and links, add aquifer_tap screenshot