Merge remote-tracking branch 'PeridexisErrant/NEWS-cleanup' into develop

develop
lethosor 2015-11-04 19:54:13 -05:00
commit cbf31dcb37
145 changed files with 3055 additions and 2575 deletions

2
.gitignore vendored

@ -21,7 +21,7 @@ buntu
build/VC2010 build/VC2010
# Sphinx generated documentation # Sphinx generated documentation
docs/_*/ docs/_*
docs/html/ docs/html/
#except for the real one #except for the real one

@ -184,10 +184,7 @@ endif()
# build the lib itself # build the lib itself
IF(BUILD_LIBRARY) IF(BUILD_LIBRARY)
add_subdirectory (library) add_subdirectory (library)
## install the default documentation files install(FILES LICENSE.rst NEWS.rst DESTINATION ${DFHACK_USERDOC_DESTINATION})
#install(FILES LICENSE NEWS "Lua API.html" Readme.html Compile.html Contributors.html DESTINATION ${DFHACK_USERDOC_DESTINATION})
install(FILES LICENSE NEWS DESTINATION ${DFHACK_USERDOC_DESTINATION})
#install(DIRECTORY docs/images DESTINATION ${DFHACK_USERDOC_DESTINATION})
endif() endif()
install(DIRECTORY dfhack-config/ DESTINATION dfhack-config/default) install(DIRECTORY dfhack-config/ DESTINATION dfhack-config/default)
@ -204,43 +201,29 @@ if (BUILD_DOCS)
if (NOT SPHINX_FOUND) if (NOT SPHINX_FOUND)
message(SEND_ERROR "Sphinx not found but BUILD_DOCS enabled") message(SEND_ERROR "Sphinx not found but BUILD_DOCS enabled")
endif() endif()
set(SPHINX_THEME "alabaster")
set(SPHINX_THEME_DIR)
set(SPHINX_BINARY_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/_build")
set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/_build/_doctrees")
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/html/")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/docs/conf.py.in"
"${SPHINX_BINARY_BUILD_DIR}/conf.py"
@ONLY)
file(GLOB SPHINX_DEPS file(GLOB SPHINX_DEPS
"${CMAKE_CURRENT_SOURCE_DIR}/docs/*.rst" "${CMAKE_CURRENT_SOURCE_DIR}/docs/*.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/images/*.png" "${CMAKE_CURRENT_SOURCE_DIR}/docs/images/*.png"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/conf.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/docs/styles/*"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*.lua" "${CMAKE_CURRENT_SOURCE_DIR}/docs/conf.py"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*.lua" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/about.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*.lua" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/about.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*.lua" )
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*.lua" file(GLOB_RECURSE SPHINX_SCRIPT_DEPS scripts "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*/*.lua" "*.lua"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*/*/*.lua" "*.rb"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*/*/*/*.lua"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*/*/*/*/*.lua"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/*/*/*/*/*/*/*/*/*.lua"
) )
set(SPHINX_DEPS ${SPHINX_DEPS} LICENSE NEWS README.rst) set(SPHINX_DEPS ${SPHINX_DEPS} ${SPHINX_SCRIPT_DEPS} LICENSE.rst NEWS.rst index.rst)
set(SPHINX_OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/docs/html/.buildinfo") set(SPHINX_OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/docs/html/.buildinfo")
set_source_files_properties(${SPHINX_OUTPUT} PROPERTIES GENERATED TRUE) set_source_files_properties(${SPHINX_OUTPUT} PROPERTIES GENERATED TRUE)
add_custom_command(OUTPUT ${SPHINX_OUTPUT} add_custom_command(OUTPUT ${SPHINX_OUTPUT}
COMMAND ${SPHINX_EXECUTABLE} COMMAND ${SPHINX_EXECUTABLE}
-a -E -q -b html -a -E -q -b html
-c "${SPHINX_BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}"
"${SPHINX_HTML_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/html"
-w "${CMAKE_CURRENT_SOURCE_DIR}/docs/_sphinx-warnings.txt"
DEPENDS ${SPHINX_DEPS} DEPENDS ${SPHINX_DEPS}
COMMENT "Building HTML documentation with Sphinx" COMMENT "Building HTML documentation with Sphinx"
) )
@ -253,12 +236,10 @@ if (BUILD_DOCS)
add_custom_command(TARGET dfhack_docs POST_BUILD add_custom_command(TARGET dfhack_docs POST_BUILD
COMMAND ${CMAKE_COMMAND} -E touch ${SPHINX_OUTPUT}) COMMAND ${CMAKE_COMMAND} -E touch ${SPHINX_OUTPUT})
install(DIRECTORY ${dfhack_SOURCE_DIR}/docs/html install(DIRECTORY ${dfhack_SOURCE_DIR}/docs
DESTINATION ${DFHACK_USERDOC_DESTINATION} DESTINATION ${DFHACK_USERDOC_DESTINATION}
#FILES_MATCHING PATTERN "*.lua"
# PATTERN "*.rb"
# PATTERN "3rdparty" EXCLUDE
) )
install(FILES "README.html" DESTINATION "${DFHACK_DATA_DESTINATION}")
endif() endif()
# Packaging with CPack! # Packaging with CPack!

@ -1,3 +1,13 @@
.. _license:
########
Licenses
########
DFHack is distributed under a range of permissive and weakly copyleft licenses.
The core uses the ZLib license; the others are described below.
License of DFHack License of DFHack
================= =================
https://github.com/peterix/dfhack https://github.com/peterix/dfhack

863
NEWS

