Merge remote-tracking branch 'dfhack/develop'

develop
expwnent 2014-09-08 13:23:28 -04:00
commit 4800794ba6
10 changed files with 1182 additions and 1413 deletions

@ -182,7 +182,7 @@ IF(UNIX)
if(APPLE) if(APPLE)
SET(CPACK_GENERATOR "ZIP") SET(CPACK_GENERATOR "ZIP")
else() else()
SET(CPACK_GENERATOR "TGZ") SET(CPACK_GENERATOR "TBZ2")
endif() endif()
ELSEIF(WIN32) ELSEIF(WIN32)
SET(CPACK_GENERATOR "ZIP") SET(CPACK_GENERATOR "ZIP")

@ -3,13 +3,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
<title>Building DFHACK</title> <title>Building DFHACK</title>
<style type="text/css"> <style type="text/css">
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $ :Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
:Copyright: This stylesheet has been placed in the public domain. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. Default cascading style sheet for the HTML output of Docutils.
@ -77,7 +77,7 @@ div.tip p.admonition-title {
div.attention p.admonition-title, div.caution p.admonition-title, div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error { div.warning p.admonition-title {
color: red ; color: red ;
font-weight: bold ; font-weight: bold ;
font-family: sans-serif } font-family: sans-serif }
@ -249,19 +249,10 @@ pre.address {
margin-top: 0 ; margin-top: 0 ;
font: inherit } font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code { pre.literal-block, pre.doctest-block, pre.math {
margin-left: 2em ; margin-left: 2em ;
margin-right: 2em } margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier { span.classifier {
font-family: sans-serif ; font-family: sans-serif ;
font-style: oblique } font-style: oblique }
@ -313,21 +304,6 @@ table.docutils th.field-name, table.docinfo th.docinfo-name {
white-space: nowrap ; white-space: nowrap ;
padding-left: 0 } padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% } font-size: 100% }
@ -396,11 +372,14 @@ git submodule update
<h2><a class="toc-backref" href="#id6">Dependencies</a></h2> <h2><a class="toc-backref" href="#id6">Dependencies</a></h2>
<p>DFHack is meant to be installed into an existing DF folder, so get one ready.</p> <p>DFHack is meant to be installed into an existing DF folder, so get one ready.</p>
<p>For building, you need a 32-bit version of GCC. For example, to build DFHack on <p>For building, you need a 32-bit version of GCC. For example, to build DFHack on
a 64-bit distribution like Arch, you'll need the multilib development tools and libraries.</p> a 64-bit distribution like Arch, you'll need the multilib development tools and libraries.
Alternatively, you might be able to use <tt class="docutils literal">lxc</tt> to
<a class="reference external" href="http://www.bay12forums.com/smf/index.php?topic=139553.msg5435310#msg5435310">create a virtual 32-bit environment</a>.</p>
<p>Before you can build anything, you'll also need <tt class="docutils literal">cmake</tt>. It is advisable to also get <p>Before you can build anything, you'll also need <tt class="docutils literal">cmake</tt>. It is advisable to also get
<tt class="docutils literal">ccmake</tt> on distributions that split the cmake package into multiple parts.</p> <tt class="docutils literal">ccmake</tt> on distributions that split the cmake package into multiple parts.</p>
<p>For the code generation parts, you need perl and the XML::LibXML and XML::LibXSLT perl packages. <p>For the code generation parts, you need perl and the XML::LibXML and XML::LibXSLT perl packages.
You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt').</p> You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt').</p>
<p>To build Stonesense, you'll also need OpenGL headers.</p>
</div> </div>
<div class="section" id="build"> <div class="section" id="build">
<h2><a class="toc-backref" href="#id7">Build</a></h2> <h2><a class="toc-backref" href="#id7">Build</a></h2>
@ -489,7 +468,7 @@ process. Just stick with the defaults for everything and you'll be fine.</p>
</li> </li>
<li><p class="first">Get the dfhack source:</p> <li><p class="first">Get the dfhack source:</p>
<pre class="literal-block"> <pre class="literal-block">
git clone https://github.com/danaris/dfhack.git git clone git://github.com/DFHack/dfhack.git
cd dfhack cd dfhack
git submodule init git submodule init
git submodule update git submodule update

