v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Utility:DFHack

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 4: Line 4:
 
| image = File:Dfhack-logo.png
 
| image = File:Dfhack-logo.png
 
| misc  =
 
| misc  =
* [https://store.steampowered.com/app/2346660/DFHack__Dwarf_Fortress_Modding_Engine/ Steam Store Page]
 
 
* [https://github.com/DFHack/dfhack/releases Download]  
 
* [https://github.com/DFHack/dfhack/releases Download]  
 
* [https://docs.dfhack.org/en/stable/docs/Installing.html#installing Installation guide]
 
* [https://docs.dfhack.org/en/stable/docs/Installing.html#installing Installation guide]
* [https://docs.dfhack.org/en/stable/index.html Documentation]
+
* [https://docs.dfhack.org/en/stable/index.html DFHack's Documentation]
* [https://docs.dfhack.org/en/stable/docs/Introduction.html#support Support channels], including [https://dfhack.org/discord Discord]
 
 
}}
 
}}
[[File:Dfhack_gui_launcher.png|thumb|300px|right|DFHack in-game help browser and command launcher]]
+
[[File:dfhack_cmd.png|thumb|300px|right|Command ready!]]
'''DFHack''' is a [[utility]] that can be used to improve UI, automate some aspects of the game, add features, fix bugs, make a specific one-off change... or just straight-up [[cheat]] - though DFHack's cheat (''aka "Armok"'') tools can be hidden from the interface by enabling "mortal mode" in the DFHack [https://docs.dfhack.org/en/stable/docs/tools/gui/control-panel.html#gui-control-panel control panel].
+
'''DFHack''' is a [[utility]] that can be used to improve UI, automate some aspects of the game, add features, fix bugs, or make a specific one-off change.
  
DFHack is an extensive standardized memory access library, packaged alongside a suite of basic tools that use it. Currently, tools come in the form of plugins, as well as Lua scripts. For developers and modders, DFHack is a comprehensive, standardized memory access package that unites the various ways tools access the ''Dwarf Fortress'' memory space, allowing for easier development of new tools and a vast expansion of capabilities for mods. For players, it is a very useful utility complex that allows tweaking DF in numerous ways. This is probably one of the most useful utilities for DF, acting as an advanced expansion that fixes, improves and adds to the game in many ways, and is recommended for all players.
+
DFHack is an extensive standardized memory access library, packaged alongside a suite of basic tools that use it. Currently, tools come in the form of plugins, as well as Lua and Ruby scripts. For developers, DFHack is a comprehensive, standardized memory access package that unites the various ways tools access the ''Dwarf Fortress'' memory space, allowing for easier development of new tools. For users, it is a very useful utility complex that allows users to tweak their games in numerous ways in-game. This is probably one of the most useful utilities for DF, acting as an advanced expansion that fixes, improves and adds to the game in many ways, and is usually included in recent versions of the [[Utility:Lazy Newb Pack|Lazy Newb Pack]] on all platforms.
  
On April 14, 2023, DFHack was additionally [https://store.steampowered.com/app/2346660/DFHack__Dwarf_Fortress_Modding_Engine/ made available on Steam]. Installing DFHack through Steam will add DFHack to an existing Steam installation of ''Dwarf Fortress''.
+
== Download and Install==
 +
All new releases are announced in a [http://www.bay12forums.com/smf/index.php?topic=164123.0 thread on the Bay12 forums]. Downloads for all releases can be found on [https://github.com/dfhack/dfhack/releases GitHub], and the latest dev build can be found [https://dfhack.org/builds/ here], though its stability is not guaranteed. DFHack is currently available as a stable release for 0.47.05. Stable releases are also available for 0.42.06, 0.40.24, 0.34.11, 0.31.25, and other intermediate versions of DF. DFHack is currently also being ported to versions 0.28.181.40d and 0.23.130.23a - more information can be found [[User:Quietust#DFHack-40d|here]] and [[User:Quietust#DFHack-23a|here]], respectively. For an exhaustive list of and manual on the commands in the utility, see the [https://dfhack.readthedocs.org/en/stable/#user-manual documentation]. This wiki also has a [[Utility:DFHack/Programming|DFHack programming page]].
  
== Download and Install ==
+
* [https://github.com/DFHack/dfhack/releases Downlead] ● [https://docs.dfhack.org/en/stable/docs/Installing.html#installing Installation guide] ● [https://docs.dfhack.org/en/stable/index.html DFHack's documentation]
All new releases are announced on [https://store.steampowered.com/news/app/2346660 Steam], in a [http://www.bay12forums.com/smf/index.php?topic=164123.0 thread on the Bay12 forums], on [https://www.reddit.com/r/dwarffortress/ r/dwarffortress], and on the [https://dfhack.org/discord DFHack] and [https://discord.gg/kitfoxgames Kitfox] Discord servers. The current release can be downloaded from [https://store.steampowered.com/app/2346660/DFHack Steam] or [https://github.com/dfhack/dfhack/releases GitHub]. You can also find all past releases on GitHub, and the latest dev build (requires GitHub login) can be downloaded from [https://github.com/DFHack/dfhack/actions/workflows/build.yml?query=branch%3Adevelop+event%3Apush here], though its stability is not guaranteed.
 
 
 
Stable releases are also available for 0.47.05, 0.42.06, 0.40.24, 0.34.11, 0.31.25, and other intermediate versions of DF. DFHack is currently also being ported to versions 0.28.181.40d and 0.23.130.23a - more information can be found [[User:Quietust#DFHack-40d|here]] and [[User:Quietust#DFHack-23a|here]], respectively.
 
 
 
For information about the commands in the utility, see the [https://docs.dfhack.org/en/stable/index.html#user-manual documentation]. In particular, see the [https://docs.dfhack.org/en/stable/docs/Quickstart.html#quickstart-guide quickstart guide] and the [https://docs.dfhack.org/en/stable/docs/Tools.html#dfhack-tools categorized tool index]. Help for DFHack tools is also available in-game in the [https://docs.dfhack.org/en/stable/docs/tools/gui/launcher.html#gui-launcher gui/launcher interface]. For a quick list, with brief descriptions, of the commands available to you, enter the command <code>tags</code> to see tools by category or <code>ls</code> (or <code>dir</code>) to see the entire list. As of v50.08-r3, DFHack comes with more than 400 tools.
 
 
 
* [https://store.steampowered.com/app/2346660/DFHack Steam page] ● [https://github.com/DFHack/dfhack/releases Manual download] ● [https://docs.dfhack.org/en/stable/docs/Installing.html#installing Installation guide] ● [https://docs.dfhack.org/en/stable/index.html DFHack's documentation]
 
 
 
{{TipBox2|float=center|titlebg=red|width=80%|Bug reports|
 
<small>If you are using DFHack (or other utilities), do not report bugs on the ''Dwarf Fortress'' bug tracker unless you can prove that the bug is not being caused by DFHack or one of its plugins. DFHack can be temporarily disabled by passing the <code>--disable-dfhack</code> commandline option when you run Dwarf Fortress.exe.</small>
 
}}
 
  
 
== Features ==
 
== Features ==
[[File:Move_goods_dfhack.png|thumb|288px|right|Screenshot of the DFHack "Move goods to Trade depot" screen, showing filtering and search options.]]
 
User Interface improvements, such as:
 
* Search, sort, and filtering for screens with big lists.
 
* Ability to designate placeholder buildings, furniture, and constructions that get automatically assigned building materials as they become available.
 
* Ability to type characters not available on keyboards.
 
 
Automatic bugfixes, such as:
 
* fix/stuck-instruments - Fix activity references on instruments whose previous player was interrupted to make them usable again.
 
* fix/general-strike - Prevent dwarves from getting stuck and refusing to work.
 
* orders sort - Sort manager orders by repeat frequency so one-time orders can be completed.
 
* fix/empty-wheelbarrows - Empties wheelbarrows which have rocks stuck in them.
 
  
Fortress design tools, such as:
+
User Interface improvements. Such as:  
* gui/design - Designate digging or constructions in shapes and lines
+
* Search function in screens with big lists.
* gui/quickfort- Designate digging, stockpiles, buildings, and/or zones from a blueprint. DFHack also comes with a [https://docs.dfhack.org/en/stable/docs/guides/quickfort-library-guide.html library of blueprints].
+
* Ability to place furniture before it's built and have it automatically allocated when available.
 +
* Ability to place constructions with box select (like laying designations), including easier material selection and open space placement (without having to wait till adjacent constructions are built).
 +
* Easier pasturing, live happiness monitor, mouse support, stocks dashboard, and embark-assistant.
  
Fortress management automation tools, such as:
+
Various automation of job and fortress management. Such as:
* autobutcher - Designates excess livestock for slaughter.
+
* workflow - Manage control of repeat jobs.
* autochop - Designates trees for chopping when the fortress needs more logs.
+
* autolabor - Automatically manage dwarf labors to efficiently complete jobs
* autolabor - Automatically assign labors to dwarves to efficiently complete pending jobs
+
* autobutcher - Assigns lifestock for slaughter once it reaches a specific count.
 +
* autochop - Automatically manage tree cutting designation to keep available logs within given quotas.
 
* autonestbox - Assigns unpastured female egg-layers to nestbox zones.
 
* autonestbox - Assigns unpastured female egg-layers to nestbox zones.
* prioritize - Ensures time-sensitive jobs get done quickly.
+
* seedwatch - Watches the numbers of seeds available and enables/disables seed and plant cooking.
* seedwatch - Controls settings for cooking seeds and plants so you don't run out of seeds to plant.
+
* df-ai - ?
* tailor - Generate manager workorders for clothing as existing clothing wears out.
+
* Dwarf Manipulator - An in-game equivalent to the popular program Dwarf Therapist.
 
 
Gameplay modifications, such as:
 
* deteriorate - Cause corpses, clothes, and/or food to rot away over time.
 
* dwarfvet - Allow animals to be treated at hospitals.
 
* emigration - Allow unhappy dwarves to voluntarily leave the fortress
 
* misery - Amplify negative thoughts.
 
* starvingdead - Undead waste away over time.
 
  
Other scripts and plugins, such as:
+
Other scripts and plugins. Such as:
* [[Stonesense]] - an isometric visualizer of the map.
+
* Quickfort; a utility that helps you build fortresses from "blueprint".
 +
* [[Stonesense]] an isometric visualizer of the map.
 +
* [[Utilities#Isoworld|Isoworld]] integration.
 +
* Gameplay Extras. Such as: Steam engines, power meter, improved siege engines.
 +
* Binary patches. Utilities made by users to fix known bugs that haven't been addressed by [[main:Toady One|Toady One]] yet. DF2014 is in active development, so there are no binary patches yet.
 +
* Adventure mode. See: [https://dfhack.readthedocs.io/en/stable/docs/_auto/gui.html#gui-advfort advfort],[https://dfhack.readthedocs.io/en/stable/docs/_auto/gui.html#gui-companion-order companion-order].
  
 
== Common use ==
 
== Common use ==
 +
{{TipBox2|float=center|titlebg=red|width=80%|Bug reports|
 +
<small>If you are using DFHack (or other utilities), do not report bugs on the ''Dwarf Fortress'' bug tracker unless you can prove that the bug is not being caused by DFHack or one of its plugins. On Linux and OS X, DFHack can be bypassed by running the "df" script. On Windows, DFHack can be temporarily disabled by renaming SDL.dll to a temporary name, then renaming SDLreal.dll to SDL.dll.</small>
 +
}}
  
 
{| class=wikitable
 
{| class=wikitable
Line 72: Line 53:
 
! Description
 
! Description
 
|-
 
|-
| <code>[https://docs.dfhack.org/en/stable/docs/tools/prospector.html#prospector prospect]</code>
+
| <code>prospect</code>
| To prospect your embark location for a list of all the present minerals and plants.
+
| Prints a big list of all the present minerals and plants.
 
|-
 
|-
| <code>[https://docs.dfhack.org/en/stable/docs/tools/dig.html#digtype digv]</code>
+
| <code>digv</code>
 
| Designates a whole vein for digging.
 
| Designates a whole vein for digging.
 
|-
 
|-
| <code>[https://docs.dfhack.org/en/stable/docs/tools/reveal.html#revflood reveal]</code>
+
| <code>reveal</code>
| Reveal the map so you can inspect the caverns and mineral layouts.  
+
| This reveals the map.  
 
|-
 
|-
| <code>[https://docs.dfhack.org/en/stable/docs/tools/cleanowned.html#cleanowned cleanowned scattered x]</code>
+
| <code>cleanowned scattered x</code>
| Collects the random junk dwarves fling about the fortress and marks it for dumping.
+
|  
 
|-
 
|-
| <code>[https://docs.dfhack.org/en/stable/docs/tools/exportlegends.html#exportlegends exportlegends]</code>
+
|
| For exporting [[Legends mode]] information.
+
|
 
|}
 
|}
  
Line 93: Line 74:
  
 
*Binpatches are raw memory edits that alter the game's behavior, which is usually deduced from disassembling. Their main use is bugfixing or the removal of cumbersome, easily alterable constraints.  
 
*Binpatches are raw memory edits that alter the game's behavior, which is usually deduced from disassembling. Their main use is bugfixing or the removal of cumbersome, easily alterable constraints.  
*Plugins are snippets of C++ code that uses DFHack's library to fix bugs or add functionality. They must be compiled before use and are thus platform and dfhack-version dependent, but as a result they tend to be extremely ''fast''. They can be found in the hack/plugins folder.
+
*Plugins are snippets of C++ code that uses DFHack's library to fix bugs or add functionality. They must be compiled before use and are thus platform and dfhack-version dependent. They can be found in the hack/plugins folder.
*Scripts are files written in a scripting language DFHack provides bindings for (usually Lua or Ruby) that when loaded by DFHack fix bugs or add functionality. Contrary to plugins, they are not compiled and can be transferred between any platform. However any change within the DFHack data structures (i.e. between versions) may break some of these scripts. However, because they run in an interpreter they are unsuitable for tasks which involve large amounts of data (such as revealing the map).
+
*Scripts are files written in a scripting language DFHack provides bindings for (usually Lua or Ruby) that when loaded by DFHack fix bugs or add functionality. Contrary to plugins, they are not compiled and can be transferred between any platform. However any change within the DFHack data structures (i.e. between versions) may break some of these scripts.  
  
 
Some of the more notable are listed below; feel free to add to the list.
 
Some of the more notable are listed below; feel free to add to the list.
Line 117: Line 98:
 
* [http://www.bay12forums.com/smf/index.php?topic=135597 DFHack scripts designed for use in interactions as "spells"]
 
* [http://www.bay12forums.com/smf/index.php?topic=135597 DFHack scripts designed for use in interactions as "spells"]
 
* [http://www.bay12forums.com/smf/index.php?topic=135506 Miscellaneous DFHack script collection]
 
* [http://www.bay12forums.com/smf/index.php?topic=135506 Miscellaneous DFHack script collection]
 
=== remotefortressreader ===
 
 
Provides a protobuf-based (currently v2.4.1) RPC connection to the game, enabling remote clients like Armok Vision.  The service listens on <code>127.0.0.1:5000</code> (configurable within <code>dfhack-config/remote-server.json</code>).
 
 
Currently there are no change-based or change-driven notifications, so remote fortress clients must perform the expensive operation of polling the desired volume every frame (via e.g. <code>GetBlockList</code>).  Additionally, the sidebar menu state is shared with the native view, to avoid reimplementing construction material dependencies.
 
 
[[Category:Utilities]]
 
[[ru:Utility:DFHack]]
 

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)