@ -1,863 +0,0 @@
.. comment
This is the changelog file for DFHack. If you add or change anything, note
it here under the heading "DFHack Future", in the appropriate section.
Items within each section are listed in alphabetical order to minimise merge
conflicts. Try to match the style and level of detail of the other entries.
DFHack Future
=============
::
Internals
A method for caching screen output is now available to Lua (and C++)
Developer plugins can be ignored on startup by setting the DFHACK_NO_DEV_PLUGINS environment variable
The console on Linux and OS X now recognizes keyboard input between prompts
JSON libraries available (C++ and Lua)
More DFHack build information used in plugin version checks and available to plugins and lua scripts
Fixed a rare overflow issue that could cause crashes on Linux and OS X
Stopped DF window from receiving input when unfocused on OS X
Fixed issues with keybindings involving Ctrl-A and Ctrl-Z, as well as Alt-E/U/N on OS X
Multiple contexts can now be specified when adding keybindings
Keybindings can now use F10-F12 and 0-9
Plugin system is no longer restricted to plugins that exist on startup
dfhack.init file locations significantly generalized
Lua
Scripts can be enabled with the built-in enable/disable commands
A new function, reqscript(), is available as a safer alternative to script_environment()
Lua viewscreens can choose not to intercept the OPTIONS keybinding
New internal commands
kill-lua: Interrupt running Lua scripts
type: Show where a command is implemented
New plugins
confirm: Adds confirmation dialogs for several potentially dangerous actions
fix-unit-occupancy: Fixes issues with unit occupancy, such as faulty "unit blocking tile" messages (bug 3499)
title-version (formerly vshook): Display DFHack version on title screen
New scripts
burial: sets all unowned coffins to allow burial ("-pets" to allow pets too)
fix-ster: changes fertility/sterility of animals or dwarves
view-item-info: adds information and customisable descriptions to item viewscreens
warn-starving: check for starving, thirsty, or very drowsy units and pause with warning if any are found
modtools/create-unit: create new units from nothing
modtools/equip-item: a script to equip items on units
points: set number of points available at embark screen
Vjek's script collection:
- armoks-blessing: Adjust all attributes, personality, age and skills of all dwarves in play
- brainwash: brainwash a dwarf (modifying their personality)
- elevate-mental: elevate all the mental attributes of a unit
- elevate-physical: elevate all the physical attributes of a unit
- make-legendary: modify skill(s) of a single unit
- pref-adjust: Adjust all preferences of all dwarves in play
- rejuvenate: make any "old" dwarf 20 years old
New tweaks
embark-profile-name: Allows the use of lowercase letters when saving embark profiles
kitchen-keys: Fixes DF kitchen meal keybindings
kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences
kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs
Fixes
Plugins with vmethod hooks can now be reloaded on OS X
Lua's os.system() now works on OS X
Fixed default arguments in Lua gametype detection functions
Circular lua dependencies (reqscript/script_environment) fixed
Prevented crash in Items::createItem()
buildingplan: Now supports hatch covers
gui/create-item:
- fixed assigning quality to items
- made "esc" work properly
gui/gm-editor handles lua tables properly
help: now recognizes built-in commands, like "help"
manipulator: fixed crash when selecting custom professions when none are found
remotefortressreader: fixed crash when attempting to send map info when no map was loaded
search:
- fixed crash in unit list after cancelling a job
- fixed crash when disabling stockpile category after searching in a subcategory
stockpiles: now checks/sanitizes filenames when saving
stocks: fixed a crash when right-clicking
steam-engine:
- fixed a crash on arena load
- number keys (e.g. 2/8) take priority over cursor keys when applicable
tweak fps-min fixed
tweak farm-plot-select: Stopped controls from appearing when plots weren't fully built
workflow: Fixed some issues with stuck jobs
- Note: Existing stuck jobs must be cancelled and re-added
zone: Fixed a crash when using "zone set" (and a few other potential crashes)
Misc Improvements
DFHack documentation:
- massively reorganised, into files of more readable size
- added many missing entries
- indexes, internal links, offline search all documents
- includes documentation of linked projects (df-structures, 3rdparty scripts)
- better HTML generation with Sphinx
autolabor:
- Stopped modification of labors that shouldn't be modified for brokers/diplomats
- Prioritize skilled dwarves more efficiently
- Prevent dwarves from running away with tools from previous jobs
dwarfmonitor:
- widgets' positions, formats, etc. are now customizable (see Readme)
- weather display now separated from the date display
- New mouse cursor widget
dfstatus: Can enable/disable individual categories and customize metal bar list
full-heal: "-r" option removes corpses
gui/gm-editor
- Pointers can now be displaced
- Added some useful aliases: "item" for the selected item, "screen" for the current screen, etc.
- Now avoids errors with unrecognized types
gui/hack-wish: renamed to gui/create-item
"keybinding list" accepts a context
lever:
- Lists lever names
- "lever pull" can be used to pull the currently-selected lever
memview: Fixed display issue
modtools/create-item: arguments are named more clearly, and you can specify the creator to be
the unit with id df.global.unit_next_id-1 (useful in conjunction with modtools/create-unit)
nyan: Can now be stopped with dfhack-run
plug:
- lists all plugins
- shows state and number of commands in plugins
prospect: works from within command-prompt
quicksave: Restricted to fortress mode
remotefortressreader: Exposes more information
search:
- Supports noble suggestion screen (e.g. suggesting a baron)
- Supports fortress mode loo[k] menu
- Recognizes ? and ; keys
stocks: can now match beginning and end of item names
teleport: Fixed cursor recognition
tweak:
- debug output now logged to stderr.log instead of console - makes DFHack start faster
- farm-plot-select: Fixed issues with selecting undiscovered crops
workflow: Improved handling of plant reactions
Removed
embark-tools nano: 1x1 embarks are now possible in vanilla 0.40.24
DFHack 0.40.24-r3
=================
::
Internals
Ruby library now included on OS X - ruby scripts should work on OS X 10.10
libstdc++ should work with older versions of OS X
Added support for onLoadMap/onUnloadMap.init scripts
game type detection functions are now available in the World module
The DFHACK_LOG_MEM_RANGES environment variable can be used to log information to stderr.log on OS X
Fixed adventure mode menu names
Fixed command usage information for some commands
Lua
Lua scripts will only be reloaded if necessary
Added a df2console() wrapper, useful for printing DF (CP437-encoded) text to the console in a portable way
Added a strerror() wrapper
New internal commands
hide/show: hide and show the console on Windows
sc-script: Allows additional scripts to be run when certain events occur (similar to onLoad*.init scripts)
New plugins
autohauler: A hauling-only version of autolabor
New scripts
modtools/reaction-product-trigger: triggers callbacks when products are produced (contrast with when reactions complete)
New tweaks
fps-min: Fixes the in-game minimum FPS setting
shift-8-scroll: Gives Shift+8 (or *) priority when scrolling menus, instead of scrolling the map
tradereq-pet-gender: Displays pet genders on the trade request screen
New features
autolabor: A negative pool size can be specified to use the most unskilled dwarves
catsplosion: Works on any specified races
exportlegends: Now exports more information
Fixes
Fixed game type detection in:
3dveins
createitem
reveal
seedwatch
Made PRELOAD_LIB more extensible on Linux
add-spatter, eventful: Fixed crash on world load
building-hacks: made buildings produce/consume correct amount of power
Gave add-thought a proper subthought arg.
fix-armory compiles and is available again (albeit with issues)
gui/gm-editor: Added search option (accessible with "s")
hack-wish: Made items stack properly.
modtools/skill-change: made level granularity work properly.
show-unit-syndromes should work
stockflow: Fixed error message in Arena mode
stockflow: No longer checks the DF version
stockflow: Fixed ballistic arrow head orders
stockflow: Now convinces the bookkeeper to update records more often
zone: Stopped crash when scrolling cage owner list
Misc Improvements
building-hacks: Added a way to allow building to work even if it consumes more power
than is available. Added setPower/getPower functions.
catsplosion: Can now trigger pregnancies in (most) other creatures
exportlegends: 'info' and 'all' exports legends_plus xml with more data for legends utilities
manipulator:
Added ability to edit nicknames/profession names
Added "Job" as a View Type, in addition to "Profession" and "Squad"
Custom profession templates, with masking
remotefortressreader: Exposes more information
DFHack 0.40.24-r2
=================
::
Internals
Lua scripts can set environment variables of each other with dfhack.run_script_with_env.
Lua scripts can now call each others internal nonlocal functions with dfhack.script_environment(scriptName).functionName(arg1,arg2).
eventful Lua reactions no longer require LUA_HOOK as a prefix: you can register a
callback for the completion of any reaction with a name
Filesystem module now provides file access/modification times and can list directories (normally and recursively)
Units Module: New functions:
isWar
isHunter
isAvailableForAdoption
isOwnCiv
isOwnRace
getRaceName
getRaceNamePlural
getRaceBabyName
getRaceChildName
isBaby
isChild
isAdult
isEggLayer
isGrazer
isMilkable
isTrainableWar
isTrainableHunting
isTamable
isMale
isFemale
isMerchant
isForest
isMarkedForSlaughter
Buildings Module: New Functions:
isActivityZone
isPenPasture
isPitPond
isActive
findPenPitAt
Fixes
dfhack.run_script should correctly find save-specific scripts now.
Updated add-thought to properly affect stress.
hfs-pit should work now
Autobutcher takes gelding into account
init.lua existence checks should be more reliable (notably when using non-English locales)
Misc Improvements
Multiline commands are now possible inside dfhack.init scripts. See dfhack.init-example for example usage.
DFHack 0.40.24-r1
=================
::
Internals
CMake shouldn't cache DFHACK_RELEASE anymore. People may need to manually update/delete
their CMake cache files to get rid of it.
DFHack 0.40.24-r0
=================
::
Internals
EventManager: fixed crash error with EQUIPMENT_CHANGE event.
key modifier state exposed to Lua
Fixes
dfhack script can now be run from other directories on OSX
New Plugins
blueprint: export part of your fortress to quickfort .csv files
New Scripts
hotkey-notes: print key, name, and jump position of hotkeys
Removed
embark.lua
needs_porting/*
Misc Improvements
added support for searching more lists
DFHack 0.40.23-r1
=================
::
Internals
plugins will not be loaded if globals they specify as required are not located (should prevent some crashes)
Fixes
Fixed numerous (mostly Lua-related) crashes on OS X by including a more up-to-date libstdc++
Alt should no longer get stuck on Windows (and perhaps other platforms as well)
advfort works again
autobutcher takes sexualities into account
devel/export-dt-ini: Updated for 0.40.20+
digfort: now checks file type and existence
exportlegends: Fixed map export
full-heal: Fixed a problem with selecting units in the GUI
gui/hack-wish: Fixed restrictive material filters
mousequery: Changed box-select key to Alt+M
plugins/dwarfmonitor: correct date display (month index, separator)
scripts/putontable: added to the readme
siren should work again
stderr.log: removed excessive debug output on OS X
trackstop: No longer prevents cancelling the removal of a track stop or roller.
Fixed a display issue with PRINT_MODE:TEXT
Fixed a symbol error (MapExtras::BiomeInfo::MAX_LAYERS) when compiling DFHack in Debug mode
New Plugins
fortplan: designate construction of (limited) buildings from .csv file, quickfort-style
New Scripts
gui/stockpiles: an in-game interface for saving and loading stockpile
settings files.
position: Reports the current date, time, month, and season, plus
some location info. Port/update of position.py
hfs-pit: Digs a hole to hell under the cursor. Replaces needs_porting/hellhole.cpp
Removed
embark.lua: Obsolete, use `embark-tools`
New tweaks:
eggs-fertile: Displays an egg fertility indicator on nestboxes
max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile
Misc Improvements
embark-tools: Added basic mouse support on the local map
Made some adventure mode keybindings in dfhack.init-example only work in adventure mode
Added a default keybinding for "gui/companion-order"
further work on needs_porting
DFHack 0.40.19-r1
=================
::
Fixes:
typo fix in modtools/reaction-trigger
modtools/item-trigger should now work with item types
New plugins:
savestock and loadstock: two commands for saving and loading
stockpile settings to a file. They can be used to migrate stockpile
settings between worlds and saves.
New scripts:
remove-stress [all]: set selected or all units unit to -1,000,000 stress
this script replaces removebadthoughts.rb
Misc improvements:
cmd-prompt can now access selected items, units, and buildings
autolabor plugin: add an optional talent pool parameter
DFHack 0.40.16-r1
=================
::
Internals:
EventManager should handle INTERACTION triggers a little better. It still can get confused
about who did what but only rarely.
EventManager should no longer trigger REPORT events for old reports after loading a save.
lua/persist-table.lua: a convenient way of using persistent tables of arbitrary structure and dimension in Lua
Fixes:
mousequery: Disabled when linking levers
stocks: Melting should work now
scripts/full-heal: Updated with proper argument handling.
scripts/modtools/reaction-trigger-transition.lua
should produce the correct syntax now
scripts/superdwarf.rb should work better now
scripts/forum-dwarves.lua
update for new df-structures changes
New scripts:
scripts/
adaptation.rb
view or set the cavern adaptation level of your citizens
add-thought.lua
allows the user to add thoughts to creatures.
gaydar.lua
detect the sexual orientation of units on the map
markdown.lua
Save a copy of a text screen in markdown (for reddit among others).
devel/
all-bob.lua: renames everyone Bob to help test interaction-trigger
Misc improvements:
autodump:
Can now mark a stockpile for auto-dumping (similar to
automelt and autotrade)
buildingplan:
Can now auto-allocate rooms to dwarves with specific positions
(e.g. expedition leader, mayor)
dwarfmonitor
Now displays a weather indicator and date
lua/syndrome-util.lua
now you can remove syndromes by SYN_CLASS
scripts/modtools/add-syndrome.lua
now you can remove syndromes by SYN_CLASS
No longer writes empty .history files
DFHack 0.40.15-r1
=================
::
Fixes:
- mousequery: Fixed behavior when selecting a tile on the lowest z-level
Internals:
- EventManager: deals with frame_counter getting reset properly now.
- modtools/item-trigger: fixed equip/unequip bug and corrected minor documentation error
- teleport: Updated with proper argument handling and proper unit-at-destination handling.
- autotrade: Removed the newly obsolete "Mark all" functionality.
- search: Adapts to the new trade screen column width
- tweak fast-trade: Switching the fast-trade keybinding to Shift-Up/Shift-Down, due to Select All conflict
DFHack 0.40.14-r1
=================
::
Internals:
- The DFHack console can now be disabled by setting the DFHACK_DISABLE_CONSOLE
environment variable: "DFHACK_DISABLE_CONSOLE=1 ./dfhack"
Fixes:
- Stopped duplicate load/unload events when unloading a world
- Stopped "-e" from being echoed when DFHack quits on Linux
- automelt now uses a faster method to locate items
- autotrade: "Mark all" no longer double-marks bin contents
- drainaquifer.rb: replaced with a faster less buggy drain-aquifer.lua
- embark-tools no longer conflicts with keys on the notes screen
- fastdwarf: Fixed problems with combat/attacks
- forum-dwarves should work now
- manipulator now uses a stable sort, allowing sorting by multiple categories
- rendermax updated to work with 0.40
New plugins:
- trackstop: Shows track stop friction and dump direction in its 'q' menu
New tweaks:
- farm-plot-select: Adds "Select all" and "Deselect all" options to farm plot menus
- import-priority-category: Allows changing the priority of all goods in a
category when discussing an import agreement with the liaison
- manager-quantity: Removes the limit of 30 jobs per manager order
- civ-view-agreement: Fixes overlapping text on the "view agreement" screen
- nestbox-color: Fixes the color of built nestboxes
Misc Improvements:
- exportlegends.lua can now handle site maps
DFHack 0.40.13-r1
=================
::
Internals:
- unified spatter structs
- added ruby df.print_color(color, string) method for dfhack console
Fixes:
- no more -e after terminating
- fixed superdwarf
DFHack 0.40.12-r1
=================
::
Fixes:
- possible crash fixed for hack-wish
- updated search to not conflict with BUILDJOB_SUSPEND
- workflow: job_material_category -> dfhack_material_category
New plugins:
- hotkeys (by Falconne): Shows ingame viewscreen with all dfhack keybindings active in current mode.
- automelt: allows marking stockpiles for automelt
(i.e. any items placed in stocpile will be designated for melting)
Misc Improvements:
- now you can use @ to print things in interactive Lua with subtley different semantics
- optimizations for stockpiles for autotrade and stockflow
- updated exportlegends.lua to work with new maps, dfhack 40.11 r1+
Internals:
- support for global onLoadWorld.init and onUnloadWorld.init files,
called when loading and unloading a world
- Close file after loading a binary patch.
DFHack 0.40.11-r1
=================
::
Internals:
- Plugins on OS X now use ".plug.dylib" as an extension instead of ".plug.so"
Fixes:
- 3dveins should no longer hang/crash on specific maps
- Fixed some autotrade and search layout issues
- Updated deathcause
- hack-wish should work now
- reveal no longer allocates data for nonexistent map blocks
- Various documentation fixes and updates
DFHack v0.40.10-r1
==================
A few bugfixes.
DFHack v0.40.08-r2
==================
::
Internals:
supported per save script folders
Items module: added createItem function
Sorted CMakeList for plugins and plugins/devel
diggingInvaders no longer builds if plugin building is disabled
EventManager:
EQUIPMENT_CHANGE now triggers for new units
new events:
ON_REPORT
UNIT_ATTACK
UNLOAD
INTERACTION
New scripts:
lua/
repeat-util.lua
makes it easier to make things repeat indefinitely
syndrome-util.lua
makes it easier to deal with unit syndromes
scripts/
forum-dwarves.lua
helps copy df viewscreens to a file
full-heal.lua
fully heal a unit
remove-wear.lua
removes wear from all items in the fort
repeat.lua
repeatedly calls a script or a plugin
ShowUnitSyndromes.rb
shows syndromes affecting units and other relevant info
teleport.lua
teleports units
scripts/devel/
print-args.lua
scripts/fix/
blood-del.lua
makes it so civs don't bring barrels full of blood ichor or goo
feeding-timers.lua
reset the feeding timers of all units
scripts/gui/
hack-wish.lua
creates items out of any material
unit-info-viewer.lua
displays information about units
scripts/modtools/
add-syndrome.lua
add a syndrome to a unit or remove one
anonymous-script.lua
execute an lua script defined by a string. For example,
'scripts/modtools/anonymous-script "print(args[2] .. args[1])" one two'
will print 'twoone'. Useful for the *-trigger scripts.
force.lua
forces events: caravan, migrants, diplomat, megabeast, curiousbeast,
mischievousbeast, flier, siege, nightcreature
item-trigger.lua
triggers commands based on equipping, unequipping, and wounding units with items
interaction-trigger.lua
triggers commands when interactions happen
invader-item-destroyer.lua
destroys invaders' items when they die
moddable-gods.lua
standardized version of Putnam's moddable gods script
outside-only.lua
register buildings as outside only or inside only
replaces outsideOnly plugin
projectile-trigger.lua
standardized version of projectileExpansion
reaction-trigger.lua
trigger commands when custom reactions complete
replaces autoSyndrome
reaction-trigger-transition.lua
a tool for converting mods from autoSyndrome to reaction-trigger
random-trigger.lua
triggers random scripts that you register
skill-change.lua
for incrementing and setting skills
spawn-flow.lua
creates flows, like mist or dragonfire
syndrome-trigger.lua
trigger commands when syndromes happen
transform-unit.lua
shapeshifts a unit, possibly permanently
Misc improvements:
new function in utils.lua for standardized argument processing
Removed
digmat.rb: digFlood does the same functionality with less FPS impact
scripts/invasionNow: scripts/modtools/force.lua does it better
autoSyndrome replaced with scripts/modtools/reaction-trigger.lua
syndromeTrigger replaced with scripts/modtools/syndrome-trigger.lua
devel/printArgs plugin converted to scripts/devel/print-args.lua
DFHack v0.40.08-r1
==================
Was a mistake. Don't use it.
DFHack v0.34.11-r5
==================
::
Internals:
- support for calling a lua function via a protobuf request (demonstrated by dfhack-run --lua).
- support for basic filesystem operations (e.g. chdir, mkdir, rmdir, stat) in C++ and Lua
- Lua API for listing files in directory. Needed for mod-manager.
- Lua API for creating unit combat reports and writing to gamelog.
- Lua API for running arbitrary DFHack commands
- support for multiple raw/init.d/*.lua init scripts in one save.
- eventful now has a more friendly way of making custom sidebars
- on Linux and OSX the console now supports moving the cursor back and forward by a whole word.
New scripts:
- gui/mod-manager: allows installing/uninstalling mods into df from df/mods directory.
- gui/clone-uniform: duplicates the currently selected uniform in the military screen.
- fix/build-location: partial work-around for bug 5991 (trying to build wall while standing on it)
- undump-buildings: removes dump designation from materials used in buildings.
- exportlegends: exports data from legends mode, allowing a set-and-forget export of large worlds.
- log-region: each time a fort is loaded identifying information will be written to the gamelog.
- dfstatus: show an overview of critical stock quantities, including food, drinks, wood, and bars.
New commands:
- 'plant create' - spawn a new shrub under the cursor
- command-prompt: a dfhack command prompt in df.
New tweaks:
- craft-age-wear: make crafted items wear out with time like in old versions (bug 6003)
- adamantine-cloth-wear: stop adamantine clothing from wearing out (bug 6481)
- confirm-embark: adds a prompt before embarking (on the "prepare carefully" screen)
New plugins:
- rendermax: replace the renderer with something else. Most interesting is "rendermax light"- a lighting engine for df.
- automelt: allows marking stockpiles for automelt (i.e. any items placed in stocpile will be designated for melting)
- embark-tools: implementations of Embark Anywhere, Nano Embark, and a few other embark-related utilities
- building-hacks: Allows to add custom functionality and/or animations to buildings.
- petcapRemover: triggers pregnancies in creatures so that you can effectively raise the default
pet population cap from the default 50
Misc improvements:
- plant: move the 'grow', 'extirpate' and 'immolate' commands as 'plant' subcommands
- digfort: improved csv parsing, add start() comment handling
- exterminate: allow specifying a caste (exterminate gob:male)
- createitem: in adventure mode it now defaults to the controlled unit as maker.
- autotrade: adds "(Un)mark All" options to both panes of trade screen.
- mousequery: several usability improvements.
- mousequery: show live overlay (in menu area) of what's on the tile under the mouse cursor.
- search: workshop profile search added.
- dwarfmonitor: add screen to summarise preferences of fortress dwarfs.
- getplants: add autochop function to automate woodcutting.
- stocks: added more filtering and display options.
Siege engine plugin:
- engine quality and distance to target now affect accuracy
- firing the siege engine at a target produces a combat report
- improved movement speed computation for meandering units
- operators in Prepare To Fire mode are released from duty once
hungry/thirsty if there is a free replacement
DFHack v0.34.11-r4
==================
::
New commands:
- diggingInvaders - allows invaders to dig and/or deconstruct walls and buildings in order to get at your dwarves.
- digFlood - automatically dig out specified veins as they are revealed
- enable, disable - Built-in commands that can be used to enable/disable many plugins.
- restrictice - Restrict traffic on squares above visible ice.
- restrictliquid - Restrict traffic on every visible square with liquid.
- treefarm - automatically chop trees and dig obsidian
New scripts:
- autobutcher: A GUI front-end for the autobutcher plugin.
- invasionNow: trigger an invasion, or many
- locate_ore: scan the map for unmined ore veins
- masspit: designate caged creatures in a zone for pitting
- multicmd: run a sequence of dfhack commands, separated by ';'
- startdwarf: change the number of dwarves for a new embark
- digmat: dig veins/layers tile by tile, as discovered
Misc improvements:
- autoSyndrome:
disable by default
reorganized special tags
minimized error spam
reset policies: if the target already has an instance of the syndrome you can skip,
add another instance, reset the timer, or add the full duration to the time remaining
- core: fix SC_WORLD_(UN)LOADED event for arena mode
- exterminate: renamed from slayrace, add help message, add butcher mode
- fastdwarf: fixed bug involving fastdwarf and teledwarf being on at the same time
- magmasource: rename to 'source', allow water/magma sources/drains
- ruby: add df.dfhack_run "somecommand"
- syndromeTrigger: replaces and extends trueTransformation. Can trigger things when syndromes are added for any reason.
- tiletypes: support changing tile material to arbitrary stone.
- workNow: can optionally look for jobs when jobs are completed
New tweaks:
- hive-crash: Prevent crash if bees die in a hive with ungathered products (bug 6368).
New plugins:
- 3dveins: Reshapes all veins on the map in a way that flows between Z levels. May be unstable. Backup before using.
- autotrade: Automatically send items in marked stockpiles to trade depot, when trading is possible.
- buildingplan: Place furniture before it's built
- dwarfmonitor: Records dwarf activity to measure fort efficiency
- mousequery: Look and poke at the map elements with the mouse.
- outsideOnly: make raw-specified buildings impossible to build inside
- resume: A plugin to help display and resume suspended constructions conveniently
- stocks: An improved stocks display screen.
Internals:
- Core: there is now a per-save dfhack.init file for when the save is loaded, and another for when it is unloaded
- EventManager: fixed job completion detection, fixed removal of TICK events, added EQUIPMENT_CHANGE event
- Lua API for a better random number generator and perlin noise functions.
- Once: easy way to make sure something happens once per run of DF, such as an error message
DFHack v0.34.11-r3
==================
::
Internals:
- support for displaying active keybindings properly.
- support for reusable widgets in lua screen library.
- Maps::canStepBetween: returns whether you can walk between two tiles in one step.
- EventManager: monitors various in game events centrally so that individual plugins
don't have to monitor the same things redundantly.
- Now works with OSX 10.6.8
Notable bugfixes:
- autobutcher can be re-enabled again after being stopped.
- stopped Dwarf Manipulator from unmasking vampires.
- Stonesense is now fixed on OSX
Misc improvements:
- fastdwarf: new mode using debug flags, and some internal consistency fixes.
- added a small stand-alone utility for applying and removing binary patches.
- removebadthoughts: add --dry-run option
- superdwarf: work in adventure mode too
- tweak stable-cursor: carries cursor location from/to Build menu.
- deathcause: allow selection from the unitlist screen
- slayrace: allow targetting undeads
New tweaks:
- tweak military-training: speed up melee squad training up to 10x (normally 3-5x).
New scripts:
- binpatch: the same as the stand-alone binpatch.exe, but works at runtime.
- region-pops: displays animal populations of the region and allows tweaking them.
- lua: lua interpreter front-end converted to a script from a native command.
- dfusion: misc scripts with a text based menu.
- embark: lets you embark anywhere.
- lever: list and pull fort levers from the dfhack console.
- stripcaged: mark items inside cages for dumping, eg caged goblin weapons.
- soundsense-season: writes the correct season to gamelog.txt on world load.
- create-items: spawn items
- fix/cloth-stockpile: fixes bug 5739; needs to be run after savegame load every time.
New GUI scripts:
- gui/guide-path: displays the cached path for minecart Guide orders.
- gui/workshop-job: displays inputs of a workshop job and allows tweaking them.
- gui/workflow: a front-end for the workflow plugin (part inspired by falconne).
- gui/assign-rack: works together with a binary patch to fix weapon racks.
- gui/gm-editor: an universal editor for lots of dfhack things.
- gui/companion-order: a adventure mode command interface for your companions.
- gui/advfort: a way to do jobs with your adventurer (e.g. build fort).
New binary patches (for use with binpatch):
- armorstand-capacity: doubles the capacity of armor stands.
- custom-reagent-size: lets custom reactions use small amounts of inputs.
- deconstruct-heapfall: stops some items still falling on head when deconstructing.
- deconstruct-teleport: stops items from 16x16 block teleporting when deconstructing.
- hospital-overstocking: stops hospital overstocking with supplies.
- training-ammo: lets dwarves with quiver full of combat-only ammo train.
- weaponrack-unassign: fixes bug that negates work done by gui/assign-rack.
Workflow plugin:
- properly considers minecarts assigned to routes busy.
- code for deducing job outputs rewritten in lua for flexibility.
- logic fix: collecting webs produces silk, and ungathered webs are not thread.
- items assigned to squads are considered busy, even if not in inventory.
- shearing and milking jobs are supported, but only with generic MILK or YARN outputs.
- workflow announces when the stock level gets very low once a season.
New Fix Armory plugin:
Together with a couple of binary patches and the gui/assign-rack script,
this plugin makes weapon racks, armor stands, chests and cabinets in
properly designated barracks be used again for storage of squad equipment.
New Search plugin by falconne:
Adds an incremental search function to the Stocks, Trading, Stockpile and Unit List screens.
New AutoMaterial plugin by falconne:
Makes building constructions (walls, floors, fortifications, etc) a little bit easier by
saving you from having to trawl through long lists of materials each time you place one.
Dfusion plugin:
Reworked to make use of lua modules, now all the scripts can be used from other scripts.
New Eventful plugin:
A collection of lua events, that will allow new ways to interact with df world.
Auto syndrome plugin:
A way of automatically applying boiling rock syndromes and calling dfhack commands controlled by raws.
Infinite sky plugin:
Create new z-levels automatically or on request.
True transformation plugin:
A better way of doing permanent transformations that allows later transformations.
Work now plugin:
Makes the game assign jobs every time you pause.
DFHack v0.34.11-r2
==================
::
Internals:
- full support for Mac OS X.
- a plugin that adds scripting in ruby.
- support for interposing virtual methods in DF from C++ plugins.
- support for creating new interface screens from C++ and lua.
- added various other API functions.
Notable bugfixes:
- better terminal reset after exit on linux.
- seedwatch now works on reclaim.
- the sort plugin won't crash on cages anymore.
Misc improvements:
- autodump: can move items to any walkable tile, not just floors.
- stripcaged: by default keep armor, new dumparmor option.
- zone: allow non-domesticated birds in nestboxes.
- workflow: quality range in constraints.
- cleanplants: new command to remove rain water from plants.
- liquids: can paint permaflow, i.e. what makes rivers power water wheels.
- prospect: pre-embark prospector accounts for caves & magma sea in its estimate.
- rename: supports renaming stockpiles, workshops, traps, siege engines.
- fastdwarf: now has an additional option to make dwarves teleport to their destination.
New commands:
- misery: multiplies every negative thought gained (2x by default).
- digtype: designates every tile of the same type of vein on the map for 'digging' (any dig designation).
New tweaks:
- tweak stable-cursor: keeps exact cursor position between d/k/t/q/v etc menus.
- tweak patrol-duty: makes Train orders reduce patrol timer, like the binary patch does.
- tweak readable-build-plate: fix unreadable truncation in unit pressure plate build ui.
- tweak stable-temp: fixes bug 6012; may improve FPS by 50-100% on a slow item-heavy fort.
- tweak fast-heat: speeds up item heating & cooling, thus making stable-temp act faster.
- tweak fix-dimensions: fixes subtracting small amounts from stacked liquids etc.
- tweak advmode-contained: fixes UI bug in custom reactions with container inputs in advmode.
- tweak fast-trade: Shift-Enter for selecting items quckly in Trade and Move to Depot screens.
- tweak military-stable-assign: Stop rightmost list of military->Positions from jumping to top.
- tweak military-color-assigned: In same list, color already assigned units in brown & green.
New scripts:
- fixnaked: removes thoughts about nakedness.
- setfps: set FPS cap at runtime, in case you want slow motion or speed-up.
- siren: wakes up units, stops breaks and parties - but causes bad thoughts.
- fix/population-cap: run after every migrant wave to prevent exceeding the cap.
- fix/stable-temp: counts items with temperature updates; does instant one-shot stable-temp.
- fix/loyaltycascade: fix units allegiance, eg after ordering a dwarf merchant kill.
- deathcause: shows the circumstances of death for a given body.
- digfort: designate areas to dig from a csv file.
- drainaquifer: remove aquifers from the map.
- growcrops: cheat to make farm crops instantly grow.
- magmasource: continuously spawn magma from any map tile.
- removebadthoughts: delete all negative thoughts from your dwarves.
- slayrace: instakill all units of a given race, optionally with magma.
- superdwarf: per-creature fastdwarf.
New GUI scripts:
- gui/mechanisms: browse mechanism links of the current building.
- gui/room-list: browse other rooms owned by the unit when assigning one.
- gui/liquids: a GUI front-end for the liquids plugin.
- gui/rename: renaming stockpiles, workshops and units via an in-game dialog.
- gui/power-meter: front-end for the Power Meter plugin.
- gui/siege-engine: front-end for the Siege Engine plugin.
- gui/choose-weapons: auto-choose matching weapons in the military equip screen.
Autolabor plugin:
- can set nonidle hauler percentage.
- broker excluded from all labors when needed at depot.
- likewise, anybody with a scheduled diplomat meeting.
New Dwarf Manipulator plugin:
Open the unit list, and press 'l' to access a Dwarf Therapist like UI in the game.
New Steam Engine plugin:
Dwarven Water Reactors don't make any sense whatsoever and cause lag, so this may be
a replacement for those concerned by it. The plugin detects if a workshop with a
certain name is in the raws used by the current world, and provides the necessary
behavior. See hack/raw/*_steam_engine.txt for the necessary raw definitions.
Note: Stuff like animal treadmills might be more period, but absolutely can't be
done with tools dfhack has access to.
New Power Meter plugin:
When activated, implements a pressure plate modification that detects power in gear
boxes built on the four adjacent N/S/W/E tiles. The gui/power-meter script implements
the necessary build configuration UI.
New Siege Engine plugin:
When enabled and configured via gui/siege-engine, allows aiming siege engines
at a designated rectangular area with 360 degree fire range and across Z levels;
this works by rewriting the projectile trajectory immediately after it appears.
Also supports loading catapults with non-boulder projectiles, taking from a stockpile,
and restricting operator skill range like with ordinary workshops.
Disclaimer: not in any way to undermine the future siege update from Toady, but
the aiming logic of existing engines hasn't been updated since 2D, and is almost
useless above ground :(. Again, things like making siegers bring their own engines
is totally out of the scope of dfhack and can only be done by Toady.
New Add Spatter plugin:
Detects reactions with certain names in the raws, and changes them from adding
improvements to adding item contaminants. This allows directly covering items
with poisons. The added spatters are immune both to water and 'clean items'.
Intended to give some use to all those giant cave spider poison barrels brought
by the caravans.

@ -0,0 +1,962 @@
.. comment
This is the changelog file for DFHack. If you add or change anything, note
it here under the heading "DFHack Future", in the appropriate section.
Items within each section are listed in alphabetical order to minimise merge
conflicts. Try to match the style and level of detail of the other entries.
Sections for each release are added as required, and consist solely of the
following in order as subheadings::
Internals
Lua
New [Internal Commands | Plugins | Scripts | Tweaks]
Fixes
Misc Improvements
Removed
When referring to a script, plugin, or command, use backticks (```) to
create a link to the relevant documentation - and check that the docs are
still up to date!
#########
Changelog
#########
.. contents::
:depth: 2
DFHack Future
=============
Internals
---------
- A method for caching screen output is now available to Lua (and C++)
- Developer plugins can be ignored on startup by setting the DFHACK_NO_DEV_PLUGINS environment variable
- The console on Linux and OS X now recognizes keyboard input between prompts
- JSON libraries available (C++ and Lua)
- More DFHack build information used in plugin version checks and available to plugins and lua scripts
- Fixed a rare overflow issue that could cause crashes on Linux and OS X
- Stopped DF window from receiving input when unfocused on OS X
- Fixed issues with keybindings involving Ctrl-A and Ctrl-Z, as well as Alt-E/U/N on OS X
- Multiple contexts can now be specified when adding keybindings
- Keybindings can now use F10-F12 and 0-9
- Plugin system is no longer restricted to plugins that exist on startup
- :file:`dfhack.init` file locations significantly generalized
Lua
---
- Scripts can be enabled with the built-in enable/disable commands
- A new function, reqscript(), is available as a safer alternative to script_environment()
- Lua viewscreens can choose not to intercept the OPTIONS keybinding
New internal commands
---------------------
- kill-lua: Interrupt running Lua scripts
- type: Show where a command is implemented
New plugins
-----------
- `confirm`: Adds confirmation dialogs for several potentially dangerous actions
- `fix-unit-occupancy`: Fixes issues with unit occupancy, such as faulty "unit blocking tile" messages (:bug:`3499`)
- title-version (formerly vshook): Display DFHack version on title screen
New scripts
-----------
- `burial`: sets all unowned coffins to allow burial ("-pets" to allow pets too)
- `deteriorateclothes`: make worn clothes on the ground wear far faster to boost FPS
- `deterioratecorpses`: make body parts wear away far faster to boost FPS
- `deterioratefood`: make food vanish after a few months if not used
- `fix-ster`: changes fertility/sterility of animals or dwarves
- `view-item-info`: adds information and customisable descriptions to item viewscreens
- `warn-starving`: check for starving, thirsty, or very drowsy units and pause with warning if any are found
- `modtools/create-unit`: create new units from nothing
- `modtools/equip-item`: a script to equip items on units
- `points`: set number of points available at embark screen
- `armoks-blessing`: Adjust all attributes, personality, age and skills of all dwarves in play
- `brainwash`: brainwash a dwarf (modifying their personality)
- `elevate-mental`: elevate all the mental attributes of a unit
- `elevate-physical`: elevate all the physical attributes of a unit
- `make-legendary`: modify skill(s) of a single unit
- `pref-adjust`: Adjust all preferences of all dwarves in play
- `rejuvenate`: make any "old" dwarf 20 years old
- `starvingdead`: make undead weaken after one month on the map, and crumble after six
New tweaks
----------
- embark-profile-name: Allows the use of lowercase letters when saving embark profiles
- kitchen-keys: Fixes DF kitchen meal keybindings
- kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences
- kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs
Fixes
-----
- Plugins with vmethod hooks can now be reloaded on OS X
- Lua's ``os.system()`` now works on OS X
- Fixed default arguments in Lua gametype detection functions
- Circular lua dependencies (reqscript/script_environment) fixed
- Prevented crash in ``Items::createItem()``
- `buildingplan`: Now supports hatch covers
- `gui/create-item`: fixed assigning quality to items, made :kbd:`Esc` work properly
- `gui/gm-editor`: handles lua tables properly
- help: now recognizes built-in commands, like "help"
- `manipulator`: fixed crash when selecting custom professions when none are found
- `remotefortressreader`: fixed crash when attempting to send map info when no map was loaded
- `search`: fixed crash in unit list after cancelling a job; fixed crash when disabling stockpile category after searching in a subcategory
- `stockpiles`: now checks/sanitizes filenames when saving
- `stocks`: fixed a crash when right-clicking
- `steam-engine`: fixed a crash on arena load; number keys (e.g. 2/8) take priority over cursor keys when applicable
- tweak fps-min fixed
- tweak farm-plot-select: Stopped controls from appearing when plots weren't fully built
- `workflow`: Fixed some issues with stuck jobs. Existing stuck jobs must be cancelled and re-added
- `zone`: Fixed a crash when using ``zone set`` (and a few other potential crashes)
Misc Improvements
-----------------
- DFHack documentation:
- massively reorganised, into files of more readable size
- added many missing entries
- indexes, internal links, offline search all documents
- includes documentation of linked projects (df-structures, 3rdparty scripts)
- better HTML generation with Sphinx
- documentation for scripts now located in source files
- `autolabor`:
- Stopped modification of labors that shouldn't be modified for brokers/diplomats
- Prioritize skilled dwarves more efficiently
- Prevent dwarves from running away with tools from previous jobs
- `dwarfmonitor`:
- widgets' positions, formats, etc. are now customizable (see Readme)
- weather display now separated from the date display
- New mouse cursor widget
- `gui/dfstatus`: Can enable/disable individual categories and customize metal bar list
- `full-heal`: "-r" option removes corpses
- `gui/gm-editor`
- Pointers can now be displaced
- Added some useful aliases: "item" for the selected item, "screen" for the current screen, etc.
- Now avoids errors with unrecognized types
- `gui/hack-wish`: renamed to `gui/create-item`
- "keybinding list" accepts a context
- `lever`:
- Lists lever names
- "lever pull" can be used to pull the currently-selected lever
- memview: Fixed display issue
- `modtools/create-item`: arguments are named more clearly, and you can specify the creator to be the unit with id ``df.global.unit_next_id-1`` (useful in conjunction with `modtools/create-unit`)
- nyan: Can now be stopped with dfhack-run
- plug: lists all plugins; shows state and number of commands in plugins
- `prospect`: works from within command-prompt
- `quicksave`: Restricted to fortress mode
- `remotefortressreader`: Exposes more information
- `search`:
- Supports noble suggestion screen (e.g. suggesting a baron)
- Supports fortress mode loo[k] menu
- Recognizes ? and ; keys
- `stocks`: can now match beginning and end of item names
- `teleport`: Fixed cursor recognition
- `tweak`:
- debug output now logged to stderr.log instead of console - makes DFHack start faster
- farm-plot-select: Fixed issues with selecting undiscovered crops
- `workflow`: Improved handling of plant reactions
Removed
-------
- `embark-tools` nano: 1x1 embarks are now possible in vanilla 0.40.24
DFHack 0.40.24-r3
=================
Internals
---------
- Ruby library now included on OSX - ruby scripts should work on OSX 10.10
- libstdc++ should work with older versions of OS X
- Added support for ``onLoadMap.init``/``onUnloadMap.init`` scripts
- game type detection functions are now available in the World module
- The DFHACK_LOG_MEM_RANGES environment variable can be used to log information to ``stderr.log`` on OS X
- Fixed adventure mode menu names
- Fixed command usage information for some commands
Lua
---
- Lua scripts will only be reloaded if necessary
- Added a ``df2console()`` wrapper, useful for printing DF (CP437-encoded) text to the console in a portable way
- Added a ``strerror()`` wrapper
New Internal Commands
---------------------
- `hide, show`: hide and show the console on Windows
- sc-script: Allows additional scripts to be run when certain events occur (similar to onLoad*.init scripts)
New Plugins
-----------
- `autohauler`: A hauling-only version of autolabor
New Scripts
-----------
- `modtools/reaction-product-trigger`: triggers callbacks when products are produced (contrast with when reactions complete)
New Tweaks
----------
- `fps-min <tweak>`: Fixes the in-game minimum FPS setting
- `shift-8-scroll <tweak>`: Gives Shift+8 (or ``*``) priority when scrolling menus, instead of scrolling the map
- `tradereq-pet-gender <tweak>`: Displays pet genders on the trade request screen
Fixes
-----
- Fixed game type detection in `3dveins`, `gui/create-item`, `reveal`, `seedwatch`
- PRELOAD_LIB: More extensible on Linux
- `add-spatter`, `eventful`: Fixed crash on world load
- `add-thought`: Now has a proper subthought arg.
- `building-hacks`: Made buildings produce/consume correct amount of power
- `fix-armory`: compiles and is available again (albeit with issues)
- `gui/gm-editor`: Added search option (accessible with "s")
- `hack-wish <gui/create-item>`: Made items stack properly.
- `modtools/skill-change`: Made level granularity work properly.
- `show-unit-syndromes`: should work
- `stockflow`:
- Fixed error message in Arena mode
- no longer checks the DF version
- fixed ballistic arrow head orders
- convinces the bookkeeper to update records more often'
- `zone`: Stopped crash when scrolling cage owner list
Misc Improvements
-----------------
- `autolabor`: A negative pool size can be specified to use the most unskilled dwarves
- `building-hacks`:
- Added a way to allow building to work even if it consumes more power than is available.
- Added setPower/getPower functions.
- `catsplosion`: Can now trigger pregnancies in (most) other creatures
- `exportlegends`: ``info`` and ``all`` options export ``legends_plus.xml`` with more data for legends utilities
- `manipulator`:
- Added ability to edit nicknames/profession names
- added "Job" as a View Type, in addition to "Profession" and "Squad"
- added custom profession templates with masking
- `remotefortressreader`: Exposes more information
DFHack 0.40.24-r2
=================
Internals
---------
- Lua scripts can set environment variables of each other with dfhack.run_script_with_env.
- Lua scripts can now call each others internal nonlocal functions with dfhack.script_environment(scriptName).functionName(arg1,arg2).
- `eventful`: Lua reactions no longer require LUA_HOOK as a prefix; you can register a callback for the completion of any reaction with a name
- Filesystem module now provides file access/modification times and can list directories (normally and recursively)
- Units Module: New functions::
isWar
isHunter
isAvailableForAdoption
isOwnCiv
isOwnRace
getRaceName
getRaceNamePlural
getRaceBabyName
getRaceChildName
isBaby
isChild
isAdult
isEggLayer
isGrazer
isMilkable
isTrainableWar
isTrainableHunting
isTamable
isMale
isFemale
isMerchant
isForest
isMarkedForSlaughter
- Buildings Module: New Functions::
isActivityZone
isPenPasture
isPitPond
isActive
findPenPitAt
Fixes
-----
- ``dfhack.run_script`` should correctly find save-specific scripts now.
- `add-thought`: updated to properly affect stress.
- `hfs-pit`: should work now
- `autobutcher`: takes gelding into account
- init.lua existence checks should be more reliable (notably when using non-English locales)
Misc Improvements
-----------------
Multiline commands are now possible inside dfhack.init scripts. See :file:`dfhack.init-example` for example usage.
DFHack 0.40.24-r1
=================
Internals
---------
CMake shouldn't cache DFHACK_RELEASE anymore. People may need to manually update/delete their CMake cache files to get rid of it.
DFHack 0.40.24-r0
=================
Internals
---------
- `EventManager`: fixed crash error with EQUIPMENT_CHANGE event.
- key modifier state exposed to Lua (ie :kbd:`Ctrl`, :kbd:`Alt`, :kbd:`Shift`)
Fixes
-----
``dfhack.sh`` can now be run from other directories on OSX
New Plugins
-----------
- `blueprint`: export part of your fortress to quickfort .csv files
New Scripts
-----------
- `hotkey-notes`: print key, name, and jump position of hotkeys
Removed
-------
- embark.lua
- needs_porting/*
Misc Improvements
-----------------
Added support for searching more lists
DFHack 0.40.23-r1
=================
Internals
- plugins will not be loaded if globals they specify as required are not located (should prevent some crashes)
Fixes
-----
- Fixed numerous (mostly Lua-related) crashes on OS X by including a more up-to-date libstdc++
- :kbd:`Alt` should no longer get stuck on Windows (and perhaps other platforms as well)
- `gui/advfort` works again
- `autobutcher`: takes sexualities into account
- devel/export-dt-ini: Updated for 0.40.20+
- `digfort`: now checks file type and existence
- `exportlegends`: Fixed map export
- `full-heal`: Fixed a problem with selecting units in the GUI
- `gui/hack-wish`: Fixed restrictive material filters
- `mousequery`: Changed box-select key to Alt+M
- `dwarfmonitor`: correct date display (month index, separator)
- `putontable`: added to the readme
- `siren` should work again
- stderr.log: removed excessive debug output on OS X
- `trackstop`: No longer prevents cancelling the removal of a track stop or roller.
- Fixed a display issue with ``PRINT_MODE:TEXT``
- Fixed a symbol error (MapExtras::BiomeInfo::MAX_LAYERS) when compiling DFHack in Debug mode
New Plugins
-----------
- `fortplan`: designate construction of (limited) buildings from .csv file, quickfort-style
New Scripts
-----------
- `gui/stockpiles`: an in-game interface for saving and loading stockpile settings files.
- `position`: Reports the current date, time, month, and season, plus some location info. Port/update of position.py
- `hfs-pit`: Digs a hole to hell under the cursor. Replaces needs_porting/hellhole.cpp
Removed
-------
- embark.lua: Obsolete, use `embark-tools`
New tweaks
----------
- `eggs-fertile <tweak>`: Displays an egg fertility indicator on nestboxes
- `max-wheelbarrow <tweak>`: Allows assigning more than 3 wheelbarrows to a stockpile
Misc Improvements
-----------------
- `embark-tools`: Added basic mouse support on the local map
- Made some adventure mode keybindings in :file:`dfhack.init-example` only work in adventure mode
- `gui/companion-order`: added a default keybinding
- further work on needs_porting
DFHack 0.40.19-r1
=================
Fixes
-----
- `modtools/reaction-trigger`: fixed typo
- `modtools/item-trigger`: should now work with item types
New plugins
-----------
- `savestock, loadstock <stocksettings>`: save and load stockpile settings across worlds and saves
New scripts
-----------
- `remove-stress`: set selected or all units unit to -1,000,000 stress (this script replaces removebadthoughts)
Misc improvements
-----------------
- `command-prompt`: can now access selected items, units, and buildings
- `autolabor`: add an optional talent pool parameter
DFHack 0.40.16-r1
=================
Internals
---------
- `EventManager` should handle INTERACTION triggers a little better. It still can get confused about who did what but only rarely.
- `EventManager` should no longer trigger REPORT events for old reports after loading a save.
- lua/persist-table: a convenient way of using persistent tables of arbitrary structure and dimension in Lua
Fixes
-----
- `mousequery`: Disabled when linking levers
- `stocks`: Melting should work now
- `full-heal`: Updated with proper argument handling
- `modtools/reaction-trigger-transition`: should produce the correct syntax now
- `superdwarf`: should work better now
- `forum-dwarves`: update for new df-structures changes
New Scripts
-----------
- `adaptation`: view or set the cavern adaptation level of your citizens
- `add-thought`: allows the user to add thoughts to creatures.
- `gaydar`: detect the sexual orientation of units on the map
- `markdown`: Save a copy of a text screen in markdown (for reddit among others).
- devel/all-bob: renames everyone Bob to help test interaction-trigger
Misc Improvements
-----------------
- `autodump`: Can now mark a stockpile for auto-dumping (similar to automelt and autotrade)
- `buildingplan`: Can now auto-allocate rooms to dwarves with specific positions (e.g. expedition leader, mayor)
- `dwarfmonitor`: now displays a weather indicator and date
- lua/syndrome-util, `modtools/add-syndrome`: now you can remove syndromes by SYN_CLASS
- No longer write empty :file:`.history` files
DFHack 0.40.15-r1
=================
Fixes
-----
- mousequery: Fixed behavior when selecting a tile on the lowest z-level
Misc Improvements
-----------------
- `EventManager`: deals with frame_counter getting reset properly now.
- `modtools/item-trigger`: fixed equip/unequip bug and corrected minor documentation error
- `teleport`: Updated with proper argument handling and proper unit-at-destination handling.
- `autotrade <Stockpile automation>`: Removed the newly obsolete :guilabel:`Mark all` functionality.
- `search`: Adapts to the new trade screen column width
- `tweak fast-trade <tweak>`: Switching the fast-trade keybinding to Shift-Up/Shift-Down, due to Select All conflict
DFHack 0.40.14-r1
=================
Internals
---------
- The DFHack console can now be disabled by setting the DFHACK_DISABLE_CONSOLE environment variable: ``DFHACK_DISABLE_CONSOLE=1 ./dfhack``
Fixes
-----
- Stopped duplicate load/unload events when unloading a world
- Stopped ``-e`` from being echoed when DFHack quits on Linux
- `automelt <Stockpile automation>`: now uses a faster method to locate items
- `autotrade <Stockpile automation>`: "Mark all" no longer double-marks bin contents
- `drain-aquifer`: new script replaces the buggy plugin
- `embark-tools`: no longer conflicts with keys on the notes screen
- `fastdwarf`: Fixed problems with combat/attacks
- `forum-dwarves`: should work now
- `manipulator`: now uses a stable sort, allowing sorting by multiple categories
- `rendermax`: updated to work with 0.40
New Plugins
-----------
- `trackstop`: Shows track stop friction and dump direction in its :kbd:`q` menu
New Tweaks
----------
- farm-plot-select: Adds "Select all" and "Deselect all" options to farm plot menus
- import-priority-category: Allows changing the priority of all goods in a category when discussing an import agreement with the liaison
- manager-quantity: Removes the limit of 30 jobs per manager order
- civ-view-agreement: Fixes overlapping text on the "view agreement" screen
- nestbox-color: Fixes the color of built nestboxes
Misc Improvements
-----------------
- `exportlegends`: can now handle site maps
DFHack 0.40.13-r1
=================
Internals
---------
- unified spatter structs
- added ruby df.print_color(color, string) method for dfhack console
Fixes
-----
- no more ``-e`` after terminating
- fixed `superdwarf`
DFHack 0.40.12-r1
=================
Internals
---------
- support for global :file:`onLoadWorld.init` and :file:`onUnloadWorld.init` files, called when loading and unloading a world
- Close file after loading a binary patch.
New Plugins
-----------
- `hotkeys`: Shows ingame viewscreen with all dfhack keybindings active in current mode.
- `automelt <Stockpile automation>`: allows marking stockpiles so any items placed in them will be designated for melting
Fixes
-----
- possible crash fixed for `gui/hack-wish`
- `search`: updated to not conflict with BUILDJOB_SUSPEND
- `workflow`: job_material_category -> dfhack_material_category
Misc Improvements
-----------------
- now you can use ``@`` to print things in interactive Lua with subtley different semantics
- optimizations for stockpiles for `autotrade <Stockpile automation>` and `stockflow`
- updated `exportlegends` to work with new maps, dfhack 40.11 r1+
DFHack 0.40.11-r1
=================
Internals
- Plugins on OS X now use ``.plug.dylib` as an extension instead of ``.plug.so``
Fixes
-----
- `3dveins`: should no longer hang/crash on specific maps
- `autotrade <Stockpile automation>`, `search`: fixed some layout issues
- `deathcause`: updated
- `gui/hack-wish`: should work now
- `reveal`: no longer allocates data for nonexistent map blocks
- Various documentation fixes and updates
DFHack v0.40.10-r1
==================
A few bugfixes.
DFHack v0.40.08-r2
==================
Internals
---------
- supported per save script folders
- Items module: added createItem function
- Sorted CMakeList for plugins and plugins/devel
- diggingInvaders no longer builds if plugin building is disabled
- `EventManager`: EQUIPMENT_CHANGE now triggers for new units. New events::
ON_REPORT
UNIT_ATTACK
UNLOAD
INTERACTION
New Scripts
-----------
- lua/repeat-util: makes it easier to make things repeat indefinitely
- lua/syndrome-util: makes it easier to deal with unit syndromes
- forum-dwarves: helps copy df viewscreens to a file
- full-heal: fully heal a unit
- remove-wear: removes wear from all items in the fort
- repeat: repeatedly calls a script or a plugin
- ShowUnitSyndromes: shows syndromes affecting units and other relevant info
- teleport: teleports units
- devel/print-args
- fix/blood-del: makes it so civs don't bring barrels full of blood ichor or goo
- fix/feeding-timers: reset the feeding timers of all units
- gui/hack-wish: creates items out of any material
- gui/unit-info-viewer: displays information about units
- modtools/add-syndrome: add a syndrome to a unit or remove one
- modtools/anonymous-script: execute an lua script defined by a string. Useful for the ``*-trigger`` scripts.
- modtools/force: forces events: caravan, migrants, diplomat, megabeast, curiousbeast, mischievousbeast, flier, siege, nightcreature
- modtools/item-trigger: triggers commands based on equipping, unequipping, and wounding units with items
- modtools/interaction-trigger: triggers commands when interactions happen
- modtools/invader-item-destroyer: destroys invaders' items when they die
- modtools/moddable-gods: standardized version of Putnam's moddable gods script
- modtools/projectile-trigger: standardized version of projectileExpansion
- modtools/reaction-trigger: trigger commands when custom reactions complete; replaces autoSyndrome
- modtools/reaction-trigger-transition: a tool for converting mods from autoSyndrome to reaction-trigger
- modtools/random-trigger: triggers random scripts that you register
- modtools/skill-change: for incrementing and setting skills
- modtools/spawn-flow: creates flows, like mist or dragonfire
- modtools/syndrome-trigger: trigger commands when syndromes happen
- modtools/transform-unit: shapeshifts a unit, possibly permanently
Misc improvements
-----------------
- new function in utils.lua for standardized argument processing
Removed
-------
- digmat.rb: digFlood does the same functionality with less FPS impact
- scripts/invasionNow: scripts/modtools/force.lua does it better
- autoSyndrome replaced with scripts/modtools/reaction-trigger.lua
- syndromeTrigger replaced with scripts/modtools/syndrome-trigger.lua
- devel/printArgs plugin converted to scripts/devel/print-args.lua
- outsideOnly plugin replaced by modtools/outside-only
DFHack v0.40.08-r1
==================
Was a mistake. Don't use it.
DFHack v0.34.11-r5
==================
Internals
---------
- support for calling a lua function via a protobuf request (demonstrated by dfhack-run --lua).
- support for basic filesystem operations (e.g. chdir, mkdir, rmdir, stat) in C++ and Lua
- Lua API for listing files in directory. Needed for mod-manager.
- Lua API for creating unit combat reports and writing to gamelog.
- Lua API for running arbitrary DFHack commands
- support for multiple ``raw/init.d/*.lua`` init scripts in one save.
- eventful now has a more friendly way of making custom sidebars
- on Linux and OSX the console now supports moving the cursor back and forward by a whole word.
New scripts
-----------
- gui/mod-manager: allows installing/uninstalling mods into df from df/mods directory.
- gui/clone-uniform: duplicates the currently selected uniform in the military screen.
- fix/build-location: partial work-around for bug 5991 (trying to build wall while standing on it)
- undump-buildings: removes dump designation from materials used in buildings.
- exportlegends: exports data from legends mode, allowing a set-and-forget export of large worlds.
- log-region: each time a fort is loaded identifying information will be written to the gamelog.
- dfstatus: show an overview of critical stock quantities, including food, drinks, wood, and bars.
- command-prompt: a dfhack command prompt in df.
New plugins
-----------
- rendermax: replace the renderer with something else, eg ``rendermax light``- a lighting engine
- automelt: allows marking stockpiles for automelt (i.e. any items placed in stocpile will be designated for melting)
- embark-tools: implementations of Embark Anywhere, Nano Embark, and a few other embark-related utilities
- building-hacks: Allows to add custom functionality and/or animations to buildings.
- petcapRemover: triggers pregnancies in creatures so that you can effectively raise the default pet population cap
- 'plant create': spawn a new shrub under the cursor
New tweaks
----------
- craft-age-wear: make crafted items wear out with time like in old versions (bug 6003)
- adamantine-cloth-wear: stop adamantine clothing from wearing out (bug 6481)
- confirm-embark: adds a prompt before embarking (on the "prepare carefully" screen)
Misc improvements
-----------------
- plant: move the 'grow', 'extirpate' and 'immolate' commands as 'plant' subcommands
- digfort: improved csv parsing, add start() comment handling
- exterminate: allow specifying a caste (exterminate gob:male)
- createitem: in adventure mode it now defaults to the controlled unit as maker.
- autotrade: adds "(Un)mark All" options to both panes of trade screen.
- mousequery: several usability improvements.
- mousequery: show live overlay (in menu area) of what's on the tile under the mouse cursor.
- search: workshop profile search added.
- dwarfmonitor: add screen to summarise preferences of fortress dwarfs.
- getplants: add autochop function to automate woodcutting.
- stocks: added more filtering and display options.
- Siege engine plugin:
- engine quality and distance to target now affect accuracy
- firing the siege engine at a target produces a combat report
- improved movement speed computation for meandering units
- operators in Prepare To Fire mode are released from duty once hungry/thirsty if there is a free replacement
DFHack v0.34.11-r4
==================
New commands
------------
- diggingInvaders - allows invaders to dig and/or deconstruct walls and buildings in order to get at your dwarves.
- digFlood - automatically dig out specified veins as they are revealed
- enable, disable - Built-in commands that can be used to enable/disable many plugins.
- restrictice - Restrict traffic on squares above visible ice.
- restrictliquid - Restrict traffic on every visible square with liquid.
- treefarm - automatically chop trees and dig obsidian
New Scripts
-----------
- autobutcher: A GUI front-end for the autobutcher plugin.
- invasionNow: trigger an invasion, or many
- locate_ore: scan the map for unmined ore veins
- masspit: designate caged creatures in a zone for pitting
- multicmd: run a sequence of dfhack commands, separated by ';'
- startdwarf: change the number of dwarves for a new embark
- digmat: dig veins/layers tile by tile, as discovered
Misc improvements
-----------------
- autoSyndrome:
- disable by default
- reorganized special tags
- minimized error spam
- reset policies: if the target already has an instance of the syndrome you can skip,
add another instance, reset the timer, or add the full duration to the time remaining
- core: fix SC_WORLD_(UN)LOADED event for arena mode
- exterminate: renamed from slayrace, add help message, add butcher mode
- fastdwarf: fixed bug involving fastdwarf and teledwarf being on at the same time
- magmasource: rename to ``source``, allow water/magma sources/drains
- ruby: add df.dfhack_run "somecommand"
- syndromeTrigger: replaces and extends trueTransformation. Can trigger things when syndromes are added for any reason.
- tiletypes: support changing tile material to arbitrary stone.
- workNow: can optionally look for jobs when jobs are completed
New tweaks
----------
- hive-crash: Prevent crash if bees die in a hive with ungathered products (bug 6368).
New plugins
-----------
- 3dveins: Reshapes all veins on the map in a way that flows between Z levels. May be unstable. Backup before using.
- autotrade: Automatically send items in marked stockpiles to trade depot, when trading is possible.
- buildingplan: Place furniture before it's built
- dwarfmonitor: Records dwarf activity to measure fort efficiency
- mousequery: Look and poke at the map elements with the mouse.
- outsideOnly: make raw-specified buildings impossible to build inside
- resume: A plugin to help display and resume suspended constructions conveniently
- stocks: An improved stocks display screen.
Internals
---------
- Core: there is now a per-save dfhack.init file for when the save is loaded, and another for when it is unloaded
- EventManager: fixed job completion detection, fixed removal of TICK events, added EQUIPMENT_CHANGE event
- Lua API for a better random number generator and perlin noise functions.
- Once: easy way to make sure something happens once per run of DF, such as an error message
DFHack v0.34.11-r3
==================
Internals
---------
- support for displaying active keybindings properly.
- support for reusable widgets in lua screen library.
- Maps::canStepBetween: returns whether you can walk between two tiles in one step.
- EventManager: monitors various in game events centrally so that individual plugins
don't have to monitor the same things redundantly.
- Now works with OSX 10.6.8
Notable bugfixes
----------------
- autobutcher can be re-enabled again after being stopped.
- stopped Dwarf Manipulator from unmasking vampires.
- Stonesense is now fixed on OSX
Misc improvements
-----------------
- fastdwarf: new mode using debug flags, and some internal consistency fixes.
- added a small stand-alone utility for applying and removing binary patches.
- removebadthoughts: add --dry-run option
- superdwarf: work in adventure mode too
- tweak stable-cursor: carries cursor location from/to Build menu.
- deathcause: allow selection from the unitlist screen
- slayrace: allow targetting undeads
- Workflow plugin:
- properly considers minecarts assigned to routes busy.
- code for deducing job outputs rewritten in lua for flexibility.
- logic fix: collecting webs produces silk, and ungathered webs are not thread.
- items assigned to squads are considered busy, even if not in inventory.
- shearing and milking jobs are supported, but only with generic MILK or YARN outputs.
- workflow announces when the stock level gets very low once a season.
- Auto syndrome plugin: A way of automatically applying boiling rock syndromes and calling dfhack commands controlled by raws.
- Infinite sky plugin: Create new z-levels automatically or on request.
- True transformation plugin: A better way of doing permanent transformations that allows later transformations.
- Work now plugin: Makes the game assign jobs every time you pause.
New tweaks
----------
- tweak military-training: speed up melee squad training up to 10x (normally 3-5x).
New scripts
-----------
- binpatch: the same as the stand-alone binpatch.exe, but works at runtime.
- region-pops: displays animal populations of the region and allows tweaking them.
- lua: lua interpreter front-end converted to a script from a native command.
- dfusion: misc scripts with a text based menu.
- embark: lets you embark anywhere.
- lever: list and pull fort levers from the dfhack console.
- stripcaged: mark items inside cages for dumping, eg caged goblin weapons.
- soundsense-season: writes the correct season to gamelog.txt on world load.
- create-items: spawn items
- fix/cloth-stockpile: fixes bug 5739; needs to be run after savegame load every time.
New GUI scripts
---------------
- gui/guide-path: displays the cached path for minecart Guide orders.
- gui/workshop-job: displays inputs of a workshop job and allows tweaking them.
- gui/workflow: a front-end for the workflow plugin (part inspired by falconne).
- gui/assign-rack: works together with a binary patch to fix weapon racks.
- gui/gm-editor: an universal editor for lots of dfhack things.
- gui/companion-order: a adventure mode command interface for your companions.
- gui/advfort: a way to do jobs with your adventurer (e.g. build fort).
New binary patches
------------------
(for use with binpatch)
- armorstand-capacity: doubles the capacity of armor stands.
- custom-reagent-size: lets custom reactions use small amounts of inputs.
- deconstruct-heapfall: stops some items still falling on head when deconstructing.
- deconstruct-teleport: stops items from 16x16 block teleporting when deconstructing.
- hospital-overstocking: stops hospital overstocking with supplies.
- training-ammo: lets dwarves with quiver full of combat-only ammo train.
- weaponrack-unassign: fixes bug that negates work done by gui/assign-rack.
New Plugins
-----------
- fix-armory: Together with a couple of binary patches and the gui/assign-rack script, this plugin makes weapon racks, armor stands, chests and cabinets in properly designated barracks be used again for storage of squad equipment.
- search: Adds an incremental search function to the Stocks, Trading, Stockpile and Unit List screens.
- automaterial: Makes building constructions (walls, floors, fortifications, etc) a little bit easier by saving you from having to trawl through long lists of materials each time you place one.
- Dfusion: Reworked to make use of lua modules, now all the scripts can be used from other scripts.
- Eventful: A collection of lua events, that will allow new ways to interact with df world.
DFHack v0.34.11-r2
==================
Internals
---------
- full support for Mac OS X.
- a plugin that adds scripting in ruby.
- support for interposing virtual methods in DF from C++ plugins.
- support for creating new interface screens from C++ and lua.
- added various other API functions.
Notable bugfixes
----------------
- better terminal reset after exit on linux.
- seedwatch now works on reclaim.
- the sort plugin won't crash on cages anymore.
Misc improvements
-----------------
- autodump: can move items to any walkable tile, not just floors.
- stripcaged: by default keep armor, new dumparmor option.
- zone: allow non-domesticated birds in nestboxes.
- workflow: quality range in constraints.
- cleanplants: new command to remove rain water from plants.
- liquids: can paint permaflow, i.e. what makes rivers power water wheels.
- prospect: pre-embark prospector accounts for caves & magma sea in its estimate.
- rename: supports renaming stockpiles, workshops, traps, siege engines.
- fastdwarf: now has an additional option to make dwarves teleport to their destination.
- Autolabor plugin:
- can set nonidle hauler percentage.
- broker excluded from all labors when needed at depot.
- likewise, anybody with a scheduled diplomat meeting.
New commands
------------
- misery: multiplies every negative thought gained (2x by default).
- digtype: designates every tile of the same type of vein on the map for 'digging' (any dig designation).
New tweaks
----------
- tweak stable-cursor: keeps exact cursor position between d/k/t/q/v etc menus.
- tweak patrol-duty: makes Train orders reduce patrol timer, like the binary patch does.
- tweak readable-build-plate: fix unreadable truncation in unit pressure plate build ui.
- tweak stable-temp: fixes bug 6012; may improve FPS by 50-100% on a slow item-heavy fort.
- tweak fast-heat: speeds up item heating & cooling, thus making stable-temp act faster.
- tweak fix-dimensions: fixes subtracting small amounts from stacked liquids etc.
- tweak advmode-contained: fixes UI bug in custom reactions with container inputs in advmode.
- tweak fast-trade: Shift-Enter for selecting items quckly in Trade and Move to Depot screens.
- tweak military-stable-assign: Stop rightmost list of military->Positions from jumping to top.
- tweak military-color-assigned: In same list, color already assigned units in brown & green.
New scripts
-----------
- fixnaked: removes thoughts about nakedness.
- setfps: set FPS cap at runtime, in case you want slow motion or speed-up.
- siren: wakes up units, stops breaks and parties - but causes bad thoughts.
- fix/population-cap: run after every migrant wave to prevent exceeding the cap.
- fix/stable-temp: counts items with temperature updates; does instant one-shot stable-temp.
- fix/loyaltycascade: fix units allegiance, eg after ordering a dwarf merchant kill.
- deathcause: shows the circumstances of death for a given body.
- digfort: designate areas to dig from a csv file.
- drainaquifer: remove aquifers from the map.
- growcrops: cheat to make farm crops instantly grow.
- magmasource: continuously spawn magma from any map tile.
- removebadthoughts: delete all negative thoughts from your dwarves.
- slayrace: instakill all units of a given race, optionally with magma.
- superdwarf: per-creature fastdwarf.
- gui/mechanisms: browse mechanism links of the current building.
- gui/room-list: browse other rooms owned by the unit when assigning one.
- gui/liquids: a GUI front-end for the liquids plugin.
- gui/rename: renaming stockpiles, workshops and units via an in-game dialog.
- gui/power-meter: front-end for the Power Meter plugin.
- gui/siege-engine: front-end for the Siege Engine plugin.
- gui/choose-weapons: auto-choose matching weapons in the military equip screen.
New Plugins
-----------
- Dwarf Manipulator: Open the unit list, and press 'l' to access a Dwarf Therapist like UI in the game.
- Steam Engine:
Dwarven Water Reactors don't make any sense whatsoever and cause lag, so this may be
a replacement for those concerned by it. The plugin detects if a workshop with a
certain name is in the raws used by the current world, and provides the necessary
behavior. See ``hack/raw/*_steam_engine.txt`` for the necessary raw definitions.
Note: Stuff like animal treadmills might be more period, but absolutely can't be
done with tools dfhack has access to.
- Power Meter:
When activated, implements a pressure plate modification that detects power in gear
boxes built on the four adjacent N/S/W/E tiles. The gui/power-meter script implements
the necessary build configuration UI.
- Siege Engine:
When enabled and configured via gui/siege-engine, allows aiming siege engines
at a designated rectangular area with 360 degree fire range and across Z levels;
this works by rewriting the projectile trajectory immediately after it appears.
Also supports loading catapults with non-boulder projectiles, taking from a stockpile,
and restricting operator skill range like with ordinary workshops.
Disclaimer: not in any way to undermine the future siege update from Toady, but
the aiming logic of existing engines hasn't been updated since 2D, and is almost
useless above ground :(. Again, things like making siegers bring their own engines
is totally out of the scope of dfhack and can only be done by Toady.
- Add Spatter:
Detects reactions with certain names in the raws, and changes them from adding
improvements to adding item contaminants. This allows directly covering items
with poisons. The added spatters are immune both to water and 'clean items'.
Intended to give some use to all those giant cave spider poison barrels brought
by the caravans.

@ -4,13 +4,13 @@
<html lang="en-US"> <html lang="en-US">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url=./docs/html/README.html"> <meta http-equiv="refresh" content="0;url=./docs/html/index.html">
<script type="text/javascript"> <script type="text/javascript">
window.location.href = "./docs/html/README.html" window.location.href = "./docs/html/index.html"
</script> </script>
<title>Page Redirection</title> <title>Page Redirection</title>
</head> </head>
<body> <body>
If you are not redirected automatically, follow the <a href='./docs/html/README.html'>link to the documentation.</a> Follow this <a href='./docs/html/index.html'>link to the documentation.</a>
</body> </body>
</html> </html>

@ -0,0 +1,24 @@
#DFHack Readme
[![Build Status](https://travis-ci.org/DFHack/dfhack.svg?branch=develop)]
(https://travis-ci.org/DFHack/dfhack)
[![Documentation Status](https://readthedocs.org/projects/dfhack/badge)]
(https://dfhack.readthedocs.org)
[![License](https://img.shields.io/badge/license-ZLib-blue.svg)]
(https://en.wikipedia.org/wiki/Zlib_License)
[![Github Issues](http://githubbadges.herokuapp.com/DFHack/dfhack/issues)]
(https://github.com/DFHack/dfhack/issues)
[![Open Pulls](http://githubbadges.herokuapp.com/DFHack/dfhack/pulls)]
(https://github.com/DFHack/dfhack/pulls)
DFHack is a Dwarf Fortress memory access library, distributed with scripts
and plugins implementing a wide variety of useful functions and tools.
The full documentation [is available online here](https://dfhack.readthedocs.org),
from the README.html page in the DFHack distribution, or as raw text in the `./docs` folder.
If you're an end-user, modder, or interested in contributing to DFHack -
go read those docs.
If that's unclear or you need more help, try [the Bay12 forums thread]
(http://www.bay12forums.com/smf/index.php?topic=139553) or the #dfhack IRC
channel on freenode.

@ -14,39 +14,80 @@
# serve to show the default. # serve to show the default.
import fnmatch import fnmatch
import io from io import open
import os import os
import shlex import shlex
import sys import sys
import shutil
from os import listdir
from os.path import isfile, join, isdir
#import sys
currentDir = '@CMAKE_CURRENT_SOURCE_DIR@' def doc_dir(dirname, files):
"""Yield (command, includepath) for each script in the directory."""
def makeIncludeAll(directory, extension): sdir = os.path.relpath(dirname, '.').replace('\\', '/').replace('../', '')
outputFile = join(directory,'include-all.rst')
#print(outputFile)
files = [ f for f in listdir(directory) if isfile(join(directory,f)) and f.endswith(extension) ]
files.sort()
out = open(outputFile, 'w')
for f in files: for f in files:
#TODO: check if the file contains the BEGIN_DOCS string if f[-3:] not in {'lua', '.rb'}:
#print(join(directory,f)) continue
fstream = io.open(join(directory,f), 'r', encoding='utf8') with open(os.path.join(dirname, f), 'r', encoding='utf8') as fstream:
data = fstream.read().replace('\n','') text = [l.rstrip() for l in fstream.readlines() if l.strip()]
fstream.close() command = None
if 'BEGIN_DOCS' in data: for line in text:
out.write('.. include:: ' + join(directory,f) + '\n :start-after: BEGIN_DOCS\n :end-before: END_DOCS\n\n') if line == len(line) * '=':
out.close() if command is not None:
yield command, sdir + '/' + f
def makeAllIncludeAll(directory, extension): break
for root, subdirs, files in os.walk(directory): command = line
if isdir(root): # later, print an error for missing docs here
makeIncludeAll(root, extension)
makeAllIncludeAll(currentDir + '/scripts', '.lua') def document_scripts():
"""Autodoc for files with the magic script documentation marker strings.
Creates a file for eack kind of script (base/devel/fix/gui/modtools)
with all the ".. include::" directives to pull out docs between the
magic strings.
"""
# First, we collect the commands and paths to include in our docs
scripts = []
for root, _, files in os.walk('scripts'):
scripts.extend(doc_dir(root, files))
# Next we split by type and create include directives sorted by command
kinds = {'base': [], 'devel': [], 'fix': [], 'gui': [], 'modtools': []}
for s in scripts:
k_fname = s[0].split('/', 1)
if len(k_fname) == 1:
kinds['base'].append(s)
else:
kinds.get(k_fname[0], []).append(s)
template = ('.. _{}:\n\n'
'.. include:: /{}\n'
' :start-after: =begin\n'
' :end-before: =end\n')
for key, value in kinds.items():
kinds[key] = [template.format(x[0], x[1])
for x in sorted(value, key=lambda x: x[0])]
# Finally, we write our _auto/* files for each kind of script
if not os.path.isdir('docs/_auto'):
os.mkdir('docs/_auto')
head = {
'base': 'Basic Scripts',
'devel': 'Development Scripts',
'fix': 'Bugfixing Scripts',
'gui': 'GUI Scripts',
'modtools': 'Scripts for Modders'}
for k in head:
title = ('.. _{k}:\n\n{l}\n{t}\n{l}\n\n'
'.. include:: /scripts/{a}about.txt\n\n'
'.. contents::\n\n').format(
k=k, t=head[k], l=len(head[k])*'#', a=('' if k=='base' else k+'/'))
mode = 'w' if sys.version_info.major > 2 else 'wb'
with open('docs/_auto/{}.rst'.format(k), mode) as outfile:
outfile.write(title)
outfile.write('\n\n'.join(kinds[k]))
# Actually call the docs generator
document_scripts()
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
@ -61,7 +102,21 @@ makeAllIncludeAll(currentDir + '/scripts', '.lua')
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [] extensions = ['sphinx.ext.extlinks']
# This config value must be a dictionary of external sites, mapping unique
# short alias names to a base URL and a prefix.
# See http://sphinx-doc.org/ext/extlinks.html
extlinks = {
'wiki': ('http://dwarffortresswiki.org/%s', ''),
'forums': ('http://www.bay12forums.com/smf/index.php?topic=%s',
'Bay12 forums thread '),
'dffd': ('http://dffd.bay12games.com/file.php?id=%s', 'DFFD file '),
'bug': ('http://www.bay12games.com/dwarves/mantisbt/view.php?id=%s',
'Bug ')
}
# some aliases for link directives
extlinks['forum'] = extlinks['forums']
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = [] templates_path = []
@ -75,7 +130,7 @@ source_suffix = '.rst'
#source_encoding = 'utf-8-sig' #source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'README' master_doc = 'index'
# General information about the project. # General information about the project.
project = 'DFHack' project = 'DFHack'
@ -86,25 +141,26 @@ author = 'The DFHack Team'
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
#def get_version(): def get_version():
# """Return the DFHack version string, from CMakeLists.txt""" """Return the DFHack version string, from CMakeLists.txt"""
# version, release = '', '' version = release = ''
# with open('CMakeLists.txt') as f: try:
# for s in f.readlines(): with open('../CMakeLists.txt') as f:
# if fnmatch.fnmatch(s.upper(), 'SET(DF_VERSION "?.??.??")\n'): for s in f.readlines():
# version = s.upper().replace('SET(DF_VERSION "', '') if fnmatch.fnmatch(s.upper(), 'SET(DF_VERSION "?.??.??")\n'):
# elif fnmatch.fnmatch(s.upper(), 'SET(DFHACK_RELEASE "r*")\n'): version = s.upper().replace('SET(DF_VERSION "', '')
# release = s.upper().replace('SET(DFHACK_RELEASE "', '').lower() elif fnmatch.fnmatch(s.upper(), 'SET(DFHACK_RELEASE "r*")\n'):
# return (version + '-' + release).replace('")\n', '') release = s.upper().replace('SET(DFHACK_RELEASE "', '').lower()
return (version + '-' + release).replace('")\n', '')
except IOError:
return 'unknown'
# The short X.Y version. # The short X.Y version.
version = '@DFHACK_VERSION@'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '@DFHACK_VERSION@' version = release = get_version()
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs. # This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases. # Usually you set "language" from the command line for these cases.
language = None language = None
@ -117,11 +173,11 @@ language = None
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
exclude_patterns = ['docs/_build/*', 'depends/*'] exclude_patterns = ['docs/_build/*', 'depends/*', 'scripts/3rdparty/*']
# The reST default role (used for this markup: `text`) to use for all # The reST default role (used for this markup: `text`) to use for all
# documents. # documents.
default_role = 'any' default_role = 'ref'
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True #add_function_parentheses = True
@ -130,16 +186,9 @@ default_role = 'any'
# unit titles (such as .. function::). # unit titles (such as .. function::).
#add_module_names = True #add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents. # If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False #keep_warnings = False
@ -151,12 +200,19 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = '@SPHINX_THEME@' html_theme = 'alabaster'
html_style = 'dfhack.css'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
# documentation. # documentation.
#html_theme_options = {} html_theme_options = {
#'logo': 'logo.png',
'github_user': 'DFHack',
'github_repo': 'dfhack',
'github_button': False,
'travis_button': False,
}
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = [] #html_theme_path = []
@ -166,7 +222,7 @@ html_theme = '@SPHINX_THEME@'
#html_title = None #html_title = None
# A shorter title for the navigation bar. Default is the same as html_title. # A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None html_short_title = 'DFHack Docs'
# The name of an image file (relative to this directory) to place at the top # The name of an image file (relative to this directory) to place at the top
# of the sidebar. # of the sidebar.
@ -175,12 +231,12 @@ html_theme = '@SPHINX_THEME@'
# The name of an image file (within the static path) to use as favicon of the # The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large. # pixels large.
html_favicon = 'dfhack-icon.ico' html_favicon = 'docs/styles/dfhack-icon.ico'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['../images'] html_static_path = ['docs/styles']
# Add any extra paths that contain custom files (such as robots.txt or # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied
@ -196,17 +252,24 @@ html_static_path = ['../images']
#html_use_smartypants = True #html_use_smartypants = True
# Custom sidebar templates, maps document names to template names. # Custom sidebar templates, maps document names to template names.
#html_sidebars = {} html_sidebars = {
'**': [
'about.html',
'localtoc.html',
'relations.html',
'searchbox.html',
]
}
# Additional templates that should be rendered to pages, maps page names to # Additional templates that should be rendered to pages, maps page names to
# template names. # template names.
#html_additional_pages = {} #html_additional_pages = {}
# If false, no module index is generated. # If false, no module index is generated.
#html_domain_indices = True html_domain_indices = False
# If false, no index is generated. # If false, no index is generated.
#html_use_index = True html_use_index = False
# If true, the index is split into individual pages for each letter. # If true, the index is split into individual pages for each letter.
#html_split_index = False #html_split_index = False
@ -234,10 +297,6 @@ html_static_path = ['../images']
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
#html_search_language = 'en' #html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that # The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used. # implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js' #html_search_scorer = 'scorer.js'

@ -7,7 +7,7 @@ Patching the DF binary
Writing scripts and plugins for DFHack is not the only way to modify Dwarf Writing scripts and plugins for DFHack is not the only way to modify Dwarf
Fortress. Before DFHack, it was common for tools to manually patch the Fortress. Before DFHack, it was common for tools to manually patch the
binary to change behaviour, and DFHack still contains tools to do this via binary to change behaviour, and DFHack still contains tools to do this via
the `scripts/binpatch` command. the `binpatch` command.
.. warning:: .. warning::
@ -45,7 +45,7 @@ There are two methods to apply a patch.
Patching at runtime Patching at runtime
------------------- -------------------
The `scripts/binpatch` script checks, applies or removes binary patches The `binpatch` script checks, applies or removes binary patches
directly in memory at runtime:: directly in memory at runtime::
binpatch [check|apply|remove] <patchname> binpatch [check|apply|remove] <patchname>
@ -107,7 +107,7 @@ armor stands, and in containers.
.. note:: .. note::
In order to actually be used, weapon racks have to be patched and In order to actually be used, weapon racks have to be patched and
manually assigned to a squad. See `scripts/gui/assign-rack`. manually assigned to a squad. See `gui/assign-rack`.
Note that the buildings in the armory are used as follows: Note that the buildings in the armory are used as follows:
@ -171,7 +171,7 @@ work again. The existing issues are:
.. _`the bug report`: http://www.bay12games.com/dwarves/mantisbt/view.php?id=1445 .. _`the bug report`: http://www.bay12games.com/dwarves/mantisbt/view.php?id=1445
* Haulers still take equipment stored in the armory away to the stockpiles, * Haulers still take equipment stored in the armory away to the stockpiles,
unless `plugins/fix-armory` is used. unless `fix-armory` is used.
The script interface simply lets you designate one of the squads that The script interface simply lets you designate one of the squads that
are assigned to the barracks/armory containing the selected stand as are assigned to the barracks/armory containing the selected stand as

@ -1,7 +0,0 @@
#########
Changelog
#########
.. contents::
.. include:: ../NEWS

@ -83,7 +83,7 @@ documentation is built with Sphinx, which runs automatically at compile time.
DFHack consists of variously licensed code, but invariably weak copyleft. DFHack consists of variously licensed code, but invariably weak copyleft.
The main license is zlib/libpng, some bits are MIT licensed, and some are The main license is zlib/libpng, some bits are MIT licensed, and some are
BSD licensed. See the ``LICENSE`` document for more information. BSD licensed. See the `license` for more information.
Feel free to add your own extensions and plugins. Contributing back to Feel free to add your own extensions and plugins. Contributing back to
the DFHack repository is welcome and the right thing to do :) the DFHack repository is welcome and the right thing to do :)
@ -118,14 +118,39 @@ comprehensive interface for visualisers such as Armok Vision.
Documentation Standards Documentation Standards
======================= =======================
DFHack documentation is built with Sphinx, and configured automatically
through CMake. If you want to build the docs *only*, use this command::
sphinx-build . docs/html
Whether you're adding new code or just fixing old documentation (and there's plenty), Whether you're adding new code or just fixing old documentation (and there's plenty),
there are a few important standards for completeness and consistent style. Treat there are a few important standards for completeness and consistent style. Treat
this section as a guide rather than iron law, match the surrounding text, and you'll this section as a guide rather than iron law, match the surrounding text, and you'll
be fine. be fine.
Every script, plugin, or command should be documented. This is an active project, Everything should be documented! For plugins, it's a work in progress - use
and the best place to put this documentation might change. For now, it's usually ``docs/Plugins.rst`` for now. Core functions and general explanations should
either ``docs/Scripts.rst`` or ``docs/Plugins.rst``. go in the documents for that component; if it's not clear add a new section
as some may be missing.
Scripts can use a custom autodoc function, based on the Sphinx ``include``
directive and Ruby docstring conventions - any lines between ``=begin`` and
``=end`` are copied into the appropriate scripts documentation page.
They **must** have a heading which exactly matches the command, underlined
with ``=====`` to the same length. For example, a lua file would have::
--[[=begin
add-thought
===========
Adds a thought or emotion to the selected unit. Can be used by other scripts,
or the gui invoked by running ``add-thought gui`` with a unit selected.
=end]]
Ruby scripts use the same syntax, but obviously omit the leading ``--[[`` and
trailing ``]]`` which denote a multiline comment in lua.
``=begin`` and ``=end`` are native syntax (and matched in lua for convenience).
Where the heading for a section is also the name of a command, the spelling Where the heading for a section is also the name of a command, the spelling
and case should exactly match the command to enter in the DFHack command line. and case should exactly match the command to enter in the DFHack command line.
@ -136,7 +161,7 @@ Sphinx (our documentation system) will make sure paragraphs flow.
If there aren't many options or examples to show, they can go in a paragraph of If there aren't many options or examples to show, they can go in a paragraph of
text. Use double-backticks to put commands in monospaced font, like this:: text. Use double-backticks to put commands in monospaced font, like this::
You can use ``cleanall scattered x`` to dump tattered or abandoned items. You can use ``cleanowned scattered x`` to dump tattered or abandoned items.
If the command takes more than three arguments, format the list as a table If the command takes more than three arguments, format the list as a table
called Options. The table *only* lists arguments, not full commands. called Options. The table *only* lists arguments, not full commands.
@ -158,17 +183,19 @@ describe the effect::
If it would be helpful to mention another DFHack command, don't just type the If it would be helpful to mention another DFHack command, don't just type the
name - add a hyperlink! Specify the link target in backticks, and it will be name - add a hyperlink! Specify the link target in backticks, and it will be
replaced with the corresponding title and linked: eg ```plugins/autolabor``` replaced with the corresponding title and linked: eg ```autolabor```
=> `plugins/autolabor`. Link targets should be the path to the file => `autolabor`. Link targets should be equivalent to the command
described (without file extension), and placed above the heading of that described (without file extension), and placed above the heading of that
section like this:: section like this::
.. _plugins/autolabor: .. _autolabor:
autolabor autolabor
========= =========
Add link targets if you need them, but otherwise plain headings are preferred. Add link targets if you need them, but otherwise plain headings are preferred.
Scripts using the in-source docs option, which should be all of them, have
link targets created automatically.
Other ways to help Other ways to help
================== ==================

@ -112,7 +112,7 @@ However, bindings created this way are not automatically remembered between runs
of the game, so it becomes necessary to use the dfhack.init file to ensure that of the game, so it becomes necessary to use the dfhack.init file to ensure that
they are re-created every time it is loaded. they are re-created every time it is loaded.
Interactive commands like `plugins/liquids` cannot be used as hotkeys. Interactive commands like `liquids` cannot be used as hotkeys.
Many commands come from plugins, which are stored in ``hack/plugins/`` Many commands come from plugins, which are stored in ``hack/plugins/``
and must be compiled with the same version of DFHack. Others come and must be compiled with the same version of DFHack. Others come
@ -254,11 +254,19 @@ Opens an in-game screen showing DFHack keybindings that are active in the curren
Type ``hotkeys`` into the DFHack console to open the screen, or bind the command to a Type ``hotkeys`` into the DFHack console to open the screen, or bind the command to a
globally active hotkey. The default keybinding is ``Ctrl-F1``. globally active hotkey. The default keybinding is ``Ctrl-F1``.
In-game Console .. _command-prompt:
===============
In-game command prompt
======================
The ``command-prompt`` plugin adds an in-game DFHack terminal, where you The ``command-prompt`` plugin adds an in-game DFHack terminal, where you
can enter other commands. It's default keybinding is Ctrl-Shift-P. can enter other commands. It's default keybinding is Ctrl-Shift-P.
A one line command prompt in df. Same as entering command into dfhack console. Best
used as a keybinding. Can be called with optional "entry" that will start prompt with
that pre-filled.
.. image:: images/command-prompt.png
Enabling plugins Enabling plugins
================ ================
Many plugins can be in a distinct enabled or disabled state. Some of Many plugins can be in a distinct enabled or disabled state. Some of
@ -294,6 +302,8 @@ forcepause
Forces DF to pause. This is useful when your FPS drops below 1 and you lose Forces DF to pause. This is useful when your FPS drops below 1 and you lose
control of the game. Activate with ``forcepause 1``; deactivate with ``forcepause 0``. control of the game. Activate with ``forcepause 1``; deactivate with ``forcepause 0``.
.. _`hide, show`:
hide / show hide / show
----------- -----------
Hides or shows the DFHack terminal window, respectively. To use ``show``, use Hides or shows the DFHack terminal window, respectively. To use ``show``, use

@ -1,11 +0,0 @@
.. _license:
########
Licenses
########
DFHack is distributed under a range of permissive and weakly copyleft licenses.
The core uses the ZLib license; the others are described below.
.. include:: ../LICENSE

@ -3264,6 +3264,8 @@ sort
Does not export any native functions as of now. Instead, it Does not export any native functions as of now. Instead, it
calls lua code to perform the actual ordering of list items. calls lua code to perform the actual ordering of list items.
.. _eventful:
Eventful Eventful
======== ========
@ -3306,6 +3308,8 @@ List of events
Is called after calling (or not) native fillSidebarMenu(). Useful for job button Is called after calling (or not) native fillSidebarMenu(). Useful for job button
tweaking (e.g. adding custom reactions) tweaking (e.g. adding custom reactions)
.. _EventManager:
Events from EventManager Events from EventManager
------------------------ ------------------------
These events are straight from EventManager module. Each of them first needs to be enabled. See functions for more info. If you register a listener before the game is loaded, be aware that no events will be triggered immediately after loading, so you might need to add another event listener for when the game first loads in some cases. These events are straight from EventManager module. Each of them first needs to be enabled. See functions for more info. If you register a listener before the game is loaded, be aware that no events will be triggered immediately after loading, so you might need to add another event listener for when the game first loads in some cases.
@ -3420,6 +3424,8 @@ Integrated tannery::
b=require "plugins.eventful" b=require "plugins.eventful"
b.addReactionToShop("TAN_A_HIDE","LEATHERWORKS") b.addReactionToShop("TAN_A_HIDE","LEATHERWORKS")
.. _building-hacks:
Building-hacks Building-hacks
============== ==============

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -0,0 +1,40 @@
/* make sure to sync this with the base theme's css filename */
@import url("alabaster.css");
.kbd {
/* Keybinding CSS from the DF wiki; applies to :kbd:`` directives.
* Use this directive for all keypresses, to make them look like keys.
*/
border: 1px solid #aaa;
border-radius: 0.2em;
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
-o-border-radius: 0.2em; -ms-border-radius: 0.2em;
-moz-box-shadow: 0.1em 0.2em 0.2em #ddd;
-webkit-box-shadow: 0.1em 0.2em 0.2em #ddd;
box-shadow: 0.1em 0.2em 0.2em #ddd;
background-color: #f9f9f9;
background-image: -moz-linear-gradient(top, #eee, #f9f9f9, #eee);
background-image: -o-linear-gradient(top, #eee, #f9f9f9, #eee);
background-image: -webkit-linear-gradient(top, #eee, #f9f9f9, #eee);
background-image: linear-gradient(to bottom, #eee, #f9f9f9, #eee);
padding: 0.1em 0.3em;
font-family: sans-serif;
font-size: 0.8em;
}
@font-face {
font-family: cp437;
src: url("cp437.ttf");
}
.guilabel {
/* In-game text CSS from the DF wiki; applies to :guilabel:`` directives.
* Use this for any text from an in-game announcement or menu.
*/
color: #CBC7C0;
font-family: cp437, 'fixedsys', monospace;
background: #000000;
font-size: 0.95em;
padding: 0.05em 0.4em;
}

@ -1,5 +1,6 @@
##################################
Welcome to DFHack's documentation! Welcome to DFHack's documentation!
================================== ##################################
Introduction Introduction
============ ============
@ -8,11 +9,11 @@ and plugins implementing a wide variety of useful functions and tools.
For users, it provides a significant suite of bugfixes and interface For users, it provides a significant suite of bugfixes and interface
enhancements by default, and more can be enabled. There are also many tools enhancements by default, and more can be enabled. There are also many tools
(such as `plugins/workflow` or `plugins/autodump`) which can make life easier. (such as `workflow` or `autodump`) which can make life easier.
You can even add third-party scripts and plugins to do almost anything! You can even add third-party scripts and plugins to do almost anything!
For modders, DFHack makes many things possible. Custom reactions, new For modders, DFHack makes many things possible. Custom reactions, new
interactions, magic creature abilities, and more can be set through `scripts <scripts/modtools>` interactions, magic creature abilities, and more can be set through `modtools`
and custom raws. Non-standard DFHack scripts and inits can be stored in the and custom raws. Non-standard DFHack scripts and inits can be stored in the
raw directory, making raws or saves fully self-contained for distribution - raw directory, making raws or saves fully self-contained for distribution -
or for coexistence in a single DF install, even with incompatible components. or for coexistence in a single DF install, even with incompatible components.
@ -22,14 +23,8 @@ allows easier development of new tools. As an open-source project under
`various copyleft licences <license>`, contributions are welcome. `various copyleft licences <license>`, contributions are welcome.
Documentation User Manual
============= ===========
DFHack documentation is generated by Sphinx. Check out the table of contents
below, or the sources in the `docs folder`_!
.. _`docs folder`: ./docs
User Manual:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@ -38,16 +33,18 @@ User Manual:
docs/Plugins docs/Plugins
docs/Scripts docs/Scripts
Other Contents: Other Contents
==============
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
docs/Authors docs/Authors
docs/Licenses LICENSE
docs/Changelog NEWS
For Developers: For Developers
==============
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1

@ -1 +1 @@
Subproject commit a0966c0e171de1ed2383b758a26d8250400ca93d Subproject commit 8121de557102eb11cb805f8a25b43ba43077a967

@ -0,0 +1,2 @@
Basic scripts are not stored in any subdirectory, and can be invoked directly.
They are generally useful tools for any player.

@ -1,5 +1,14 @@
# View or set level of cavern adaptation for the selected unit or the whole fort # View or set level of cavern adaptation for the selected unit or the whole fort
# based on removebadthoughts.rb # based on removebadthoughts.rb
=begin
adaptation
==========
View or set level of cavern adaptation for the selected unit or the whole fort.
Usage: ``adaptation <show|set> <him|all> [value]``. The ``value`` must be
between 0 and 800,000 inclusive.
=end
# Color constants, values mapped to color_value enum in include/ColorText.h # Color constants, values mapped to color_value enum in include/ColorText.h
COLOR_GREEN = 2 COLOR_GREEN = 2

@ -1,18 +1,14 @@
-- Adds emotions to creatures. -- Adds emotions to creatures.
--@ module = true --@ module = true
--[[ --[[=begin
BEGIN_DOCS
.. _scripts/add-thought
add-thought add-thought
=========== ===========
Adds a thought or emotion to the selected unit. Can be used by other scripts, Adds a thought or emotion to the selected unit. Can be used by other scripts,
or the gui invoked by running ``add-thought gui`` with a unit selected. or the gui invoked by running ``add-thought gui`` with a unit selected.
END_DOCS =end]]
]]
local utils=require('utils') local utils=require('utils')

@ -3,7 +3,16 @@
-- arguments allow for skills to be adjusted as well -- arguments allow for skills to be adjusted as well
-- WARNING: USING THIS SCRIPT WILL ADJUST ALL DWARVES IN PLAY! -- WARNING: USING THIS SCRIPT WILL ADJUST ALL DWARVES IN PLAY!
-- by vjek -- by vjek
--[[=begin
armoks-blessing
===============
Runs the equivalent of `rejuvenate`, `elevate-physical`, `elevate-mental`, and
`brainwash` on all dwarves currently on the map. This is an extreme change,
which sets every stat to an ideal - legendary skills, great traits, and
easy-to-satisfy preferences.
=end]]
function rejuvenate(unit) function rejuvenate(unit)
if unit==nil then if unit==nil then
print ("No unit available! Aborting with extreme prejudice.") print ("No unit available! Aborting with extreme prejudice.")

@ -1,3 +1,19 @@
=begin
autofarm
========
Automatically handle crop selection in farm plots based on current plant stocks.
Selects a crop for planting if current stock is below a threshold.
Selected crops are dispatched on all farmplots.
Usage::
autofarm start
autofarm default 30
autofarm threshold 150 helmet_plump tail_pig
=end
class AutoFarm class AutoFarm
def initialize def initialize

@ -1,5 +1,12 @@
-- Executes an autolabor command for each labor where skill level influences output quality. -- Executes an autolabor command for each labor where skill level influences output quality.
--[[=begin
autolabor-artisans
==================
Runs `autolabor`, with settings tuned for small but highly skilled workforces.
=end]]
local artisan_labors = { local artisan_labors = {
"CARPENTER", "CARPENTER",
"DETAIL", "DETAIL",

@ -1,4 +1,12 @@
# un-suspend construction jobs, on a recurring basis # un-suspend construction jobs, on a recurring basis
=begin
autounsuspend
=============
Automatically unsuspend jobs in workshops, on a recurring basis.
See `unsuspend` for one-off use, or `resume` ``all``.
=end
class AutoUnsuspend class AutoUnsuspend
attr_accessor :running attr_accessor :running

@ -1,4 +1,13 @@
# convenient way to ban cooking categories of food # convenient way to ban cooking categories of food
=begin
ban-cooking
===========
A more convenient way to ban cooking various categories of foods than the
kitchen interface. Usage: ``ban-cooking <type>``. Valid types are ``booze``,
``honey``, ``tallow``, ``oil``, and ``seeds`` (non-tree plants with seeds).
=end
already_banned = {} already_banned = {}
kitchen = df.ui.kitchen kitchen = df.ui.kitchen

@ -1,4 +1,11 @@
-- Apply or remove binary patches at runtime. -- Apply or remove binary patches at runtime.
--[[=begin
binpatch
========
Implements functions for in-memory binpatches. See `binpatches`.
=end]]
local bp = require('binpatch') local bp = require('binpatch')

@ -1,6 +1,15 @@
-- This script will brainwash a dwarf, modifying their personality -- This script will brainwash a dwarf, modifying their personality
-- usage is: target a unit in DF, and execute this script in dfhack -- usage is: target a unit in DF, and execute this script in dfhack
-- by vjek -- by vjek
--[[=begin
brainwash
=========
Modify the personality traits of the selected dwarf to match an 'ideal'
personality - as stable and reliable as possible. This makes dwarves very
stable, preventing tantrums even after months of misery.
=end]]
function brainwash_unit(profile) function brainwash_unit(profile)
local i,unit_name local i,unit_name

@ -1,5 +1,13 @@
-- allows burial in unowned coffins -- allows burial in unowned coffins
-- by Putnam https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda -- by Putnam https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda
--[[=begin
burial
======
Sets all unowned coffins to allow burial. ``burial -pets`` also allows burial
of pets.
=end]]
local utils=require('utils') local utils=require('utils')

@ -1,4 +1,34 @@
# create first necessity items under cursor # create first necessity items under cursor
=begin
create-items
============
Spawn items under the cursor, to get your fortress started.
The first argument gives the item category, the second gives the material,
and the optionnal third gives the number of items to create (defaults to 20).
Currently supported item categories: ``boulder``, ``bar``, ``plant``, ``log``,
``web``.
Instead of material, using ``list`` makes the script list eligible materials.
The ``web`` item category will create an uncollected cobweb on the floor.
Note that the script does not enforce anything, and will let you create
boulders of toad blood and stuff like that.
However the ``list`` mode will only show 'normal' materials.
Examples::
create-items boulders COAL_BITUMINOUS 12
create-items plant tail_pig
create-items log list
create-items web CREATURE:SPIDER_CAVE_GIANT:SILK
create-items bar CREATURE:CAT:SOAP
create-items bar adamantine
=end
category = $script_args[0] || 'help' category = $script_args[0] || 'help'
mat_raw = $script_args[1] || 'list' mat_raw = $script_args[1] || 'list'

@ -1,4 +1,12 @@
# show death cause of a creature # show death cause of a creature
=begin
deathcause
==========
Select a body part ingame, or a unit from the :kbd:`u` unit list, and this
script will display the cause of death of the creature.
=end
def display_death_event(e) def display_death_event(e)
str = "The #{e.victim_hf_tg.race_tg.name[0]} #{e.victim_hf_tg.name} died in year #{e.year}" str = "The #{e.victim_hf_tg.race_tg.name[0]} #{e.victim_hf_tg.name} died in year #{e.year}"

@ -0,0 +1,2 @@
``devel/*`` scripts are intended for developers, or still substantially unfinished.
If you don't already know what they do, best to leave them alone.

@ -1,4 +1,12 @@
-- a collection of misc lua scripts -- a collection of misc lua scripts
--[[=begin
dfusion
=======
Interface to a lecacy script system.
=end]]
local dfu=require("plugins.dfusion") local dfu=require("plugins.dfusion")
local myos=dfhack.getOSType() local myos=dfhack.getOSType()
args={...} args={...}

@ -1,4 +1,33 @@
# designate an area for digging according to a plan in csv format # designate an area for digging according to a plan in csv format
=begin
digfort
=======
A script to designate an area for digging according to a plan in csv format.
This script, inspired from quickfort, can designate an area for digging.
Your plan should be stored in a .csv file like this::
# this is a comment
d;d;u;d;d;skip this tile;d
d;d;d;i
Available tile shapes are named after the 'dig' menu shortcuts:
``d`` for dig, ``u`` for upstairs, ``j`` downstairs, ``i`` updown,
``h`` channel, ``r`` upward ramp, ``x`` remove designation.
Unrecognized characters are ignored (eg the 'skip this tile' in the sample).
Empty lines and data after a ``#`` are ignored as comments.
To skip a row in your design, use a single ``;``.
One comment in the file may contain the phrase ``start(3,5)``. It is interpreted
as an offset for the pattern: instead of starting at the cursor, it will start
3 tiles left and 5 tiles up from the cursor.
The script takes the plan filename, starting from the root df folder (where
``Dwarf Fortress.exe`` is found).
=end
fname = $script_args[0].to_s fname = $script_args[0].to_s

@ -1,4 +1,11 @@
-- Remove all aquifers from the map -- Remove all aquifers from the map
--[[=begin
drain-aquifer
=============
Remove all 'aquifer' tag from the map blocks. Irreversible.
=end]]
local function drain() local function drain()
local layers = {} local layers = {}

@ -1,7 +1,14 @@
-- This script will elevate all the mental attributes of a unit -- This script will elevate all the mental attributes of a unit
-- usage is: target a unit in DF, and execute this script in dfhack
-- all physical attributes will be set to whatever the max value is
-- by vjek -- by vjek
--[[=begin
elevate-mental
==============
Set all mental attributes of the selected dwarf to 2600, which is very high.
Numbers between 0 and 5000 can be passed as an argument: ``elevate-mental 100``
for example would make the dwarf very stupid indeed.
=end]]
function ElevateMentalAttributes(value) function ElevateMentalAttributes(value)
unit=dfhack.gui.getSelectedUnit() unit=dfhack.gui.getSelectedUnit()

@ -1,7 +1,13 @@
-- This script will elevate all the physical attributes of a unit -- This script will elevate all the physical attributes of a unit
-- usage is: target a unit in DF, and execute this script in dfhack
-- all physical attributes will be set to whatever the max value is
-- by vjek -- by vjek
--[[=begin
elevate-physical
================
As for elevate-mental, but for physical traits. High is good for soldiers,
while having an ineffective hammerer can be useful too...
=end]]
function ElevatePhysicalAttributes(value) function ElevatePhysicalAttributes(value)
unit=dfhack.gui.getSelectedUnit() unit=dfhack.gui.getSelectedUnit()

@ -1,5 +1,23 @@
-- Export everything from legends mode -- Export everything from legends mode
-- Valid args: "all", "info", "maps", "sites" --[[=begin
exportlegends
=============
Controls legends mode to export data - especially useful to set-and-forget large
worlds, or when you want a map of every site when there are several hundred.
The 'info' option exports more data than is possible in vanilla, to a
:file:`region-date-legends_plus.xml` file developed to extend
:forums:`World Viewer <128932>` and other legends utilities.
Options:
:info: Exports the world/gen info, the legends XML, and a custom XML with more information
:sites: Exports all available site maps
:maps: Exports all seventeen detailed maps
:all: Equivalent to calling all of the above, in that order
=end]]
gui = require 'gui' gui = require 'gui'
local args = {...} local args = {...}

@ -1,7 +1,48 @@
# exterminate creatures # exterminate creatures
=begin
exterminate
===========
Kills any unit of a given race.
With no argument, lists the available races and count eligible targets.
With the special argument ``him``, targets only the selected creature.
With the special argument ``undead``, targets all undeads on the map,
regardless of their race.
When specifying a race, a caste can be specified to further restrict the
targeting. To do that, append and colon and the caste name after the race.
Any non-dead non-caged unit of the specified race gets its ``blood_count``
set to 0, which means immediate death at the next game tick. For creatures
such as vampires, it also sets animal.vanish_countdown to 2.
An alternate mode is selected by adding a 2nd argument to the command,
``magma``. In this case, a column of 7/7 magma is generated on top of the
targets until they die (Warning: do not call on magma-safe creatures. Also,
using this mode on birds is not recommended.) The final alternate mode
is ``butcher``, which marks them for butchering but does not kill.
Will target any unit on a revealed tile of the map, including ambushers,
but ignore caged/chained creatures.
Ex::
exterminate gob
exterminate gob:male
To kill a single creature, select the unit with the 'v' cursor and::
exterminate him
To purify all elves on the map with fire (may have side-effects)::
exterminate elve magma
=end
# race = name of the race to eradicate, use 'him' to target only the selected creature
# use 'undead' to target all undeads
race = $script_args[0] race = $script_args[0]
# if the 2nd parameter is 'magma', magma rain for the targets instead of instant death # if the 2nd parameter is 'magma', magma rain for the targets instead of instant death

@ -3,20 +3,21 @@
-- original author: Tacomagic -- original author: Tacomagic
-- minor fixes by PeridexisErrant, Lethosor -- minor fixes by PeridexisErrant, Lethosor
--@ module = true --@ module = true
--[[=begin
--[[ fix-ster
This script utilizes the orientation tag to either fix infertile creatures ========
or inflict infertility on creatures that you do not want to breed Utilizes the orientation tag to either fix infertile creatures or inflict
infertility on creatures that you do not want to breed. Usage::
Required arg: fix-ster [fert|ster] [all|animals|only:<creature>]
fert: sets the flag to assure creature(s) are fertile
ster: sets the flag to assure creature(s) are sterile ``fert`` or ``ster`` is a required argument; whether to make the target fertile
Optional args: or sterile. Optional arguments specify the target: no argument for the
<no arg> the script will only process the currently selected creature selected unit, ``all`` for all units on the map, ``animals`` for all non-dwarf
all: process all creatures currently on the map creatures, or ``only:<creature>`` to only process matching creatures.
animals: processes everything but dwarves on the map
only:<creature>: processes all of the creatures matching the specified creature on the map =end]]
]]--
function changeorient(unit, ori) function changeorient(unit, ori)
--Sets the fertility flag based on gender. --Sets the fertility flag based on gender.

@ -0,0 +1 @@
``fix/*`` scripts fix various bugs and issues, some of them obscure.

@ -1,8 +1,13 @@
--blood-del.lua
--makes it so that civs won't come with barrels full of blood, ichor, or goo --makes it so that civs won't come with barrels full of blood, ichor, or goo
--author Urist Da Vinci --author Urist Da Vinci
--edited by expwnent, scamtank --edited by expwnent, scamtank
--[[=begin
fix/blood-del
=============
Makes it so that future caravans won't bring barrels full of blood, ichor, or goo.
=end]]
local my_entity=df.historical_entity.find(df.global.ui.civ_id) local my_entity=df.historical_entity.find(df.global.ui.civ_id)
local sText=" " local sText=" "
local k=0 local k=0

@ -1,7 +1,15 @@
-- Lets constructions reconsider the build location. -- Lets constructions reconsider the build location.
-- Partial work-around for http://www.bay12games.com/dwarves/mantisbt/view.php?id=5991 -- Partial work-around for http://www.bay12games.com/dwarves/mantisbt/view.php?id=5991
--[[=begin
fix/build-location
==================
Fixes construction jobs that are stuck trying to build a wall while standing
on the same exact tile (:bug:`5991`), designates the tile restricted traffic to
hopefully avoid jamming it again, and unsuspends them.
=end]]
local utils = require('utils') local utils = require('utils')
local count = 0 local count = 0

@ -1,5 +1,13 @@
-- Remove uninteresting dead units from the unit list. -- Remove uninteresting dead units from the unit list.
--[[=begin
fix/dead-units
==============
Removes uninteresting dead units from the unit list. Doesn't seem to give any
noticeable performance gain, but migrants normally stop if the unit list grows
to around 3000 units, and this script reduces it back.
=end]]
local units = df.global.world.units.active local units = df.global.world.units.active
local dwarf_race = df.global.ui.race_id local dwarf_race = df.global.ui.race_id
local dwarf_civ = df.global.ui.civ_id local dwarf_civ = df.global.ui.civ_id

@ -2,7 +2,16 @@
-- --
-- See for more info: -- See for more info:
-- http://www.bay12games.com/dwarves/mantisbt/view.php?id=5971 -- http://www.bay12games.com/dwarves/mantisbt/view.php?id=5971
--[[=begin
fix/fat-dwarves
===============
Avoids 5-10% FPS loss due to constant recalculation of insulation for dwarves at
maximum fatness, by reducing the cap from 1,000,000 to 999,999.
Recalculation is triggered in steps of 250 units, and very fat dwarves
constantly bounce off the maximum value while eating.
=end]]
local num_fat = 0 local num_fat = 0
local num_lagging = 0 local num_lagging = 0

@ -2,7 +2,13 @@
-- original author: tejón -- original author: tejón
-- rewritten by expwnent -- rewritten by expwnent
-- see repeat.lua for how to run this every so often automatically -- see repeat.lua for how to run this every so often automatically
--[[=begin
fix/feeding-timers
==================
Reset the GiveWater and GiveFood timers of all units as appropriate.
=end]]
local args = {...} local args = {...}
if args[1] ~= nil then if args[1] ~= nil then
print("fix/feeding-timers usage") print("fix/feeding-timers usage")

@ -1,10 +1,17 @@
-- Verify item occupancy and block item list integrity. -- Verify item occupancy and block item list integrity.
--
-- Checks:
-- 1) Item has flags.on_ground <=> it is in the correct block item list
-- 2) A tile has items in block item list <=> it has occupancy.item
-- 3) The block item lists are sorted.
--[[=begin
fix/item-occupancy
==================
Diagnoses and fixes issues with nonexistant 'items occupying site', usually
caused by `autodump` bugs or other hacking mishaps. Checks that:
#. Item has ``flags.on_ground`` <=> it is in the correct block item list
#. A tile has items in block item list <=> it has ``occupancy.item``
#. The block item lists are sorted
=end]]
local utils = require 'utils' local utils = require 'utils'
function check_block_items(fix) function check_block_items(fix)

@ -1,5 +1,11 @@
# script to fix loyalty cascade, when you order your militia to kill friendly units # script to fix loyalty cascade, when you order your militia to kill friendly units
=begin
fix/loyaltycascade
==================
Aborts loyalty cascades by fixing units whose own civ is the enemy.
=end
def fixunit(unit) def fixunit(unit)
return if unit.race != df.ui.race_id or unit.civ_id != df.ui.civ_id return if unit.race != df.ui.race_id or unit.civ_id != df.ui.civ_id
links = unit.hist_figure_tg.entity_links links = unit.hist_figure_tg.entity_links

@ -1,11 +1,18 @@
-- Communicates current population to mountainhomes to avoid cap overshooting. -- Communicates current population to mountainhomes to avoid cap overshooting.
-- The reason for population cap problems is that the population value it --[[=begin
-- is compared against comes from the last dwarven caravan that successfully
-- left for mountainhomes. This script instantly updates it.
-- Note that a migration wave can still overshoot the limit by 1-2 dwarves because
-- of the last migrant bringing his family. Likewise, king arrival ignores cap.
fix/population-cap
==================
Run this after every migrant wave to ensure your population cap is not exceeded.
The reason for population cap problems is that the population value it
is compared against comes from the last dwarven caravan that successfully
left for mountainhomes. This script instantly updates it.
Note that a migration wave can still overshoot the limit by 1-2 dwarves because
of the last migrant bringing his family. Likewise, king arrival ignores cap.
=end]]
local args = {...} local args = {...}
local ui = df.global.ui local ui = df.global.ui

@ -1,5 +1,13 @@
-- Reset item temperature to the value of their tile. -- Reset item temperature to the value of their tile.
--[[=begin
fix/stable-temp
===============
Instantly sets the temperature of all free-lying items to be in equilibrium with
the environment, which stops temperature updates until something changes.
To maintain this efficient state, use `tweak fast-heat <tweak>`.
=end]]
local args = {...} local args = {...}
local apply = (args[1] == 'apply') local apply = (args[1] == 'apply')
@ -51,6 +59,7 @@ end
if apply then if apply then
print('Items updated: '..count) print('Items updated: '..count)
else else
print("Use 'fix/stable-temp apply' to force-change temperature.")
print('Items not in equilibrium: '..count) print('Items not in equilibrium: '..count)
end end
@ -60,7 +69,3 @@ table.sort(tlist, function(a,b) return types[a] > types[b] end)
for _,k in ipairs(tlist) do for _,k in ipairs(tlist) do
print(' '..df.item_type[k]..':', types[k]) print(' '..df.item_type[k]..':', types[k])
end end
if not apply then
print("Use 'fix/stable-temp apply' to force-change temperature.")
end

@ -2,7 +2,14 @@
# this may happen after people mess with the game by (incorrectly) teleporting units or items # this may happen after people mess with the game by (incorrectly) teleporting units or items
# a door may stick open if the map occupancy flags are wrong # a door may stick open if the map occupancy flags are wrong
=begin
fix/stuckdoors
==============
Fix doors that are stuck open due to incorrect map occupancy flags, eg due to
incorrect use of `teleport`.
=end
count = 0 count = 0
df.world.buildings.all.each { |bld| df.world.buildings.all.each { |bld|
# for all doors # for all doors

@ -1,4 +1,11 @@
--removes unhappy thoughts due to lack of clothing --removes unhappy thoughts due to lack of clothing
--[[=begin
fixnaked
========
Removes all unhappy thoughts due to lack of clothing.
=end]]
function fixnaked() function fixnaked()
local total_fixed = 0 local total_fixed = 0

@ -2,6 +2,14 @@
-- Save a copy of a text screen for the DF forums. Use 'forumdwarves help' for more details. -- Save a copy of a text screen for the DF forums. Use 'forumdwarves help' for more details.
-- original author: Caldfir -- original author: Caldfir
-- edited by expwnent, Mchl -- edited by expwnent, Mchl
--[[=begin
forum-dwarves
=============
Saves a copy of a text screen, formatted in bbcode for posting to the Bay12 Forums.
Use ``forum-dwarves help`` for more information.
=end]]
local args = {...} local args = {...}

@ -2,7 +2,13 @@
--author Kurik Amudnil, Urist DaVinci --author Kurik Amudnil, Urist DaVinci
--edited by expwnent --edited by expwnent
-- attempt to fully heal a selected unit, option -r to attempt to resurrect the unit --[[=begin
full-heal
=========
Attempts to fully heal the selected unit. ``full-heal -r`` attempts to resurrect the unit.
=end]]
local utils=require('utils') local utils=require('utils')

@ -1,4 +1,13 @@
local utils = require('utils') local utils = require('utils')
--[[=begin
gaydar
======
Shows the sexual orientation of units, useful for social engineering or checking
the viability of livestock breeding programs. Use ``gaydar -help`` for information
on available filters for orientation, citizenship, species, etc.
=end]]
validArgs = utils.invert({ validArgs = utils.invert({
'all', 'all',

@ -1,4 +1,19 @@
# grow crops in farm plots. ex: growcrops helmet_plump 20 # grow crops in farm plots. ex: growcrops helmet_plump 20
=begin
growcrops
=========
Instantly grow seeds inside farming plots.
With no argument, this command list the various seed types currently in
use in your farming plots. With a seed type, the script will grow 100 of
these seeds, ready to be harvested. Set the number with a 2nd argument.
For example, to grow 40 plump helmet spawn::
growcrops plump 40
=end
material = $script_args[0] material = $script_args[0]
count_max = $script_args[1].to_i count_max = $script_args[1].to_i

@ -0,0 +1,6 @@
``gui/*`` scripts implement dialogs in the main game window.
In order to avoid user confusion, as a matter of policy all these tools
display the word "DFHack" on the screen somewhere while active.
When that is not appropriate because they merely add keybinding hints to
existing DF screens, they deliberately use red instead of green for the key.

@ -1,5 +1,26 @@
-- allows to do jobs in adv. mode. -- allows to do jobs in adv. mode.
--[[=begin
gui/advfort
===========
This script allows to perform jobs in adventure mode. For more complete help
press :kbd:`?` while script is running. It's most comfortable to use this as a
keybinding. (e.g. ``keybinding set Ctrl-T gui/advfort``). Possible arguments:
:-a, --nodfassign: uses different method to assign items.
:-i, --inventory: checks inventory for possible items to use in the job.
:-c, --cheat: relaxes item requirements for buildings (e.g. walls from bones). Implies -a
:job: selects that job (e.g. Dig or FellTree)
An example of player digging in adventure mode:
.. image:: /docs/images/advfort.png
**WARNING:** changes only persist in non procedural sites, namely: player forts, caves, and camps.
=end]]
--[==[ --[==[
version: 0.044 version: 0.044
changelog: changelog:

@ -1,3 +1,11 @@
--[[=begin
gui/advfort_items
=================
Does something with items in adventure mode jobs.
=end]]
local _ENV = mkmodule('hack.scripts.gui.advfort_items') local _ENV = mkmodule('hack.scripts.gui.advfort_items')
local gui=require('gui') local gui=require('gui')

@ -1,7 +1,15 @@
-- Assign weapon racks to squads. Requires the weaponrack-unassign patch. -- Assign weapon racks to squads. Requires the weaponrack-unassign patch.
-- See bug 1445 for more info about the patches. --[[=begin
gui/assign-rack
===============
`This script requires a binpatch <binpatches/needs-patch>`, which has not
been available since DF 0.34.11
See :bug:`1445` for more info about the patches.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,11 @@
-- A GUI front-end for the autobutcher plugin. -- A GUI front-end for the autobutcher plugin.
--[[=begin
gui/autobutcher
===============
An in-game interface for `autobutcher`.
=end]]
local gui = require 'gui' local gui = require 'gui'
local utils = require 'utils' local utils = require 'utils'
local widgets = require 'gui.widgets' local widgets = require 'gui.widgets'

@ -1,5 +1,20 @@
-- Rewrite individual choice weapons into specific types. -- Rewrite individual choice weapons into specific types.
--[[=begin
gui/choose-weapons
==================
Bind to a key (the example config uses :kbd:`Ctrl`:kbd:`W`), and activate in the Equip->View/Customize
page of the military screen.
Depending on the cursor location, it rewrites all 'individual choice weapon' entries
in the selected squad or position to use a specific weapon type matching the assigned
unit's top skill. If the cursor is in the rightmost list over a weapon entry, it rewrites
only that entry, and does it even if it is not 'individual choice'.
Rationale: individual choice seems to be unreliable when there is a weapon shortage,
and may lead to inappropriate weapons being selected.
=end]]
local utils = require 'utils' local utils = require 'utils'
local dlg = require 'gui.dialogs' local dlg = require 'gui.dialogs'

@ -1,5 +1,15 @@
-- Clone the current uniform template in the military screen. -- Clone the current uniform template in the military screen.
--[[=begin
gui/clone-uniform
=================
Bind to a key (the example config uses :kbd:`Ctrl`:kbd:`C`), and activate in the Uniforms
page of the military screen with the cursor in the leftmost list.
When invoked, the script duplicates the currently selected uniform template,
and selects the newly created copy.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'

@ -1,4 +1,24 @@
--[[=begin
gui/companion-order
===================
A script to issue orders for companions. Select companions with lower case chars, issue orders with upper
case. Must be in look or talk mode to issue command on tile.
.. image:: /docs/images/companion-order.png
* move - orders selected companions to move to location. If companions are following they will move no more than 3 tiles from you.
* equip - try to equip items on the ground.
* pick-up - try to take items into hand (also wield)
* unequip - remove and drop equipment
* unwield - drop held items
* wait - temporarily remove from party
* follow - rejoin the party after "wait"
* leave - remove from party (can be rejoined by talking)
=end]]
local gui = require 'gui' local gui = require 'gui'
local dlg = require 'gui.dialogs' local dlg = require 'gui.dialogs'
local args={...} local args={...}

@ -4,7 +4,13 @@
-- edited by expwnent -- edited by expwnent
--@module = true --@module = true
--[[=begin
gui/create-item
===============
A graphical interface for creating items.
=end]]
local function getGenderString(gender) local function getGenderString(gender)
local genderStr local genderStr
if gender==0 then if gender==0 then

@ -1,6 +1,14 @@
-- a quick access status screen -- a quick access status screen
-- originally written by enjia2000@gmail.com (stolencatkarma) -- originally written by enjia2000@gmail.com (stolencatkarma)
--[[=begin
gui/dfstatus
============
Show a quick overview of critical stock quantities, including food, drinks, wood, and various bars.
Sections can be enabled/disabled/configured by editing ``dfhack-config/dfstatus.lua``.
=end]]
local gui = require 'gui' local gui = require 'gui'
function warn(msg) function warn(msg)

@ -1,4 +1,24 @@
-- Interface powered item editor. -- Interface powered item editor.
--[[=begin
gui/gm-editor
=============
This editor allows to change and modify almost anything in df. Press :kbd:`?` for
in-game help. There are three ways to open this editor:
* Callling ``gui/gm-editor`` from a command or keybinding opens the editor
on whatever is selected or viewed (e.g. unit/item description screen)
* using gui/gm-editor <lua command> - executes lua command and opens editor on
its results (e.g. ``gui/gm-editor "df.global.world.items.all"`` shows all items)
* using gui/gm-editor dialog - shows an in game dialog to input lua command. Works
the same as version above.
.. image:: /docs/images/gm-editor.png
=end]]
local gui = require 'gui' local gui = require 'gui'
local dialog = require 'gui.dialogs' local dialog = require 'gui.dialogs'
local widgets =require 'gui.widgets' local widgets =require 'gui.widgets'

@ -1,4 +1,12 @@
-- Interface powered (somewhat user friendly) unit editor. -- Interface powered (somewhat user friendly) unit editor.
--[[=begin
gui/gm-unit
===========
An editor for various unit attributes.
=end]]
local gui = require 'gui' local gui = require 'gui'
local dialog = require 'gui.dialogs' local dialog = require 'gui.dialogs'
local widgets =require 'gui.widgets' local widgets =require 'gui.widgets'

@ -1,5 +1,17 @@
-- Show and manipulate the path used by Guide Cart orders. -- Show and manipulate the path used by Guide Cart orders.
--[[=begin
gui/guide-path
==============
Bind to a key (the example config uses :kbd:`Alt`:kbd:`P`), and activate in the Hauling menu with
the cursor over a Guide order.
.. image:: /docs/images/guide-path.png
The script displays the cached path that will be used by the order; the game
computes it when the order is executed for the first time.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1 +1,8 @@
--@ alias = 'gui/create-item' --@ alias = 'gui/create-item'
--[[=begin
gui/hack-wish
=============
An alias for `gui/create-item`. Deprecated.
=end]]

@ -1,5 +1,11 @@
-- Test lua viewscreens. -- Test lua viewscreens.
--[[=begin
gui/hello-world
===============
A basic example for testing, or to start your own script from.
=end]]
local gui = require 'gui' local gui = require 'gui'
local text = 'Woohoo, lua viewscreen :)' local text = 'Woohoo, lua viewscreen :)'

@ -1,5 +1,36 @@
-- Interface front-end for liquids plugin. -- Interface front-end for liquids plugin.
--[[=begin
gui/liquids
===========
To use, bind to a key (the example config uses Alt-L) and activate in the :kbd:`k` mode.
.. image:: /docs/images/liquids.png
This script is a gui front-end to `liquids` and works similarly,
allowing you to add or remove water & magma, and create obsidian walls & floors.
.. warning::
There is **no undo support**. Bugs in this plugin have been
known to create pathfinding problems and heat traps.
The :kbd:`b` key changes how the affected area is selected. The default :guilabel:`Rectangle`
mode works by selecting two corners like any ordinary designation. The :kbd:`p`
key chooses between adding water, magma, obsidian walls & floors, or just
tweaking flags.
When painting liquids, it is possible to select the desired level with :kbd:`+`:kbd:`-`,
and choose between setting it exactly, only increasing or only decreasing
with :kbd:`s`.
In addition, :kbd:`f` allows disabling or enabling the flowing water computations
for an area, and :kbd:`r` operates on the "permanent flow" property that makes
rivers power water wheels even when full and technically not flowing.
After setting up the desired operations using the described keys, use :kbd:`Enter` to apply them.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,22 @@
-- Shows mechanisms linked to the current building. -- Shows mechanisms linked to the current building.
--[[=begin
gui/mechanisms
==============
To use, bind to a key (the example config uses :kbd:`Ctrl`:kbd:`M`)
and activate in :kbd:`q` mode.
.. image:: /docs/images/mechanisms.png
Lists mechanisms connected to the building, and their links. Navigating
the list centers the view on the relevant linked buildings.
To exit, press :kbd:`Esc` or :kbd:`Enter`; :kbd:`Esc` recenters on
the original building, while :kbd:`Enter` leaves focus on the current
one. :kbd:`Shift`:kbd:`Enter` has an effect equivalent to pressing
:kbd:`Enter`, and then re-entering the mechanisms UI.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,7 +1,20 @@
-- a graphical mod manager for df -- a graphical mod manager for df
local gui=require 'gui' local gui=require 'gui'
local widgets=require 'gui.widgets' local widgets=require 'gui.widgets'
--[[=begin
gui/mod-manager
===============
A simple way to install and remove small mods.
It looks for specially formatted mods in :file:`{<DF>}/mods/`. Mods are not
included, but some examples are `available here`_.
.. _`available here`: https://github.com/warmist/df-mini-mods
.. image:: /docs/images/mod-manager.png
=end]]
local entity_file=dfhack.getDFPath().."/raw/objects/entity_default.txt" local entity_file=dfhack.getDFPath().."/raw/objects/entity_default.txt"
local init_file=dfhack.getDFPath().."/raw/init.lua" local init_file=dfhack.getDFPath().."/raw/init.lua"
local mod_dir=dfhack.getDFPath().."/hack/mods" local mod_dir=dfhack.getDFPath().."/hack/mods"

@ -1,5 +1,11 @@
-- Shows the warning about missing configuration file. -- Shows the warning about missing configuration file.
--[[=begin
gui/no-dfhack-init
==================
Shows a warning at startup if no valid :file:`dfhack.init` file is found.
=end]]
local gui = require 'gui' local gui = require 'gui'
local dlg = require 'gui.dialogs' local dlg = require 'gui.dialogs'

@ -1,5 +1,11 @@
-- Interface front-end for power-meter plugin. -- Interface front-end for power-meter plugin.
--[[=begin
gui/power-meter
===============
An in-game interface for `power-meter`.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,35 @@
-- Rename various objects via gui. -- Rename various objects via gui.
--[[=begin
gui/rename
==========
Backed by `rename`, this script allows entering the desired name
via a simple dialog in the game ui.
* ``gui/rename [building]`` in :kbd:`q` mode changes the name of a building.
.. image:: /docs/images/rename-bld.png
The selected building must be one of stockpile, workshop, furnace, trap, or siege engine.
It is also possible to rename zones from the :kbd:`i` menu.
* ``gui/rename [unit]`` with a unit selected changes the nickname.
Unlike the built-in interface, this works even on enemies and animals.
* ``gui/rename unit-profession`` changes the selected unit's custom profession name.
.. image:: /docs/images/rename-prof.png
Likewise, this can be applied to any unit, and when used on animals it overrides
their species string.
The ``building`` or ``unit`` options are automatically assumed when in relevant UI state.
The example config binds building/unit rename to :kbd:`Ctrl`:kbd:`Shift`:kbd:`N`, and
unit profession change to :kbd:`Ctrl`:kbd:`Shift`:kbd:`T`.
=end]]
local gui = require 'gui' local gui = require 'gui'
local dlg = require 'gui.dialogs' local dlg = require 'gui.dialogs'
local plugin = require 'plugins.rename' local plugin = require 'plugins.rename'

@ -1,5 +1,17 @@
-- Browses rooms owned by a unit. -- Browses rooms owned by a unit.
--[[=begin
gui/room-list
=============
To use, bind to a key (the example config uses :kbd:`Alt`:kbd:`R`) and activate in :kbd:`q` mode,
either immediately or after opening the assign owner page.
.. image:: /docs/images/room-list.png
The script lists other rooms owned by the same owner, or by the unit selected in the assign
list, and allows unassigning them.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,42 @@
-- Front-end for the siege engine plugin. -- Front-end for the siege engine plugin.
--[[=begin
gui/siege-engine
================
An in-game interface for `siege-engine`.
Bind it to a key (the example config uses :kbd:`Alt`:kbd:`a`) and
activate after selecting a siege engine in :kbd:`q` mode.
.. image:: /docs/images/siege-engine.png
The main mode displays the current target, selected ammo item
type, linked stockpiles and the allowed operator skill range. The
map tile color is changed to signify if it can be hit by the
selected engine: green for fully reachable, blue for out of
range, red for blocked, yellow for partially blocked.
Pressing :kbd:`r` changes into the target selection mode, which
works by highlighting two points with :kbd:`Enter` like all
designations. When a target area is set, the engine projectiles
are aimed at that area, or units within it (this doesn't actually
change the original aiming code, instead the projectile
trajectory parameters are rewritten as soon as it appears).
After setting the target in this way for one engine, you can
'paste' the same area into others just by pressing :kbd:`p` in
the main page of this script. The area to paste is kept until you
quit DF, or select another area manually.
Pressing :kbd:`t` switches to a mode for selecting a stockpile to
take ammo from.
Exiting from the siege engine script via :kbd:`Esc` reverts the
view to the state prior to starting the script.
:kbd:`Shift`:kbd:`Esc` retains the current viewport, and also
exits from the :kbd:`q` mode to main menu.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,22 @@
-- lave/load stockpile settings with a GUI -- lave/load stockpile settings with a GUI
--[[=begin
gui/stockpiles
==============
An in-game interface for `stocksettings`, to
load and save stockpile settings from the :kbd:`q` menu.
Usage:
:gui/stockpiles -save: to save the current stockpile
:gui/stockpiles -load: to load settings into the current stockpile
:gui/stockpiles -dir <path>: set the default directory to save settings into
:gui/stockpiles -help: to see this message
Don't forget to ``enable stockpiles`` and create the ``stocksettings`` directory in
the DF folder before trying to use the GUI.
=end]]
local stock = require 'plugins.stockpiles' local stock = require 'plugins.stockpiles'
function check_enabled() function check_enabled()

@ -3,7 +3,14 @@
-- version 1.04 -- version 1.04
-- original author: Kurik Amudnil -- original author: Kurik Amudnil
-- edited by expwnent -- edited by expwnent
--[[=begin
gui/unit-info-viewer
====================
Displays age, birth, maxage, shearing, milking, grazing, egg laying, body size,
and death info about a unit. Recommended keybinding :kbd:`Alt`:kbd:`I`.
=end]]
local gui = require 'gui' local gui = require 'gui'
local widgets =require 'gui.widgets' local widgets =require 'gui.widgets'
local utils = require 'utils' local utils = require 'utils'

@ -1,5 +1,68 @@
-- A GUI front-end for the workflow plugin. -- A GUI front-end for the workflow plugin.
--[[=begin
gui/workflow
============
Bind to a key (the example config uses Alt-W), and activate with a job selected
in a workshop in :kbd:`q` mode.
.. image:: /docs/images/workflow.png
This script provides a simple interface to constraints managed by `workflow`.
When active, it displays a list of all constraints applicable to the
current job, and their current status.
A constraint specifies a certain range to be compared against either individual
*item* or whole *stack* count, an item type and optionally a material. When the
current count is below the lower bound of the range, the job is resumed; if it
is above or equal to the top bound, it will be suspended. Within the range, the
specific constraint has no effect on the job; others may still affect it.
Pressing :kbd:`i` switches the current constraint between counting stacks or items.
Pressing :kbd:`r` lets you input the range directly;
:kbd:`e`, :kbd:`r`, :kbd:`d`, :kbd:`f` adjust the
bounds by 5, 10, or 20 depending on the direction and the :kbd:`i` setting (counting
items and expanding the range each gives a 2x bonus).
Pressing :kbd:`a` produces a list of possible outputs of this job as guessed by
workflow, and lets you create a new constraint by choosing one as template. If you
don't see the choice you want in the list, it likely means you have to adjust
the job material first using `job` ``item-material`` or `gui/workshop-job`,
as described in the `workflow` documentation. In this manner, this feature
can be used for troubleshooting jobs that don't match the right constraints.
.. image:: /docs/images/workflow-new1.png
If you select one of the outputs with :kbd:`Enter`, the matching constraint is simply
added to the list. If you use :kbd:`Shift`:kbd:`Enter`, the interface proceeds to the
next dialog, which allows you to edit the suggested constraint parameters to
suit your need, and set the item count range.
.. image:: /docs/images/workflow-new2.png
Pressing :kbd:`s` (or, with the example config, Alt-W in the :kbd:`z` stocks screen)
opens the overall status screen:
.. image:: /docs/images/workflow-status.png
This screen shows all currently existing workflow constraints, and allows
monitoring and/or changing them from one screen. The constraint list can
be filtered by typing text in the field below.
The color of the stock level number indicates how "healthy" the stock level
is, based on current count and trend. Bright green is very good, green is good,
red is bad, bright red is very bad.
The limit number is also color-coded. Red means that there are currently no
workshops producing that item (i.e. no jobs). If it's yellow, that means the
production has been delayed, possibly due to lack of input materials.
The chart on the right is a plot of the last 14 days (28 half day plots) worth
of stock history for the selected item, with the rightmost point representing
the current stock value. The bright green dashed line is the target
limit (maximum) and the dark green line is that minus the gap (minimum).
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,53 @@
-- Show and modify properties of jobs in a workshop. -- Show and modify properties of jobs in a workshop.
--[[=begin
gui/workshop-job
================
Bind to a key (the example config uses :kbd:`Alt`:kbd:`a`), and activate with a job selected in
a workshop in the :kbd:`q` mode.
.. image:: /docs/images/workshop-job.png
The script shows a list of the input reagents of the selected job, and allows changing
them like the `job` ``item-type`` and `job` ``item-material`` commands.
Specifically, pressing the :kbd:`i` key pops up a dialog that lets you select an item
type from a list.
.. image:: /docs/images/workshop-job-item.png
Pressing :kbd:`m`, unless the item type does not allow a material,
lets you choose a material.
.. image:: /docs/images/workshop-job-material.png
Since there are a lot more materials than item types, this dialog is more complex
and uses a hierarchy of sub-menus. List choices that open a sub-menu are marked
with an arrow on the left.
.. warning::
Due to the way input reagent matching works in DF, you must select an item type
if you select a material, or the material will be matched incorrectly in some cases.
If you press :kbd:`m` without choosing an item type, the script will auto-choose
if there is only one valid choice, or pop up an error message box instead of the
material selection dialog.
Note that both materials and item types presented in the dialogs are filtered
by the job input flags, and even the selected item type for material selection,
or material for item type selection. Many jobs would let you select only one
input item type.
For example, if you choose a *plant* input item type for your prepare meal job,
it will only let you select cookable materials.
If you choose a *barrel* item instead (meaning things stored in barrels, like
drink or milk), it will let you select any material, since in this case the
material is matched against the barrel itself. Then, if you select, say, iron,
and then try to change the input item type, now it won't let you select *plant*;
you have to unset the material first.
=end]]
local utils = require 'utils' local utils = require 'utils'
local gui = require 'gui' local gui = require 'gui'
local guidm = require 'gui.dwarfmode' local guidm = require 'gui.dwarfmode'

@ -1,5 +1,22 @@
-- Creates a pit under the target leading straight to the Underworld. Type '?' for help. -- Creates a pit under the target leading straight to the Underworld. Type '?' for help.
-- Based on script by IndigoFenix, @ https://gist.github.com/IndigoFenix/8776696 -- Based on script by IndigoFenix, @ https://gist.github.com/IndigoFenix/8776696
--[[=begin
hfs-pit
=======
Creates a pit to the underworld at the cursor.
Takes three arguments: diameter of the pit in tiles, whether to wall off
the pit, and whether to insert stairs. If no arguments are given, the default
is ``hfs-pit 1 0 0``, ie single-tile wide with no walls or stairs.::
hfs-pit 4 0 1
hfs-pit 2 1 0
First example is a four-across pit with stairs but no walls; second is a
two-across pit with stairs but no walls.
=end]]
args={...} args={...}

@ -1,4 +1,11 @@
-- prints info on assigned hotkeys to the console -- prints info on assigned hotkeys to the console
--[[=begin
hotkey-notes
============
Lists the key, name, and jump position of your hotkeys in the DFHack console.
=end]]
for i=1, #df.global.ui.main.hotkeys do for i=1, #df.global.ui.main.hotkeys do
local hk = df.global.ui.main.hotkeys[i-1] local hk = df.global.ui.main.hotkeys[i-1]

@ -1,5 +1,14 @@
-- Holds custom descriptions for view-item-info -- Holds custom descriptions for view-item-info
-- By PeridexisErrant -- By PeridexisErrant
--[[=begin
item-descriptions
=================
Exports a table with custom description text for every item in the game.
Used by `view-item-info`; see instructions there for how to override
for mods.
=end]]
-- Each line near the bottom has 53 characters of room until -- Each line near the bottom has 53 characters of room until
-- it starts clipping over the UI in an ugly fashion. -- it starts clipping over the UI in an ugly fashion.

@ -1,4 +1,22 @@
# control your levers from the dfhack console # control your levers from the dfhack console
=begin
lever
=====
Allow manipulation of in-game levers from the dfhack console.
Can list levers, including state and links, with::
lever list
To queue a job so that a dwarf will pull the lever 42, use ``lever pull 42``.
This is the same as :kbd:`q` querying the building and queue a :kbd:`P` pull request.
To magically toggle the lever immediately, use::
lever pull 42 --now
=end
def lever_pull_job(bld) def lever_pull_job(bld)
ref = DFHack::GeneralRefBuildingHolderst.cpp_new ref = DFHack::GeneralRefBuildingHolderst.cpp_new

@ -1,4 +1,22 @@
# scan the map for ore veins # scan the map for ore veins
=begin
locate-ore
==========
Scan the map for metal ores.
Finds and designate for digging one tile of a specific metal ore.
Only works for native metal ores, does not handle reaction stuff (eg STEEL).
When invoked with the ``list`` argument, lists metal ores available on the map.
Examples::
locate-ore list
locate-ore hematite
locate-ore iron
=end
target_ore = $script_args[0] target_ore = $script_args[0]

@ -1,5 +1,14 @@
-- On map load writes information about the loaded region to gamelog.txt -- On map load writes information about the loaded region to gamelog.txt
-- By Kurik Amudnil and Warmist (http://www.bay12forums.com/smf/index.php?topic=91166.msg4467072#msg4467072) -- By Kurik Amudnil and Warmist (http://www.bay12forums.com/smf/index.php?topic=91166.msg4467072#msg4467072)
--[[=begin
log-region
==========
When enabled in :file:`dfhack.init`, each time a fort is loaded identifying information
will be written to the gamelog. Assists in parsing the file if you switch
between forts, and adds information for story-building.
=end]]
local function write_gamelog(msg) local function write_gamelog(msg)
local log = io.open('gamelog.txt', 'a') local log = io.open('gamelog.txt', 'a')

@ -1,4 +1,28 @@
-- Execute lua commands interactively or from files. -- Execute lua commands interactively or from files.
--[[=begin
lua
===
There are the following ways to invoke this command:
1. ``lua`` (without any parameters)
This starts an interactive lua interpreter.
2. ``lua -f "filename"`` or ``lua --file "filename"``
This loads and runs the file indicated by filename.
3. ``lua -s ["filename"]`` or ``lua --save ["filename"]``
This loads and runs the file indicated by filename from the save
directory. If the filename is not supplied, it loads "dfhack.lua".
4. ``:lua`` *lua statement...*
Parses and executes the lua statement like the interactive interpreter would.
=end]]
local args={...} local args={...}
local cmd = args[1] local cmd = args[1]

@ -1,8 +1,16 @@
-- This script will modify a skill or the skills of a single unit -- This script will modify a skill or the skills of a single unit
-- usage is: target a unit in DF, and execute this script in dfhack
-- the skill will be increased to 20 (Legendary +5) -- the skill will be increased to 20 (Legendary +5)
-- arguments 'list', 'classes' and 'all' added
-- by vjek -- by vjek
--[[=begin
make-legendary
==============
Makes the selected dwarf legendary in one skill, a group of skills, or all
skills. View groups with ``make-legendary classes``, or all skills with
``make-legendary list``. Use ``make-legendary MINING`` when you need something
dug up, or ``make-legendary all`` when only perfection will do.
=end]]
-- this function will return the number of elements, starting at zero. -- this function will return the number of elements, starting at zero.
-- useful for counting things where #foo doesn't work -- useful for counting things where #foo doesn't work

@ -1,4 +1,12 @@
--set target unit as king/queen --set target unit as king/queen
--[[=begin
make-monarch
============
Make the selected unit King or Queen of your civilisation.
=end]]
local unit=dfhack.gui.getSelectedUnit() local unit=dfhack.gui.getSelectedUnit()
if not unit then qerror("No unit selected") end if not unit then qerror("No unit selected") end
local newfig=dfhack.units.getNemesis(unit).figure local newfig=dfhack.units.getNemesis(unit).figure

@ -1,6 +1,14 @@
-- Save a copy of a text screen in markdown (for reddit among others). Use 'markdown help' for more details. -- Save a copy of a text screen in markdown (for reddit among others). Use 'markdown help' for more details.
-- This is a derivatiwe work based upon scripts/forum-dwarves.lua by Caldfir and expwnent -- This is a derivatiwe work based upon scripts/forum-dwarves.lua by Caldfir and expwnent
-- Adapted for markdown by Mchl https://github.com/Mchl -- Adapted for markdown by Mchl https://github.com/Mchl
--[[=begin
markdown
========
Save a copy of a text screen in markdown (for reddit among others).
Use ``markdown help`` for more details.
=end]]
local args = {...} local args = {...}

@ -1,4 +1,15 @@
# pit all caged creatures in a zone # pit all caged creatures in a zone
=begin
masspit
=======
Designate all creatures in cages on top of a pit/pond activity zone for pitting.
Works best with an animal stockpile on top of the zone.
Works with a zone number as argument (eg ``Activity Zone #6`` -> ``masspit 6``)
or with the game cursor on top of the area.
=end
case $script_args[0] case $script_args[0]
when '?', 'help' when '?', 'help'

@ -1,2 +1,11 @@
-- Force a migrant wave (only works after hardcoded waves) -- Force a migrant wave (only works after hardcoded waves)
--@alias = 'devel/migrants-now' --@alias = 'devel/migrants-now'
--[[=begin
migrants-now
============
Forces an immediate migrant wave. Only works after migrants have
arrived naturally. Alias for ``devel/migrants-now``; equivalent to
`modtools/force` ``-eventType migrants``
=end]]

@ -0,0 +1,17 @@
``modtools/*`` scripts provide tools for modders, often with changes
to the raw files, and are not intended to be called manually by end-users.
These scripts are mostly useful for raw modders and scripters. They all have
standard arguments: arguments are of the form ``tool -argName1 argVal1
-argName2 argVal2``. This is equivalent to ``tool -argName2 argVal2 -argName1
argVal1``. It is not necessary to provide a value to an argument name: ``tool
-argName3`` is fine. Supplying the same argument name multiple times will
result in an error. Argument names are preceded with a dash. The ``-help``
argument will print a descriptive usage string describing the nature of the
arguments. For multiple word argument values, brackets must be used: ``tool
-argName4 [ sadf1 sadf2 sadf3 ]``. In order to allow passing literal braces as
part of the argument, backslashes are used: ``tool -argName4 [ \] asdf \foo ]``
sets ``argName4`` to ``\] asdf foo``. The ``*-trigger`` scripts have a similar
policy with backslashes.
Any of these scripts can be called with ``-help`` for more information.

@ -1,7 +1,12 @@
--modtools/add-syndrome.lua --modtools/add-syndrome.lua
--author expwnent --author expwnent
--add syndromes to a target, or remove them --[[=begin
modtools/add-syndrome
=====================
This allows adding and removing syndromes from units.
=end]]
local syndromeUtil = require 'syndrome-util' local syndromeUtil = require 'syndrome-util'
local utils = require 'utils' local utils = require 'utils'

Some files were not shown because too many files have changed in this diff Show More