@ -33,6 +33,8 @@ DFHack is meant to be installed into an existing DF folder, so get one ready.
For building, you need a 32-bit version of GCC. For example, to build DFHack on For building, you need a 32-bit version of GCC. For example, to build DFHack on
a 64-bit distribution like Arch, you'll need the multilib development tools and libraries. a 64-bit distribution like Arch, you'll need the multilib development tools and libraries.
Alternatively, you might be able to use ``lxc`` to
`create a virtual 32-bit environment <http://www.bay12forums.com/smf/index.php?topic=139553.msg5435310#msg5435310>`_.
Before you can build anything, you'll also need ``cmake``. It is advisable to also get Before you can build anything, you'll also need ``cmake``. It is advisable to also get
``ccmake`` on distributions that split the cmake package into multiple parts. ``ccmake`` on distributions that split the cmake package into multiple parts.
@ -40,6 +42,8 @@ Before you can build anything, you'll also need ``cmake``. It is advisable to al
For the code generation parts, you need perl and the XML::LibXML and XML::LibXSLT perl packages. For the code generation parts, you need perl and the XML::LibXML and XML::LibXSLT perl packages.
You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt'). You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt').
To build Stonesense, you'll also need OpenGL headers.
Build Build
===== =====
Building is fairly straightforward. Enter the ``build`` folder and start the build like this:: Building is fairly straightforward. Enter the ``build`` folder and start the build like this::
@ -118,7 +122,7 @@ If you are building on 10.6, please read the subsection below titled "Snow Leopa
6. Get the dfhack source:: 6. Get the dfhack source::
git clone https://github.com/danaris/dfhack.git git clone git://github.com/DFHack/dfhack.git
cd dfhack cd dfhack
git submodule init git submodule init
git submodule update git submodule update

@ -3,13 +3,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
<title>DFHack Lua API</title> <title>DFHack Lua API</title>
<style type="text/css"> <style type="text/css">
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $ :Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
:Copyright: This stylesheet has been placed in the public domain. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. Default cascading style sheet for the HTML output of Docutils.
@ -77,7 +77,7 @@ div.tip p.admonition-title {
div.attention p.admonition-title, div.caution p.admonition-title, div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error { div.warning p.admonition-title {
color: red ; color: red ;
font-weight: bold ; font-weight: bold ;
font-family: sans-serif } font-family: sans-serif }
@ -249,19 +249,10 @@ pre.address {
margin-top: 0 ; margin-top: 0 ;
font: inherit } font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code { pre.literal-block, pre.doctest-block, pre.math {
margin-left: 2em ; margin-left: 2em ;
margin-right: 2em } margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier { span.classifier {
font-family: sans-serif ; font-family: sans-serif ;
font-style: oblique } font-style: oblique }
@ -313,21 +304,6 @@ table.docutils th.field-name, table.docinfo th.docinfo-name {
white-space: nowrap ; white-space: nowrap ;
padding-left: 0 } padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% } font-size: 100% }
@ -1757,6 +1733,15 @@ functions in this section, this may be used at any time.</p>
<p>Returns the string that should be used to represent the given <p>Returns the string that should be used to represent the given
logical keybinding on the screen in texts like &quot;press Key to ...&quot;.</p> logical keybinding on the screen in texts like &quot;press Key to ...&quot;.</p>
</li> </li>
<li><p class="first"><tt class="docutils literal">dfhack.screen.keyToChar(key)</tt></p>
<p>Returns the integer character code of the string input
character represented by the given logical keybinding,
or <em>nil</em> if not a string input key.</p>
</li>
<li><p class="first"><tt class="docutils literal">dfhack.screen.charToKey(charcode)</tt></p>
<p>Returns the keybinding representing the given string input
character, or <em>nil</em> if impossible.</p>
</li>
</ul> </ul>
<p>The &quot;pen&quot; argument used by functions above may be represented by <p>The &quot;pen&quot; argument used by functions above may be represented by
a table with the following possible fields:</p> a table with the following possible fields:</p>
@ -3230,6 +3215,18 @@ tweaking (e.g. adding custom reactions)</p>
<li><p class="first"><tt class="docutils literal">onInventoryChange(unit_id,item_id,old_equip,new_equip)</tt></p> <li><p class="first"><tt class="docutils literal">onInventoryChange(unit_id,item_id,old_equip,new_equip)</tt></p>
<p>Gets called when someone picks up an item, puts one down, or changes the way they are holding it. If an item is picked up, old_equip will be null. If an item is dropped, new_equip will be null. If an item is re-equipped in a new way, then neither will be null. You absolutely must NOT alter either old_equip or new_equip or you might break other plugins.</p> <p>Gets called when someone picks up an item, puts one down, or changes the way they are holding it. If an item is picked up, old_equip will be null. If an item is dropped, new_equip will be null. If an item is re-equipped in a new way, then neither will be null. You absolutely must NOT alter either old_equip or new_equip or you might break other plugins.</p>
</li> </li>
<li><p class="first"><tt class="docutils literal">onReport(reportId)</tt></p>
<p>Gets called when a report happens. This happens more often than you probably think, even if it doesn't show up in the announcements.</p>
</li>
<li><p class="first"><tt class="docutils literal">onUnitAttack(attackerId, defenderId, woundId)</tt></p>
<p>Called when a unit wounds another with a weapon. Is NOT called if blocked, dodged, deflected, or parried.</p>
</li>
<li><p class="first"><tt class="docutils literal">onUnload()</tt></p>
<p>A convenience event in case you don't want to register for every onStateChange event.</p>
</li>
<li><p class="first"><tt class="docutils literal">onInteraction(attackVerb, defendVerb, attackerId, defenderId, attackReportId, defendReportId)</tt></p>
<p>Called when a unit uses an interaction on another.</p>
</li>
</ol> </ol>
</div> </div>
<div class="section" id="functions"> <div class="section" id="functions">

