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 87: Line 87:
 
|}
 
|}
  
== Scripts and Plugins ==  
+
==Scripts and Plugins==  
  
 
Originally a simple memory hacking tool, DFHack has grown to become a full-fledged unofficial extension of the game itself, adding in functionality where official development has lacked. One of the best features of DFHack is its extensibility - anyone can create scripts or plugins. Due to its open-source and collaborative nature, anyone can add their own contribution to this tool. There are different kinds of contributions:
 
Originally a simple memory hacking tool, DFHack has grown to become a full-fledged unofficial extension of the game itself, adding in functionality where official development has lacked. One of the best features of DFHack is its extensibility - anyone can create scripts or plugins. Due to its open-source and collaborative nature, anyone can add their own contribution to this tool. There are different kinds of contributions:
Line 93: Line 93:
 
*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, but as a result they tend to be extremely ''fast''. They can be found in the hack/plugins folder.
*Scripts are files written in the Lua scripting language and that use the DFHack-provided API bindings. They are not compiled and can be transferred between any platform and used across DFHack versions. They can break, though, if Dwarf Fortress changes the memory structures in the area that the script interacts with (this is rare, but possible). Also, because they run in an interpreter, they are unsuitable for tasks which involve large amounts of data (such as acting on every tile of 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. However, because they run in an interpreter they are unsuitable for tasks which involve large amounts of data (such as revealing the map).
  
== Remote API ==
+
Some of the more notable are listed below; feel free to add to the list.
  
DFHack provides a protobuf-based 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>).
+
=== User Interface ===
  
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>).
+
The best-known are [http://www.bay12forums.com/smf/index.php?topic=119575 Falconne's UI Plugins], a collection which improves the in-game interface with features such as search functions in screens with big lists, the ability to place furniture before it's built and have it automatically allocated when available, box-select constructions(like laying designations) - including easier material selection and open space placement, easier pasturing, live happiness monitor, '''mouse support''', and an enhanced stocks screen.  The plugins make existing tasks significantly easier, and also add new functions to the game which greatly enhance the experience - such as the autochop log quotas, or the ability (with buildingplanner) to lay out rooms with Quickfort before creating the required furniture.
  
More info on DFHack's remote API [https://docs.dfhack.org/en/stable/docs/dev/Remote.html here].
+
There is also a [http://www.bay12forums.com/smf/index.php?topic=124708 GUI for the Autobutcher plugin]. 
 +
 
 +
=== Bugfixing ===
 +
Many bugfixes are included with DFHack, but not enabled by default - check dfhack.init to see if the "tweak *" and "fix/*" lines are commented out. The [[Utility:Lazy_Newb_Pack|Starter Packs]] enable all bugfixes by default.
 +
 
 +
=== Features ===
 +
These plugins and scripts add features to the game that enhance the user's gameplay.
 +
* [http://www.bay12forums.com/smf/index.php?topic=127116 Digging invaders], a plugin that allows hostiles to dig and deconstruct walls to path to one's fortress.
 +
* [http://www.bay12forums.com/smf/index.php?topic=128487 Rendermax], a plugin that implements a lighting system at the graphics level.
 +
* [http://www.bay12forums.com/smf/index.php?topic=136155 Dwarven Emigration], a plugin that allows unhappy dwarves to emigrate with their families.
 +
 
 +
=== Modding tools ===
 +
These plugins and scripts add features to the game that enhance modding possibilities.
 +
* [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]
 +
 
 +
=== 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]]
 
[[Category:Utilities]]
 
[[ru:Utility:DFHack]]
 
[[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)