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.

Utility:DFHack/scripts

From Dwarf Fortress Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

DFHack is an advanced Dwarf Fortress memory access library and a set of tools and scripts using this library, providing direct object-oriented access to Dwarf Fortress's internals as if it were compiled into the game itself. Releases support versions up through DF 0.40.24 (as of June 3rd, 2015) and some of them have been backported to earlier versions. It runs on Windows, Linux, and MacOS X. As of June 3rd 2015, the latest version is DFHack 0.40.24-r3.

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. Due to its open-source and collaborative nature, anyone can add their own contribution to this tool. There are different kinds of contributions:

  • 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. They can be found in the hack/patches 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 (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 (between versions) may break some of these scripts.

This page's purpose is to provide a comprehensive collection of all the plugins, scripts and binpatches ever written.

  • announce.lua - Print an announcement to the screen and the gamelog.
  • df-ai - a script that plays alone in fortress mode.
  • force - Allows forcing of events. Some of them are iffy, some don't work at all. It's mostly functional.
  • hackWish - Use a swanky GUI to create an item with any material and quality.
  • instant transmission - Allows teleportation to units in adventure mode by adventurer. Also gives power level readout.
  • itemsyndrome - Allows items to impart syndromes when equipped.
  • moddableGods - Allows custom gods to be added as hist figures. They do nothing as of now. Might do something funny next version, but nobody knows what exactly.
  • Probability Syndrome - Run AutoSyndrome commands which honour reaction probabilities.
  • projectileExpansion - Allows a lot of stuff related to projectiles, such as explosions, syndrome addition and script running-on-creatures.
  • rip-heart - removes units heart for a better storage (usually kills in process)
  • shapechange - Allows willful polymorph into arbitrary creature with filtering by ID or size.
  • skillroll - Allows for skills to be considered when running Lua scripts. Probability Syndrome is probably better for most purposes.
  • take-slave - Like hire-guard, but with more transformation. Requires a SLAVE caste for currently played race.
  • teleport - Allows simple teleportation of unit to position. Position can be cursor or hardcoded.
  • trainskill - Raises the skill level of a unit.
  • fovcommand - Executes a dfhack command on targets within the line of sight of a unit.
  • callsiege - Causes a random siege, you can set a probability for this to happen.
  • naturalSkills - Make sure creatures have their natural skills.
  • dwarves and points - Allows to pick any number of embark dwarves and points.
  • construct-creature - Allows you to construct creatures with reactions that incorporate the reagent materials into the creature's body. Perfect for robots and golems.
  • slam - A simple script that slams a creature into the ground at a given velocity. Can cause targets to explode at high enough values.
  • exile - Sends units away into the wild. Options include fort members, pets, wild animals, invaders, merchants, and diplomats.
  • hfspit - Creates a pit under the target leading straight to the underworld. Instant death to non-fliers. Very small chance of triggering a demon attack.
  • DFHack spells - Set of scripts for more complex interaction based spells
  • spawn unit - finally a central place for spawn unit script updates
  • heal unit - heal units script
  • rubble_fluids module - Functions for easy fluid and minecart interaction from Lua code.
  • rubble_fluids command - Test driver and autoSyndrome command for the rubble_fluids module.
  • whosout - lists any dorfs who are not in any of the burrows passed as arguments.
  • show-cursed - list assumed name of any cursed dorfs
  • show-dfhack-version - outputs dfhack release to the console (put it in your dfhack.init)
  • show-speeds - Shows current speed and encumbrance for each citizen.
  • Rendermax, a plugin that implements a lighting system at the graphics level.
  • Dwarven Emigration, a script that allows unhappy dwarves to emigrate with their families.