File diff suppressed because it is too large Load Diff

@ -17,13 +17,14 @@ access DF memory and allow for easier development of new tools.
Getting DFHack Getting DFHack
============== ==============
The project is currently hosted on github_ The project is currently hosted on github_
at http://github.com/peterix/dfhack at http://github.com/DFHack/dfhack
.. _github: http://www.github.com/ .. _github: http://www.github.com/
Releases can be downloaded from here: http://dethware.org/dfhack/download Older releases can be downloaded from here: http://dethware.org/dfhack/download
All new releases are announced in the bay12 thread: http://tinyurl.com/dfhack-ng All new releases are announced in the bay12 thread:
http://www.bay12forums.com/smf/index.php?topic=139553.0
============= =============
Compatibility Compatibility
@ -31,7 +32,7 @@ Compatibility
DFHack works on Windows XP, Vista, 7, any modern Linux distribution, or OS X DFHack works on Windows XP, Vista, 7, any modern Linux distribution, or OS X
10.6.8-10.9. 10.6.8-10.9.
Currently, version 0.34.11 is supported (and tested). If you need DFHack Currently, version 0.40.08 is supported (and tested). If you need DFHack
for older versions, look for older releases. for older versions, look for older releases.
On Windows, you have to use the SDL version of DF. On Windows, you have to use the SDL version of DF.
@ -130,16 +131,13 @@ DFHack includes a small stand-alone utility for applying and removing
binary patches from the game executable. Use it from the regular operating binary patches from the game executable. Use it from the regular operating
system console: system console:
* ``binpatch check "Dwarf Fortress.exe" patch.dif`` ``binpatch check "Dwarf Fortress.exe" patch.dif``
Checks and prints if the patch is currently applied. Checks and prints if the patch is currently applied.
* ``binpatch apply "Dwarf Fortress.exe" patch.dif`` ``binpatch apply "Dwarf Fortress.exe" patch.dif``
Applies the patch, unless it is already applied or in conflict. Applies the patch, unless it is already applied or in conflict.
* ``binpatch remove "Dwarf Fortress.exe" patch.dif`` ``binpatch remove "Dwarf Fortress.exe" patch.dif``
Removes the patch, unless it is already removed. Removes the patch, unless it is already removed.
The patches are expected to be encoded in text format used by IDA. The patches are expected to be encoded in text format used by IDA.
@ -185,12 +183,14 @@ Currently it supports any combination of Ctrl/Alt/Shift with F1-F9, or A-Z.
Possible ways to call the command: Possible ways to call the command:
:keybinding list <key>: List bindings active for the key combination. ``keybinding list <key>``
:keybinding clear <key> <key>...: Remove bindings for the specified keys. List bindings active for the key combination.
:keybinding add <key> "cmdline" "cmdline"...: Add bindings for the specified ``keybinding clear <key> <key>...``
key. Remove bindings for the specified keys.
:keybinding set <key> "cmdline" "cmdline"...: Clear, and then add bindings for ``keybinding add <key> "cmdline" "cmdline"...``
the specified key. Add bindings for the specified key.
``keybinding set <key> "cmdline" "cmdline"...``
Clear, and then add bindings for the specified key.
The *<key>* parameter above has the following *case-sensitive* syntax:: The *<key>* parameter above has the following *case-sensitive* syntax::
@ -320,14 +320,17 @@ Allows renaming various things.
Options: Options:
:rename squad <index> "name": Rename squad by index to 'name'. ``rename squad <index> "name"``
:rename hotkey <index> \"name\": Rename hotkey by index. This allows assigning Rename squad by index to 'name'.
``rename hotkey <index> \"name\"``
Rename hotkey by index. This allows assigning
longer commands to the DF hotkeys. longer commands to the DF hotkeys.
:rename unit "nickname": Rename a unit/creature highlighted in the DF user ``rename unit "nickname"``
interface. Rename a unit/creature highlighted in the DF user interface.
:rename unit-profession "custom profession": Change proffession name of the ``rename unit-profession "custom profession"``
highlighted unit/creature. Change proffession name of the highlighted unit/creature.
:rename building "name": Set a custom name for the selected building. ``rename building "name"``
Set a custom name for the selected building.
The building must be one of stockpile, workshop, furnace, trap, The building must be one of stockpile, workshop, furnace, trap,
siege engine or an activity zone. siege engine or an activity zone.
@ -347,12 +350,18 @@ http://www.bay12forums.com/smf/index.php?topic=128487.0
Options: Options:
:rendermax trippy: Randomizes each tiles color. Used for fun mainly. ``rendermax trippy``
:rendermax light: Enable lighting engine. Randomizes each tiles color. Used for fun mainly.
:rendermax light reload: Reload the settings file. ``rendermax light``
:rendermax light sun <x>|cycle: Set time to <x> (in hours) or set it to df time cycle. Enable lighting engine.
:rendermax occlusionON|occlusionOFF: Show debug occlusion info. ``rendermax light reload``
:rendermax disable: Disable any filter that is enabled. Reload the settings file.
``rendermax light sun <x>|cycle``
Set time to <x> (in hours) or set it to df time cycle.
``rendermax occlusionON|occlusionOFF``
Show debug occlusion info.
``rendermax disable``
Disable any filter that is enabled.
An image showing lava and dragon breath. Not pictured here: sunlight, shining items/plants, An image showing lava and dragon breath. Not pictured here: sunlight, shining items/plants,
materials that color the light etc... materials that color the light etc...
@ -381,9 +390,11 @@ A package of different adventure mode tools (currently just one)
Usage: Usage:
:list-equipped [all]: List armor and weapons equipped by your companions. ``list-equipped [all]``
List armor and weapons equipped by your companions.
If all is specified, also lists non-metal clothing. If all is specified, also lists non-metal clothing.
:metal-detector [all-types] [non-trader]: Reveal metal armor and weapons in ``metal-detector [all-types] [non-trader]``
Reveal metal armor and weapons in
shops. The options disable the checks shops. The options disable the checks
on item type and being in shop. on item type and being in shop.
@ -522,6 +533,7 @@ Allows creating new items of arbitrary types and made of arbitrary materials.
By default, items created are spawned at the feet of the selected unit. By default, items created are spawned at the feet of the selected unit.
Specify the item and material information as you would indicate them in custom reaction raws, with the following differences: Specify the item and material information as you would indicate them in custom reaction raws, with the following differences:
* Separate the item and material with a space rather than a colon * Separate the item and material with a space rather than a colon
* If the item has no subtype, omit the :NONE * If the item has no subtype, omit the :NONE
* If the item is REMAINS, FISH, FISH_RAW, VERMIN, PET, or EGG, specify a CREATURE:CASTE pair instead of a material token. * If the item is REMAINS, FISH, FISH_RAW, VERMIN, PET, or EGG, specify a CREATURE:CASTE pair instead of a material token.
@ -529,6 +541,7 @@ Specify the item and material information as you would indicate them in custom r
Corpses, body parts, and prepared meals cannot be created using this tool. Corpses, body parts, and prepared meals cannot be created using this tool.
Examples: Examples:
``createitem GLOVES:ITEM_GLOVES_GAUNTLETS INORGANIC:STEEL 2`` ``createitem GLOVES:ITEM_GLOVES_GAUNTLETS INORGANIC:STEEL 2``
Create 2 pairs of steel gauntlets. Create 2 pairs of steel gauntlets.
``createitem WOOD PLANT_MAT:TOWER_CAP:WOOD`` ``createitem WOOD PLANT_MAT:TOWER_CAP:WOOD``
@ -539,6 +552,7 @@ Examples:
To change where new items are placed, first run the command with a destination type while an appropriate destination is selected. To change where new items are placed, first run the command with a destination type while an appropriate destination is selected.
Options: Options:
:floor: Subsequent items will be placed on the floor beneath the selected unit's feet. :floor: Subsequent items will be placed on the floor beneath the selected unit's feet.
:item: Subsequent items will be stored inside the currently selected item. :item: Subsequent items will be stored inside the currently selected item.
:building: Subsequent items will become part of the currently selected building. Best used for loading traps; do not use with workshops, or you will need to deconstruct the building to use the item. :building: Subsequent items will become part of the currently selected building. Best used for loading traps; do not use with workshops, or you will need to deconstruct the building to use the item.
@ -569,6 +583,7 @@ infiniteSky
Automatically allocates new z-levels of sky at the top of the map as you build up, or on request allocates many levels all at once. Automatically allocates new z-levels of sky at the top of the map as you build up, or on request allocates many levels all at once.
Examples: Examples:
``infiniteSky n`` ``infiniteSky n``
Raise the sky by n z-levels. Raise the sky by n z-levels.
``infiniteSky enable/disable`` ``infiniteSky enable/disable``
@ -614,9 +629,7 @@ general shape (WALL, FLOOR, etc.), general material (SOIL, STONE, MINERAL,
etc.), state of 'designated', 'hidden' and 'light' flags. etc.), state of 'designated', 'hidden' and 'light' flags.
The properties of filter and paint can be partially defined. This means that The properties of filter and paint can be partially defined. This means that
you can for example do something like this: you can for example do something like this::
::
filter material STONE filter material STONE
filter shape FORTIFICATION filter shape FORTIFICATION
@ -624,8 +637,7 @@ you can for example do something like this:
This will turn all stone fortifications into floors, preserving the material. This will turn all stone fortifications into floors, preserving the material.
Or this: Or this::
::
filter shape FLOOR filter shape FLOOR
filter material MINERAL filter material MINERAL
@ -635,9 +647,7 @@ Turning mineral vein floors back into walls.
The tool also allows tweaking some tile flags: The tool also allows tweaking some tile flags:
Or this: Or this::
::
paint hidden 1 paint hidden 1
paint hidden 0 paint hidden 0
@ -647,23 +657,17 @@ This will hide previously revealed tiles (or show hidden with the 0 option).
More recently, the tool supports changing the base material of the tile to More recently, the tool supports changing the base material of the tile to
an arbitrary stone from the raws, by creating new veins as required. Note an arbitrary stone from the raws, by creating new veins as required. Note
that this mode paints under ice and constructions, instead of overwriting that this mode paints under ice and constructions, instead of overwriting
them. To enable, use: them. To enable, use::
::
paint stone MICROCLINE paint stone MICROCLINE
This mode is incompatible with the regular ``material`` setting, so changing This mode is incompatible with the regular ``material`` setting, so changing
it cancels the specific stone selection: it cancels the specific stone selection::
::
paint material ANY paint material ANY
Since different vein types have different drop rates, it is possible to choose Since different vein types have different drop rates, it is possible to choose
which one to use in painting: which one to use in painting::
::
paint veintype CLUSTER_SMALL paint veintype CLUSTER_SMALL
@ -671,9 +675,7 @@ When the chosen type is ``CLUSTER`` (the default), the tool may automatically
choose to use layer stone or lava stone instead of veins if its material matches choose to use layer stone or lava stone instead of veins if its material matches
the desired one. the desired one.
Any paint or filter option (or the entire paint or filter) can be disabled entirely by using the ANY keyword: Any paint or filter option (or the entire paint or filter) can be disabled entirely by using the ANY keyword::
::
paint hidden ANY paint hidden ANY
paint shape ANY paint shape ANY
@ -682,14 +684,13 @@ Any paint or filter option (or the entire paint or filter) can be disabled entir
filter any filter any
You can use several different brushes for painting tiles: You can use several different brushes for painting tiles:
* Point. (point) * Point. (point)
* Rectangular range. (range) * Rectangular range. (range)
* A column ranging from current cursor to the first solid tile above. (column) * A column ranging from current cursor to the first solid tile above. (column)
* DF map block - 16x16 tiles, in a regular grid. (block) * DF map block - 16x16 tiles, in a regular grid. (block)
Example: Example::
::
range 10 10 1 range 10 10 1
@ -720,6 +721,7 @@ Fills all the adamantine veins again. Veins that were hollow will be left
alone. alone.
Options: Options:
:hollow: fill in naturally hollow veins too :hollow: fill in naturally hollow veins too
Beware that filling in hollow veins will trigger a demon invasion on top of Beware that filling in hollow veins will trigger a demon invasion on top of
@ -730,6 +732,7 @@ plant
A tool for creating shrubs, growing, or getting rid of them. A tool for creating shrubs, growing, or getting rid of them.
Subcommands: Subcommands:
:create: Create a new shrub/sapling. :create: Create a new shrub/sapling.
:grow: Make saplings grow into trees. :grow: Make saplings grow into trees.
:extirpate: Kills trees and shrubs, turning them into ashes instantly. :extirpate: Kills trees and shrubs, turning them into ashes instantly.
@ -745,6 +748,7 @@ Works on all shrubs of the map if the cursor is hidden.
``extirpate`` and ``immolate`` work only on the plant under the cursor. ``extirpate`` and ``immolate`` work only on the plant under the cursor.
For mass effects, use one of the additional options: For mass effects, use one of the additional options:
:shrubs: affect all shrubs on the map :shrubs: affect all shrubs on the map
:trees: affect all trees on the map :trees: affect all trees on the map
:all: affect every plant! :all: affect every plant!
@ -976,12 +980,12 @@ After you have a pattern set, you can use 'expdig' to apply it again.
Examples: Examples:
designate the diagonal 5 patter over all hidden tiles: ``expdig diag5 hidden``
* expdig diag5 hidden Designate the diagonal 5 patter over all hidden tiles
apply last used pattern and filter: ``expdig``
* expdig Apply last used pattern and filter
Take current designations and replace them with the ladder pattern: ``expdig ladder designated``
* expdig ladder designated Take current designations and replace them with the ladder pattern
digcircle digcircle
--------- ---------
@ -1070,7 +1074,8 @@ Other Options:
Example: Example:
'filltraffic H' - When used in a room with doors, it will set traffic to HIGH in just that room. ``filltraffic H``
When used in a room with doors, it will set traffic to HIGH in just that room.
alltraffic alltraffic
---------- ----------
@ -1085,7 +1090,8 @@ Traffic Type Codes:
Example: Example:
'alltraffic N' - Set traffic to 'normal' for all tiles. ``alltraffic N``
Set traffic to 'normal' for all tiles.
restrictliquid restrictliquid
-------------- --------------
@ -1254,9 +1260,6 @@ Subcommands that persist until disabled or DF quit:
:stable-cursor: Saves the exact cursor position between t/q/k/d/etc menus of dwarfmode. :stable-cursor: Saves the exact cursor position between t/q/k/d/etc menus of dwarfmode.
:patrol-duty: Makes Train orders not count as patrol duty to stop unhappy thoughts. :patrol-duty: Makes Train orders not count as patrol duty to stop unhappy thoughts.
Does NOT fix the problem when soldiers go off-duty (i.e. civilian). Does NOT fix the problem when soldiers go off-duty (i.e. civilian).
:readable-build-plate: Fixes rendering of creature weight limits in pressure plate build menu.
.. image:: images/tweak-plate.png
:stable-temp: Fixes performance bug 6012 by squashing jitter in temperature updates. :stable-temp: Fixes performance bug 6012 by squashing jitter in temperature updates.
In very item-heavy forts with big stockpiles this can improve FPS by 50-100% In very item-heavy forts with big stockpiles this can improve FPS by 50-100%
@ -1264,9 +1267,6 @@ Subcommands that persist until disabled or DF quit:
of item temperature is crossed in no more than specified number of frames of item temperature is crossed in no more than specified number of frames
when updating from the environment temperature. This reduces the time it when updating from the environment temperature. This reduces the time it
takes for stable-temp to stop updates again when equilibrium is disturbed. takes for stable-temp to stop updates again when equilibrium is disturbed.
:fix-dimensions: Fixes subtracting small amount of thread/cloth/liquid from a stack
by splitting the stack and subtracting from the remaining single item.
This is a necessary addition to the binary patch in bug 808.
:advmode-contained: Works around bug 6202, i.e. custom reactions with container inputs :advmode-contained: Works around bug 6202, i.e. custom reactions with container inputs
in advmode. The issue is that the screen tries to force you to select in advmode. The issue is that the screen tries to force you to select
the contents separately from the container. This forcefully skips child the contents separately from the container. This forcefully skips child
@ -1281,14 +1281,6 @@ Subcommands that persist until disabled or DF quit:
.. image:: images/tweak-mil-color.png .. image:: images/tweak-mil-color.png
:military-training: Speeds up melee squad training by removing an almost certainly
unintended inverse dependency of training speed on unit count
(i.e. the more units you have, the slower it becomes), and making
the units spar more.
:hive-crash: The hive code crashes if there are ungathered products in a hive without bees (bug 6368).
This tweak prevents it by auto-gathering the products if this happens.
:craft-age-wear: Fixes the behavior of crafted items wearing out over time (bug 6003). :craft-age-wear: Fixes the behavior of crafted items wearing out over time (bug 6003).
With this tweak, items made from cloth and leather will gain a level of wear every 20 years. With this tweak, items made from cloth and leather will gain a level of wear every 20 years.
@ -1444,6 +1436,7 @@ job
Command for general job query and manipulation. Command for general job query and manipulation.
Options: Options:
*no extra options* *no extra options*
Print details of the current job. The job can be selected Print details of the current job. The job can be selected
in a workshop, or the unit/jobs screen. in a workshop, or the unit/jobs screen.
@ -1473,6 +1466,7 @@ Intended to be used as a keybinding:
job-duplicate job-duplicate
------------- -------------
Duplicate the selected job in a workshop: Duplicate the selected job in a workshop:
* In 'q' mode, when a job is highlighted within a workshop or furnace building, * In 'q' mode, when a job is highlighted within a workshop or furnace building,
instantly duplicates the job. instantly duplicates the job.
@ -1583,44 +1577,37 @@ The subsequent parts are optional:
Constraint examples Constraint examples
................... ...................
Keep metal bolts within 900-1000, and wood/bone within 150-200. Keep metal bolts within 900-1000, and wood/bone within 150-200::
::
workflow amount AMMO:ITEM_AMMO_BOLTS/METAL 1000 100 workflow amount AMMO:ITEM_AMMO_BOLTS/METAL 1000 100
workflow amount AMMO:ITEM_AMMO_BOLTS/WOOD,BONE 200 50 workflow amount AMMO:ITEM_AMMO_BOLTS/WOOD,BONE 200 50
Keep the number of prepared food & drink stacks between 90 and 120 Keep the number of prepared food & drink stacks between 90 and 120::
::
workflow count FOOD 120 30 workflow count FOOD 120 30
workflow count DRINK 120 30 workflow count DRINK 120 30
Make sure there are always 25-30 empty bins/barrels/bags. Make sure there are always 25-30 empty bins/barrels/bags::
::
workflow count BIN 30 workflow count BIN 30
workflow count BARREL 30 workflow count BARREL 30
workflow count BOX/CLOTH,SILK,YARN 30 workflow count BOX/CLOTH,SILK,YARN 30
Make sure there are always 15-20 coal and 25-30 copper bars. Make sure there are always 15-20 coal and 25-30 copper bars::
::
workflow count BAR//COAL 20 workflow count BAR//COAL 20
workflow count BAR//COPPER 30 workflow count BAR//COPPER 30
Produce 15-20 gold crafts. Produce 15-20 gold crafts::
::
workflow count CRAFTS//GOLD 20 workflow count CRAFTS//GOLD 20
Collect 15-20 sand bags and clay boulders. Collect 15-20 sand bags and clay boulders::
::
workflow count POWDER_MISC/SAND 20 workflow count POWDER_MISC/SAND 20
workflow count BOULDER/CLAY 20 workflow count BOULDER/CLAY 20
Make sure there are always 80-100 units of dimple dye. Make sure there are always 80-100 units of dimple dye::
::
workflow amount POWDER_MISC//MUSHROOM_CUP_DIMPLE:MILL 100 20 workflow amount POWDER_MISC//MUSHROOM_CUP_DIMPLE:MILL 100 20
@ -1630,8 +1617,7 @@ Make sure there are always 80-100 units of dimple dye.
on the Mill Plants job to MUSHROOM_CUP_DIMPLE using the 'job item-material' on the Mill Plants job to MUSHROOM_CUP_DIMPLE using the 'job item-material'
command. Otherwise the plugin won't be able to deduce the output material. command. Otherwise the plugin won't be able to deduce the output material.
Maintain 10-100 locally-made crafts of exceptional quality. Maintain 10-100 locally-made crafts of exceptional quality::
::
workflow count CRAFTS///LOCAL,EXCEPTIONAL 100 90 workflow count CRAFTS///LOCAL,EXCEPTIONAL 100 90
@ -1902,8 +1888,7 @@ autochop
Automatically manage tree cutting designation to keep available logs withing given Automatically manage tree cutting designation to keep available logs withing given
quotas. quotas.
Open the dashboard by running: Open the dashboard by running::
::
getplants autochop getplants autochop
@ -1948,6 +1933,7 @@ twice.
dfusion dfusion
------- -------
This is the DFusion lua plugin system by Warmist, running as a DFHack plugin. There are two parts to this plugin: an interactive script that shows a text based menu and lua modules. Some of the functionality of is intentionaly left out of the menu: This is the DFusion lua plugin system by Warmist, running as a DFHack plugin. There are two parts to this plugin: an interactive script that shows a text based menu and lua modules. Some of the functionality of is intentionaly left out of the menu:
:Friendship: a binary plugin that allows multi race forts (to use make a script that imports plugins.dfusion.friendship and use Friendship:install{table} table should contain list of race names.) :Friendship: a binary plugin that allows multi race forts (to use make a script that imports plugins.dfusion.friendship and use Friendship:install{table} table should contain list of race names.)
:Embark: a binary plugin that allows multi race embark (to use make a script that imports plugins.dfusion.embark and use Embark:install{table} table should contain list of race names or list of pairs (race-name, caste_id)). :Embark: a binary plugin that allows multi race embark (to use make a script that imports plugins.dfusion.embark and use Embark:install{table} table should contain list of race names or list of pairs (race-name, caste_id)).
@ -2229,8 +2215,7 @@ use in your farming plots.
With a seed type, the script will grow 100 of these seeds, ready to be With a seed type, the script will grow 100 of these seeds, ready to be
harvested. You can change the number with a 2nd argument. harvested. You can change the number with a 2nd argument.
For example, to grow 40 plump helmet spawn: For example, to grow 40 plump helmet spawn::
::
growcrops plump 40 growcrops plump 40
@ -2259,6 +2244,7 @@ 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. When invoked with the ``list`` argument, lists metal ores available on the map.
Examples:: Examples::
locate-ore list locate-ore list
locate-ore hematite locate-ore hematite
locate-ore iron locate-ore iron
@ -2300,6 +2286,7 @@ character ; and all parts are run sequencially as independent
dfhack commands. Useful for hotkeys. dfhack commands. Useful for hotkeys.
Example:: Example::
multicmd locate-ore iron ; digv multicmd locate-ore iron ; digv
quicksave quicksave
@ -2411,6 +2398,19 @@ alternatively pass cage IDs as arguments::
stripcaged weapons 25321 34228 stripcaged weapons 25321 34228
teleport
========
Teleports a unit to given coordinates.
Examples::
teleport showunitid - prints unitid beneath cursor
teleport showpos - prints coordinates beneath cursor
teleport unit 1234 x 56 y 115 z 26 - teleports unit 1234 to 56,115,26
One or both of ``unit`` and ``x``/``y``/``z`` coordinate positions must be
specified. If one is omitted, the unit or position beneath the cursor is used.
undump-buildings undump-buildings
================ ================
Undesignates building base materials for dumping. Undesignates building base materials for dumping.

2
build/.gitignore vendored

@ -1,2 +1,4 @@
VC2010 VC2010
DF_PATH.txt DF_PATH.txt
_CPack_Packages
*.tar.*

@ -490,6 +490,13 @@ struct tradeview_hook : public df::viewscreen_tradegoodsst
{ {
INTERPOSE_NEXT(render)(); INTERPOSE_NEXT(render)();
if (counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer,
// so there is nothing to mark.
return;
}
// Insert into the blank line between trade items and standard keys. // Insert into the blank line between trade items and standard keys.
// The blank line at the bottom is taken by the search plugin. // The blank line at the bottom is taken by the search plugin.
auto dim = Screen::getWindowSize(); auto dim = Screen::getWindowSize();

@ -408,7 +408,7 @@ protected:
//bool redo_search; //bool redo_search;
string search_string; string search_string;
private: protected:
int *cursor_pos; int *cursor_pos;
char select_key; char select_key;
bool valid; bool valid;
@ -1074,15 +1074,24 @@ class trade_search_merc : public trade_search_base
public: public:
virtual void render() const virtual void render() const
{ {
if (viewscreen->counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer.
// Not only is there nothing to search,
// but the native hotkeys are where we normally write.
return;
}
print_search_option(2, -1); print_search_option(2, -1);
if (!search_string.empty()) if (!search_string.empty())
{ {
make_text_dim(2, 37, 22);
make_text_dim(42, gps->dimx-2, 22);
int32_t x = 2; int32_t x = 2;
int32_t y = gps->dimy - 3; int32_t y = gps->dimy - 3;
OutputString(COLOR_YELLOW, x, y, "Note: Clear search to trade"); make_text_dim(2, 37, y);
make_text_dim(42, gps->dimx-2, y);
OutputString(COLOR_LIGHTRED, x, y, string(1, select_key + 'A' - 'a'));
OutputString(COLOR_WHITE, x, y, ": Clear search to trade ");
} }
} }
@ -1116,15 +1125,24 @@ class trade_search_fort : public trade_search_base
public: public:
virtual void render() const virtual void render() const
{ {
if (viewscreen->counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer.
// Not only is there nothing to search,
// but the native hotkeys are where we normally write.
return;
}
print_search_option(42, -1); print_search_option(42, -1);
if (!search_string.empty()) if (!search_string.empty())
{ {
make_text_dim(2, 37, 22);
make_text_dim(42, gps->dimx-2, 22);
int32_t x = 42; int32_t x = 42;
int32_t y = gps->dimy - 3; int32_t y = gps->dimy - 3;
OutputString(COLOR_YELLOW, x, y, "Note: Clear search to trade"); make_text_dim(2, 37, y);
make_text_dim(42, gps->dimx-2, y);
OutputString(COLOR_LIGHTRED, x, y, string(1, select_key + 'A' - 'a'));
OutputString(COLOR_WHITE, x, y, ": Clear search to trade ");
} }
} }

@ -5,7 +5,7 @@ def display_death_event(e)
str << " (cause: #{e.death_cause.to_s.downcase})," str << " (cause: #{e.death_cause.to_s.downcase}),"
str << " killed by the #{e.slayer_race_tg.name[0]} #{e.slayer_hf_tg.name}" if e.slayer_hf != -1 str << " killed by the #{e.slayer_race_tg.name[0]} #{e.slayer_hf_tg.name}" if e.slayer_hf != -1
str << " using a #{df.world.raws.itemdefs.weapons[e.weapon.item_subtype].name}" if e.weapon.item_type == :WEAPON str << " using a #{df.world.raws.itemdefs.weapons[e.weapon.item_subtype].name}" if e.weapon.item_type == :WEAPON
str << ", shot by a #{df.world.raws.itemdefs.weapons[e.weapon.bow_item_subtype].name}" if e.weapon.bow_item_type == :WEAPON str << ", shot by a #{df.world.raws.itemdefs.weapons[e.weapon.shooter_item_subtype].name}" if e.weapon.shooter_item_type == :WEAPON
puts str.chomp(',') + '.' puts str.chomp(',') + '.'
end end