diff --git a/.gitignore b/.gitignore index f59050964..88cb2c085 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ build/VC2010 # Sphinx generated documentation docs/_*/ +docs/html/ #except for the real one !build/ diff --git a/.gitmodules b/.gitmodules index 961850a67..ea1822e55 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,4 +15,19 @@ url = git://github.com/DFHack/clsocket.git [submodule "scripts/3rdparty/lethosor"] path = scripts/3rdparty/lethosor - url = https://github.com/DFHack/lethosor-scripts + url = git://github.com/DFHack/lethosor-scripts +[submodule "scripts/3rdparty/roses"] + path = scripts/3rdparty/roses + url = git://github.com/DFHack/roses-scripts.git +[submodule "scripts/3rdparty/maxthyme"] + path = scripts/3rdparty/maxthyme + url = git://github.com/DFHack/maxthyme-scripts.git +[submodule "scripts/3rdparty/dscorbett"] + path = scripts/3rdparty/dscorbett + url = git://github.com/DFHack/dscorbett-scripts.git +[submodule "scripts/3rdparty/kane-t"] + path = scripts/3rdparty/kane-t + url = git://github.com/DFHack/kane-t-scripts.git +[submodule "scripts/3rdparty/maienm"] + path = scripts/3rdparty/maienm + url = git://github.com/DFHack/maienm-scripts.git diff --git a/.travis.yml b/.travis.yml index 534b2e2e4..6f9864539 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,5 @@ script: - python travis/script-in-readme.py - python travis/script-syntax.py --ext=lua --cmd="luac$LUA_VERSION -p" - python travis/script-syntax.py --ext=rb --cmd="ruby -c" -- make html notifications: email: false diff --git a/CMake/Modules/FindSphinx.cmake b/CMake/Modules/FindSphinx.cmake new file mode 100644 index 000000000..54fc5ea8d --- /dev/null +++ b/CMake/Modules/FindSphinx.cmake @@ -0,0 +1,16 @@ +# build the documentation with Sphinx +find_program(SPHINX_EXECUTABLE NAMES sphinx-build + HINTS + $ENV{SPHINX_DIR} + PATH_SUFFIXES bin + DOC "Sphinx Documentation Generator" +) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Sphinx DEFAULT_MSG + SPHINX_EXECUTABLE +) + +mark_as_advanced(SPHINX_EXECUTABLE) + diff --git a/CMakeLists.txt b/CMakeLists.txt index d0f0585e5..065cb3b5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ else(CMAKE_CONFIGURATION_TYPES) endif (NOT CMAKE_BUILD_TYPE) endif(CMAKE_CONFIGURATION_TYPES) +SET(BUILD_DOCS "True" CACHE STRING "Choose whether to build the documentation (requires python and Sphinx.") + ## some generic CMake magic cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(dfhack) @@ -200,8 +202,9 @@ endif() IF(BUILD_LIBRARY) add_subdirectory (library) ## install the default documentation files - install(FILES LICENSE NEWS "Lua API.html" Readme.html Compile.html Contributors.html DESTINATION ${DFHACK_USERDOC_DESTINATION}) - install(DIRECTORY images 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() install(DIRECTORY dfhack-config/ DESTINATION dfhack-config/default) @@ -213,6 +216,37 @@ endif() add_subdirectory(scripts) +#find_package(Sphinx REQUIRED) +find_package(Sphinx) +if (BUILD_DOCS) + + 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) + + add_custom_target(dfhack_docs ALL + ${SPHINX_EXECUTABLE} + -q -b html + -c "${SPHINX_BINARY_BUILD_DIR}" + -d "${SPHINX_CACHE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${SPHINX_HTML_DIR}" + COMMENT "Building HTML documentation with Sphinx") + install(DIRECTORY ${dfhack_SOURCE_DIR}/docs/html + DESTINATION ${DFHACK_USERDOC_DESTINATION} + #FILES_MATCHING PATTERN "*.lua" + # PATTERN "*.rb" + # PATTERN "3rdparty" EXCLUDE + ) +endif() + # Packaging with CPack! IF(UNIX) if(APPLE) @@ -231,3 +265,5 @@ ELSE() ENDIF() set(CPACK_PACKAGE_FILE_NAME "dfhack-${DFHACK_VERSION}-${DFHACK_PACKAGE_PLATFORM_NAME}") INCLUDE(CPack) + +#INCLUDE(FindSphinx.cmake) diff --git a/LICENSE b/LICENSE index fd4f7abcb..1c8455ed1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,198 +1,200 @@ --------------------------------------------------------------------------------- -License of dfhack - +License of DFHack +================= https://github.com/peterix/dfhack Copyright (c) 2009-2012 Petr Mrázek (peterix@gmail.com) +:: + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any + damages arising from the use of this software. -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. + Permission is granted to anyone to use this software for any + purpose, including commercial applications, and to alter it and + redistribute it freely, subject to the following restrictions: -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation + would be appreciated but is not required. -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. + 3. This notice may not be removed or altered from any source + distribution. -3. This notice may not be removed or altered from any source -distribution. --------------------------------------------------------------------------------- License of the used XML reader library +====================================== +http://www.sourceforge.net/projects/tinyxml + +Original code, 2.0 and earlier, copyright 2000-2006 Lee Thomason (http://www.grinninglizard.com) +:: + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any + damages arising from the use of this software. + + Permission is granted to anyone to use this software for any + purpose, including commercial applications, and to alter it and + redistribute it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation + would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + + +dirent.h - dirent API for Microsoft Visual Studio +================================================= +Copyright (C) 2006 Toni Ronkko +:: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. - --------------------------------------------------------------------------------- - * dirent.h - dirent API for Microsoft Visual Studio - * - * Copyright (C) 2006 Toni Ronkko - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * ``Software''), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- -Parts of dfhack are based on linenoise: -linenoise.c -- guerrilla line editing library against the idea that a -line editing lib needs to be 20,000 lines of C code. - -You can find the latest source code at: - - http://github.com/antirez/linenoise - -Does a number of crazy assumptions that happen to be true in 99.9999% of -the 2010 UNIX computers around. - --------------------------------------------------------------------------------- - -Copyright (c) 2010, Salvatore Sanfilippo -Copyright (c) 2010, Pieter Noordhuis - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------------- + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +linenoise.c +=========== +Parts of dfhack are based on linenoise: a line editing library against the +idea that a line editing lib needs to be 20,000 lines of C code. + +You can find the latest source code at http://github.com/antirez/linenoise +:: + + Copyright (c) 2010, Salvatore Sanfilippo + Copyright (c) 2010, Pieter Noordhuis + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +UTF-8 Decoder +============= See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. +:: -Copyright (c) 2008-2010 Bjoern Hoehrmann + Copyright (c) 2008-2010 Bjoern Hoehrmann -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +luafilesystem +============= Parts of dfhack are based on luafilesystem: - -Copyright (c) 2003-2014 Kepler Project. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - --------------------------------------------------------------------------------- -jsoncpp license - -Copyright (c) 2007-2010 Baptiste Lepilleur - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - --------------------------------------------------------------------------------- -JSON.lua license - -Copyright 2010-2014 Jeffrey Friedl -http://regex.info/blog/ +:: + + Copyright (c) 2003-2014 Kepler Project. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +jsoncpp +======== +:: + + Copyright (c) 2007-2010 Baptiste Lepilleur + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + +JSON.lua +======== +Copyright 2010-2014 Jeffrey Friedl, http://regex.info/blog/ Latest version: http://regex.info/blog/lua/json diff --git a/Makefile b/Makefile deleted file mode 100644 index 1d8af92b1..000000000 --- a/Makefile +++ /dev/null @@ -1,192 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = docs/_build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/DFHack.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/DFHack.qhc" - -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/DFHack" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/DFHack" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/NEWS b/NEWS index db0959934..d8ffd3fef 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +.. 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 ============= :: @@ -72,6 +79,12 @@ DFHack Future - 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 diff --git a/README.html b/README.html index 78d1c6b38..481058eb4 100644 --- a/README.html +++ b/README.html @@ -4,13 +4,13 @@ - + Page Redirection - If you are not redirected automatically, follow the link to the documentation. + If you are not redirected automatically, follow the link to the documentation. \ No newline at end of file diff --git a/README.rst b/README.rst index 79d778ec2..97ac6b36e 100644 --- a/README.rst +++ b/README.rst @@ -8,32 +8,33 @@ and plugins implementing a wide variety of useful functions and tools. For users, it provides a significant suite of bugfixes and interface enhancements by default, and more can be enabled. There are also many tools -(such as ``workflow`` or ``autodump``) which can make life easier. You can -even add third-party scripts and plugins to do almost anything! +(such as `plugins/workflow` or `plugins/autodump`) which can make life easier. +You can even add third-party scripts and plugins to do almost anything! For modders, DFHack makes many things possible. Custom reactions, new -interactions, magic creature abilities, and more can be set through scripts +interactions, magic creature abilities, and more can be set through `scripts ` 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 - or for coexistence in a single DF install, even with incompatible components. For developers, DFHack unites the various ways tools access DF memory and allows easier development of new tools. As an open-source project under -various copyleft licences, contributions are welcome. +`various copyleft licences `, contributions are welcome. Documentation ============= DFHack documentation is generated by Sphinx. Check out the table of contents -below, or the sources in the docs folder! +below, or the sources in the `docs folder`_! +.. _`docs folder`: ./docs User Manual: .. toctree:: :maxdepth: 2 - docs/Readme + docs/Core docs/Plugins docs/Scripts @@ -54,3 +55,5 @@ For Developers: docs/Contributing docs/Compile docs/Lua API + library/xml/SYNTAX + docs/Binpatches diff --git a/dfhack-icon.png b/dfhack-icon.ico similarity index 100% rename from dfhack-icon.png rename to dfhack-icon.ico diff --git a/dfhack.init-example b/dfhack.init-example index cc4d67775..a91590eea 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -241,6 +241,10 @@ log-region # add information to item viewscreens view-item-info enable +gui/load-screen enable + +base/roses-init --all + ####################################################### # Apply binary patches at runtime # ####################################################### diff --git a/docs/Authors.rst b/docs/Authors.rst index 2e4bdee5e..6a86007e6 100644 --- a/docs/Authors.rst +++ b/docs/Authors.rst @@ -1,13 +1,13 @@ List of Authors =============== -The following is a list of people who have contributed to **DFHack**, in no +The following is a list of people who have contributed to DFHack, in no particular order. If you should be here and aren't, please get in touch or make a pull request! -======================= ==================== =========================== +======================= ======================= =========================== Name Github Email -======================= ==================== =========================== +======================= ======================= =========================== Petr Mrázek peterix peterix@gmail.com Alexander Gavrilov angavrilov angavrilov@gmail.com doomchild doomchild lee.crabtree@gmail.com @@ -86,4 +86,4 @@ Vjek Kris Parker kaypy Jonas Ask jonask84@gmail.com 8Z 8Z git8z@ya.ru -======================= ==================== =========================== +======================= ======================= =========================== diff --git a/docs/Binpatches.rst b/docs/Binpatches.rst new file mode 100644 index 000000000..4ecdfa79b --- /dev/null +++ b/docs/Binpatches.rst @@ -0,0 +1,180 @@ +.. _binpatches: + +###################### +Patching the DF binary +###################### + +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 +binary to change behaviour, and DFHack still contains tools to do this via +the `scripts/binpatch` command. + +.. warning:: + + We recommend using a script or plugin instead of a raw patch if + at all possible - that way your work will work for many versions + across multiple operating systems. There's a reason nobody has + written patches since ``0.34.11``! + +.. contents:: + + +Getting a patch +=============== +There are no binary patches available for Dwarf Fortress versions after 0.34.11 + +This system is kept for the chance that someone will find it useful, so some +hints on how to write your own follow. This will require disassembly and +decent skill in `memory research `. + +* The patches are expected to be encoded in text format used by IDA. + +* See `this commit `_, + when the 0.34.11 patches were discarded, for example patches. + +* `Issue #546 `_ is about the + future of the binpatches, and may be useful reading. + +If you want to write a patch, the armory patches discussed here and documented +below would probably be the best place to start. + + +Using a patch +============= +There are two methods to apply a patch. + +Patching at runtime +------------------- +The `scripts/binpatch` script checks, applies or removes binary patches +directly in memory at runtime:: + + binpatch [check|apply|remove] + +If the name of the patch has no extension or directory separators, the +script uses ``hack/patches//.dif``, thus auto-selecting +the version appropriate for the currently loaded executable. + +This is the preferred method; it's easier to debug, does not cause persistent +problems, and leaves file checksums alone. As with many other commands, users +can simply add it to ``dfhack.init`` to reapply the patch every time DF is run. + + +Patching on disk +---------------- + +.. warning:: + + This method of patching is deprecated, and may be removed without notice. + You should use the runtime patching option above. + +DFHack includes a small stand-alone utility for applying and removing +binary patches from the game executable. Use it from the regular operating +system console: + +``binpatch check "Dwarf Fortress.exe" patch.dif`` + Checks and prints if the patch is currently applied. + +``binpatch apply "Dwarf Fortress.exe" patch.dif`` + Applies the patch, unless it is already applied or in conflict. + +``binpatch remove "Dwarf Fortress.exe" patch.dif`` + Removes the patch, unless it is already removed. + +If you use a permanent patch under OSX or Linux, you must update +``symbols.xml`` with the new checksum of the executable. Find the relevant +section, and add a new line:: + + + +In order to find the correct value of the hash, look into stderr.log; +DFHack prints an error there if it does not recognize the hash. + +.. _binpatches/needs-patch: + +Tools reliant on binpatches +=========================== +Some DFHack tools require the game to be patched to work. As no patches +are currently available, the full description of each is included here. + +fix-armory +---------- +Enables a fix for storage of squad equipment in barracks. + +Specifically, it prevents your haulers from moving squad equipment +to stockpiles, and instead queues jobs to store it on weapon racks, +armor stands, and in containers. + +.. note:: + + In order to actually be used, weapon racks have to be patched and + manually assigned to a squad. See `scripts/gui/assign-rack`. + +Note that the buildings in the armory are used as follows: + +* Weapon racks (when patched) are used to store any assigned weapons. + Each rack belongs to a specific squad, and can store up to 5 weapons. + +* Armor stands belong to specific squad members and are used for + armor and shields. + +* Cabinets are used to store assigned clothing for a specific squad member. + They are **never** used to store owned clothing. + +* Chests (boxes, etc) are used for a flask, backpack or quiver assigned + to the squad member. Due to a probable bug, food is dropped out of the + backpack when it is stored. + +.. warning:: + + Although armor stands, cabinets and chests properly belong only to one + squad member, the owner of the building used to create the barracks will + randomly use any containers inside the room. Thus, it is recommended to + always create the armory from a weapon rack. + +Contrary to the common misconception, all these uses are controlled by the +*Individual Equipment* usage flag. The *Squad Equipment* flag is actually +intended for ammo, but the game does even less in that area than for armor +and weapons. This plugin implements the following rules almost from scratch: + +* Combat ammo is stored in chests inside rooms with Squad Equipment enabled. + +* If a chest is assigned to a squad member due to Individual Equipment also + being set, it is only used for that squad's ammo; otherwise, any squads + with Squad Equipment on the room will use all of the chests at random. + +* Training ammo is stored in chests inside archery ranges designated from + archery targets, and controlled by the same Train flag as archery training + itself. This is inspired by some defunct code for weapon racks. + +There are some minor traces in the game code to suggest that the first of +these rules is intended by Toady; the rest are invented by this plugin. + + +gui/assign-rack +--------------- +Bind to a key (the example config uses P), and activate when viewing a weapon +rack in the ``q`` mode. + +.. image:: images/assign-rack.png + +This script is part of a group of related fixes to make the armory storage +work again. The existing issues are: + +* Weapon racks have to each be assigned to a specific squad, like with + beds/boxes/armor stands and individual squad members, but nothing in + the game does this. This issue is what this script addresses. + +* Even if assigned by the script, **the game will unassign the racks again + without a binary patch**. This patch is called ``weaponrack-unassign``, + and has not been updated since 0.34.11. See `the bug report`_ for more info. + +.. _`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, + unless `plugins/fix-armory` is used. + +The script interface simply lets you designate one of the squads that +are assigned to the barracks/armory containing the selected stand as +the intended user. In order to aid in the choice, it shows the number +of currently assigned racks for every valid squad. + diff --git a/docs/Compile.rst b/docs/Compile.rst index 77ecfa341..a55c2d44d 100644 --- a/docs/Compile.rst +++ b/docs/Compile.rst @@ -16,13 +16,14 @@ DFHack doesn't have any kind of system of code snapshots in place, so you will h get code from the github repository using git. The code resides at https://github.com/DFHack/dfhack -On Linux and OS X, having a 'git' package installed is the minimal requirement (see below for OS X instructions), +On Linux and OS X, having a ``git`` package installed is the minimal requirement (see below for OS X instructions), but some sort of git gui or git integration for your favorite text editor/IDE will certainly help. On Windows, you will need some sort of Windows port of git, or a GUI. Some examples: - * http://msysgit.github.io/ - this is a command line version of git for windows. Most tutorials on git usage will apply. - * http://code.google.com/p/tortoisegit/ - this puts a pretty, graphical face on top of msysgit + * http://msysgit.github.io - this is a command line version of git for windows. + Most tutorials on git usage will apply. + * http://code.google.com/p/tortoisegit - this puts a pretty, graphical face on top of msysgit To get the code:: @@ -75,15 +76,18 @@ Before you can build anything, you'll also need ``cmake``. It is advisable to al ``ccmake`` on distributions that split the cmake package into multiple parts. You also need perl and the XML::LibXML and XML::LibXSLT perl packages (for the code generation parts). -You should be able to find them in your distro repositories (on Arch linux 'perl-xml-libxml' and 'perl-xml-libxslt') or through ``cpan``. +You should be able to find them in your distro repositories (on Arch linux +``perl-xml-libxml`` and ``perl-xml-libxslt``) or through ``cpan``. To build Stonesense, you'll also need OpenGL headers. -Some additional dependencies for other distros are listed on the `wiki `_. +Some additional dependencies for other distros are listed on the +`wiki `_. Build ===== -Building is fairly straightforward. Enter the ``build`` folder (or create an empty folder in the DFHack directory to use instead) and start the build like this:: +Building is fairly straightforward. Enter the ``build`` folder (or create an +empty folder in the DFHack directory to use instead) and start the build like this:: cd build cmake .. -DCMAKE_BUILD_TYPE:string=Release -DCMAKE_INSTALL_PREFIX=/home/user/DF @@ -205,7 +209,8 @@ Snow Leopard Changes Yosemite Changes ================ -If you have issues building on OS X Yosemite (or above), try definining the following environment variable:: +If you have issues building on OS X Yosemite (or above), try definining the +following environment variable:: export MACOSX_DEPLOYMENT_TARGET=10.9 @@ -227,9 +232,13 @@ Grab it from Microsoft's site. You'll also need the Visual Studio 2010 SP1 update. -For the code generation parts, you'll need perl with XML::LibXML and XML::LibXSLT. Strawberry Perl works nicely for this: http://strawberryperl.com/ +For the code generation parts, you'll need perl with XML::LibXML and XML::LibXSLT. +`Strawberry Perl `_ works nicely for this. -If you already have a different version of perl (for example the one from cygwin), you can run into some trouble. Either remove the other perl install from PATH, or install libxml and libxslt for it instead. Strawberry perl works though and has all the required packages. +If you already have a different version of perl (for example the one from cygwin), +you can run into some trouble. Either remove the other perl install from PATH, or +install libxml and libxslt for it instead. Strawberry perl works though and has +all the required packages. Build ===== diff --git a/docs/Contributing.rst b/docs/Contributing.rst index d4db8f1a7..6599f680c 100644 --- a/docs/Contributing.rst +++ b/docs/Contributing.rst @@ -17,6 +17,61 @@ If you're not comfortable pregramming, you can help by: All those things are crucial, and all under-represented. So if that's your thing, the rest of this document is about contributing code - go get started! +Documentation Standards +======================= +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 +this section as a guide rather than iron law, match the surrounding text, and you'll +be fine. + +Every script, plugin, or command should be documented. This is an active project, +and the best place to put this documentation might change. For now, it's usually +either ``docs/Scripts.rst`` or ``docs/Plugins.rst``. + +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. + +Try to keep lines within 80-100 characters, so it's readable in plain text - +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 +text. Use double-backticks to put commands in monospaced font, like this:: + + You can use ``cleanall scattered x`` to dump tattered or abandoned items. + +If the command takes more than three arguments, format the list as a table +called Options. The table *only* lists arguments, not full commands. +Input values are specified in angle brackets. Example:: + + Options: + + :arg1: A simple argument. + :arg2 : Does something based on the input value. + :Very long argument: + Is very specific. + +To demonstrate usage - useful mainly when the syntax is complicated, list the +full command with arguments in monospaced font, then indent the next line and +describe the effect:: + + ``resume all`` + Resumes all suspended constructions. + +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 +replaced with the corresponding title and linked: eg ```plugins/autolabor``` +=> `plugins/autolabor`. Link targets should be the path to the file +described (without file extension), and placed above the heading of that +section like this:: + + .. _plugins/autolabor: + + autolabor + ========= + +Add link targets if you need them, but otherwise plain headings are preferred. + + Contributing Code ================= Several things should be kept in mind when contributing code to DFHack. @@ -46,6 +101,8 @@ How to get new code into DFHack * Work done against Github issues tagged "bug report" get priority * Submit ideas and bug reports as issues on Github. Posts in the forum thread can easily get missed or forgotten. +.. _contributing-memory-research: + Memory research --------------- If you want to do memory research, you'll need some tools and some knowledge. @@ -70,39 +127,58 @@ Using the library as a developer Currently, the most direct way to use the library is to write a script or plugin that can be loaded by it. All the plugins can be found in the 'plugins' folder. There's no in-depth documentation on how to write one yet, but it should be easy enough to copy one and just follow the pattern. +``plugins/skeleton/skeleton.cpp`` is provided for this purpose. Other than through plugins, it is possible to use DFHack via remote access interface, or by writing Lua scripts. The most important parts of DFHack are the Core, Console, Modules and Plugins. -* Core acts as the centerpiece of DFHack - it acts as a filter between DF and SDL and synchronizes the various plugins with DF. +* Core acts as the centerpiece of DFHack - it acts as a filter between DF and + SDL and synchronizes the various plugins with DF. * Console is a thread-safe console that can be used to invoke commands exported by Plugins. -* Modules actually describe the way to access information in DF's memory. You can get them from the Core. Most modules are split into two parts: high-level and low-level. High-level is mostly method calls, low-level publicly visible pointers to DF's data structures. -* Plugins are the tools that use all the other stuff to make things happen. A plugin can have a list of commands that it exports and an onupdate function that will be called each DF game tick. - -Rudimentary API documentation can be built using doxygen (see build options with ``ccmake`` or ``cmake-gui``). +* Modules actually describe the way to access information in DF's memory. You + can get them from the Core. Most modules are split into two parts: high-level + and low-level. High-level is mostly method calls, low-level publicly visible + pointers to DF's data structures. +* Plugins are the tools that use all the other stuff to make things happen. + A plugin can have a list of commands that it exports and an onupdate function + that will be called each DF game tick. + +Rudimentary API documentation can be built using doxygen (see build options +with ``ccmake`` or ``cmake-gui``). The full DFHack documentation is built +with Sphinx, which runs automatically at compile time. DFHack consists of variously licensed code, but invariably weak copyleft. -The main license is zlib/libpng, some bits are MIT licensed, and some are BSD licensed. +The main license is zlib/libpng, some bits are MIT licensed, and some are +BSD licensed. See the `license` document for more information. Feel free to add your own extensions and plugins. Contributing back to the dfhack repository is welcome and the right thing to do :) DF data structure definitions ----------------------------- +DFHack uses information about the game data structures, represented via xml files +in the ``library/xml/`` submodule. -DFHack uses information about the game data structures, represented via xml files in the library/xml/ submodule. - -See https://github.com/DFHack/df-structures +See https://github.com/DFHack/df-structures, and the documentation linked in the index. -Data structure layouts are described in files following the df.\*.xml name pattern. This information is transformed by a perl script into C++ headers describing the structures, and associated metadata for the Lua wrapper. These headers and data are then compiled into the DFHack libraries, thus necessitating a compatibility break every time layouts change; in return it significantly boosts the efficiency and capabilities of DFHack code. +Data structure layouts are described in files following the ``df.\*.xml`` name pattern. +This information is transformed by a perl script into C++ headers describing the +structures, and associated metadata for the Lua wrapper. These headers and data +are then compiled into the DFHack libraries, thus necessitating a compatibility +break every time layouts change; in return it significantly boosts the efficiency +and capabilities of DFHack code. -Global object addresses are stored in symbols.xml, which is copied to the dfhack release package and loaded as data at runtime. +Global object addresses are stored in ``symbols.xml``, which is copied to the dfhack +release package and loaded as data at runtime. Remote access interface ----------------------- -DFHack supports remote access by exchanging Google protobuf messages via a TCP socket. Both the core and plugins can define remotely accessible methods. The ``dfhack-run`` command uses this interface to invoke ordinary console commands. +DFHack supports remote access by exchanging Google protobuf messages via a TCP +socket. Both the core and plugins can define remotely accessible methods. The +``dfhack-run`` command uses this interface to invoke ordinary console commands. -Currently the supported set of requests is limited, because the developers don't know what exactly is most useful. -``remotefortressreader`` provides a fairly comprehensive interface for visualisers such as Armok Vision. +Currently the supported set of requests is limited, because the developers don't +know what exactly is most useful. ``remotefortressreader`` provides a fairly +comprehensive interface for visualisers such as Armok Vision. diff --git a/docs/Readme.rst b/docs/Core.rst similarity index 65% rename from docs/Readme.rst rename to docs/Core.rst index 71210997c..4e2080311 100644 --- a/docs/Readme.rst +++ b/docs/Core.rst @@ -1,6 +1,6 @@ -############# -DFHack Readme -############# +########### +DFHack Core +########### .. contents:: @@ -21,6 +21,7 @@ Even older versions are available here_. All new releases are announced in `the bay12 forums thread`_, which is also a good place for discussion and questions. +.. _`the Bay12 DFHack thread`: .. _`the bay12 forums thread`: http://www.bay12forums.com/smf/index.php?topic=139553 If this sounds too complicated, you might prefer to `get a Starter Pack`_. @@ -48,18 +49,18 @@ Installation/Removal Installing DFhack involves copying files into your DF folder. Copy the files from a release archive so that: -* On Windows, SDL.dll is replaced -* On Linux, the 'dfhack' script is placed in the same folder as the 'df' script +* On Windows, ``SDL.dll`` is replaced +* On Linux or OSX, the ``dfhack`` script is placed in the same folder as the ``df`` script Uninstalling is basically the same, in reverse: -* On Windows, first delete SDL.dll and rename SDLreal.dll to SDL.dll. Then - remove the other DFHack files -* On Linux, Remove the DFHack files. +* On Windows, first delete ``SDL.dll`` and rename ``SDLreal.dll`` to ``SDL.dll``, + then remove the other DFHack files +* On Linux, remove the DFHack files. The stonesense plugin might require some additional libraries on Linux. -If any of the plugins or dfhack itself refuses to load, check the stderr.log +If any of the plugins or dfhack itself refuses to load, check the ``stderr.log`` file created in your DF folder. @@ -71,7 +72,7 @@ window once DF is started as usual on windows. Linux and Mac OS X require running the dfhack script from the terminal, and will use that terminal for the console. -**NOTE**: The dfhack-run executable is there for calling DFHack commands in +**NOTE**: The ``dfhack-run`` executable is there for calling DFHack commands in an already running DF+DFHack instance from external OS scripts and programs, and is *not* the way how you use DFHack normally. @@ -86,18 +87,16 @@ called ``dfhack.init``; the installation comes with an example version called features and can be simply renamed to ``dfhack.init``. You are encouraged to look through it to learn which features it makes available under which key combinations. -For more information, refer to the rest of this document. - Using DFHack ============ DFHack basically extends what DF can do with something similar to the drop-down console found in Quake engine games. On Windows, this is a separate command line -window. On linux, the terminal used to launch the dfhack script is taken over +window. On Linux, the terminal used to launch the dfhack script is taken over (so, make sure you start from a terminal). Basic interaction with dfhack involves entering commands into the console. For some basic instructions, -use the 'help' command. To list all possible commands, use the 'ls' command. +use the ``help`` command. To list all possible commands, use the ``ls`` command. Many commands have their own help or detailed description. You can use -'command help' or 'command ?' to show that. +``command help`` or ``command ?`` to show that. The command line has some nice line editing capabilities, including history that's preserved between different runs of DF (use up/down keys to go through @@ -105,17 +104,21 @@ the history). The second way to interact with DFHack is to bind the available commands to in-game hotkeys. The old way to do this is via the hotkey/zoom menu (normally -opened with the 'h' key). Binding the commands is done by assigning a command as -a hotkey name (with 'n'). +opened with the ``h`` key). Binding the commands is done by assigning a command as +a hotkey name (with ``n``). A new and more flexible way is the keybinding command in the dfhack console. 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 they are re-created every time it is loaded. -Interactive commands like 'liquids' cannot be used as hotkeys. +Interactive commands like `plugins/liquids` cannot be used as hotkeys. -Most of the commands come from plugins. Those reside 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 +from scripts, which are stored in ``hack/scripts``. Scripts are much +more flexible about versions, and easier to distribute - so most third-party +DFHack addons are scripts. Something doesn't work, help! ============================= @@ -125,11 +128,14 @@ Second, dfhack keeps a few log files in DF's folder (``stderr.log`` and ``stdout.log``). Looking at these might help you solve the problem. If it doesn't, you can ask for help in the forum thread or on IRC. -If you found a bug, you can report it in the Bay12 DFHack thread, the issues -tracker on github, or visit the #dfhack IRC channel on freenode. +If you found a bug, you can report it in `the Bay12 DFHack thread`_, +`the issues tracker on github `_, +or visit `the #dfhack IRC channel on freenode +`_. -Commands -======== +============= +Core Commands +============= DFHack command syntax consists of a command name, followed by arguments separated by whitespace. To include whitespace in an argument, quote it in double quotes. To include a double quote character, use ``\"`` inside double quotes. @@ -137,8 +143,10 @@ To include a double quote character, use ``\"`` inside double quotes. If the first non-whitespace character of a line is ``#``, the line is treated as a comment, i.e. a silent no-op command. -When reading commands from dfhack.init or with the ``script`` command, if the final character on a line is a backslash then the next uncommented line is considered a continuation of that line, with the backslash deleted. -Commented lines are skipped, so it is possible to comment out parts of a command with the ``#`` character. +When reading commands from dfhack.init or with the ``script`` command, if the final +character on a line is a backslash then the next uncommented line is considered a +continuation of that line, with the backslash deleted. Commented lines are skipped, +so it is possible to comment out parts of a command with the ``#`` character. If the first non-whitespace character is ``:``, the command is parsed in a special alternative mode: first, non-whitespace characters immediately following the ``:`` @@ -151,27 +159,52 @@ The following two command lines are exactly equivalent:: This is intended for commands like ``rb_eval`` that evaluate script language statements. -Almost all the commands support using the 'help ' built-in command +Almost all the commands support using the ``help `` built-in command to retrieve further help without having to look at this document. Alternatively, -some accept a 'help'/'?' option on their command line. +some accept a ``help`` or ``?`` as an option on their command line. + +.. note:: + + Some tools work by displaying dialogs or overlays in the game window. + + In order to avoid confusion, these tools display the word "DFHack" while active. If they + merely add keybinding hints to existing screens, they use red instead of green for the key. + + +Init files +========== +DFHack allows users to automatically run commonly-used DFHack commands when DF is first +loaded, when a game is loaded, and when a game is unloaded. + +Init scripts function the same way they would if the user manually typed in their contents, +but are much more convenient. If your DF folder contains at least one file with a name +following the format ``dfhack*.init`` where ``*`` is a placeholder for any string (including +the empty string), then all such files are executed in alphabetical order as init scripts when +DF is first loaded. + +If your DF folder does not contain any such files, then DFHack will execute ``dfhack.init-example`` +as an example of useful commands to be run automatically. If you want DFHack to do nothing on +its own, then create an empty ``dfhack.init`` file in the main DF directory, or delete ``dfhack.init-example``. + +The file ``dfhack.init-example`` is included as an example for users to follow if they need DFHack +command executed automatically. We recommend modifying or deleting ``dfhack.init-example`` as +its settings will not be optimal for all players. + +In order to facilitate savegave portability, mod merging, and general organization of init files, +DFHack supports multiple init files both in the main DF directory and save-specific init files in +the save folders. -The init file -============= -DFHack allows users to automatically run commonly-used DFHack commands when DF is first loaded, when a game is loaded, and when a game is unloaded. -Init scripts function the same way they would if the user manually typed in their contents, but are much more convenient. -If your DF folder contains at least one file with a name following the format ``dfhack*.init`` where ``*`` is a placeholder for any string (including the empty string), then all such files are executed in alphabetical order as init scripts when DF is first loaded. -If your DF folder does not contain any such files, then DFHack will execute ``dfhack.init-example`` as an example of useful commands to be run automatically. -If you want DFHack to do nothing on its own, then create an empty ``dfhack.init`` file in the main DF directory, or delete ``dfhack.init-example``. -The file ``dfhack.init-example`` is included as an example for users to follow if they need DFHack command executed automatically. -We highly recommend modifying or deleting ``dfhack.init-example`` as its settings will not be optimal for all players. - -In order to facilitate savegave portability, mod merging, and general organization of init files, DFHack supports multiple init files both in the main DF directory and save-specific init files in the save folders. DFHack looks for init files in three places. -It will look for them in the main DF directory, and in ``data/save/_____/raw`` and ``data/save/_____/raw/objects`` where ``_____`` is the name of the current savegame. -When a game is loaded, DFHack looks for files of the form ``onLoad*.init``, where ``*`` can be any string, including the empty string. -When a game is unloaded, DFHack looks for files of the form ``onUnload*.init``. -Again, these files may be in any of the above three places. -All matching init files will be sorted and executed in alphebetical order. + +It will look for them in the main DF directory, and in ``data/save/_____/raw`` and +``data/save/_____/raw/objects`` where ``_____`` is the name of the current savegame. + +When a game is loaded, DFHack looks for files of the form ``onLoad*.init``, where +``*`` can be any string, including the empty string. + +When a game is unloaded, DFHack looks for files of the form ``onUnload*.init``. Again, +these files may be in any of the above three places. All matching init files will be +executed in alphebetical order. Setting keybindings =================== @@ -192,22 +225,22 @@ Possible ways to call the command: ``keybinding set "cmdline" "cmdline"...`` Clear, and then add bindings for the specified key. -The ** parameter above has the following *case-sensitive* syntax:: +The ```` parameter above has the following *case-sensitive* syntax:: [Ctrl-][Alt-][Shift-]KEY[@context[|context...]] where the *KEY* part can be any recognized key and [] denote optional parts. When multiple commands are bound to the same key combination, DFHack selects -the first applicable one. Later 'add' commands, and earlier entries within one -'add' command have priority. Commands that are not specifically intended for use +the first applicable one. Later ``add`` commands, and earlier entries within one +``add`` command have priority. Commands that are not specifically intended for use as a hotkey are always considered applicable. -The *context* part in the key specifier above can be used to explicitly restrict +The ``context`` part in the key specifier above can be used to explicitly restrict the UI state where the binding would be applicable. If called without parameters, the ``keybinding`` command among other things prints the current context string. -Only bindings with a *context* tag that either matches the current context fully, -or is a prefix ending at a '/' boundary would be considered for execution, i.e. +Only bindings with a ``context`` tag that either matches the current context fully, +or is a prefix ending at a ``/`` boundary would be considered for execution, i.e. for context ``foo/bar/baz``, possible matches are any of ``@foo/bar/baz``, ``@foo/bar``, ``@foo`` or none. Multiple contexts can be specified by separating them with a pipe (``|``) - for example, ``@foo|bar|baz/foo``. @@ -221,6 +254,11 @@ 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 globally active hotkey. The default keybinding is ``Ctrl-F1``. +In-game Console +=============== +The ``command-prompt`` plugin adds an in-game DFHack terminal, where you +can enter other commands. It's default keybinding is Ctrl-Shift-P. + Enabling plugins ================ Many plugins can be in a distinct enabled or disabled state. Some of @@ -240,15 +278,6 @@ arguments for the command:: enable manipulator search -In-game interface tools -======================= -Some tools work by displaying dialogs or overlays in the game window. - -In order to avoid user confusion, as a matter of policy all these tools -must 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. - Game progress ============= @@ -275,31 +304,3 @@ nopause Disables pausing (both manual and automatic) with the exception of pause forced by 'reveal hell'. This is nice for digging under rivers. -Patched binaries -================ -As an alternative to permanently modifying the binary, you can use the -``binpatch`` dfhack command to apply patches live in memory during a DF session. - -In this case, updating symbols.xml is not necessary - otherwise Linux and OSX -users of patched binaries may have to find the relevant section in ``symbols.xml``, -and add a new line with the checksum of their executable:: - - - -In order to find the correct value of the hash, look into stderr.log; -DFHack prints an error there if it does not recognize the hash. - -DFHack includes a small stand-alone utility for applying and removing -binary patches from the game executable. Use it from the regular operating -system console: - -``binpatch check "Dwarf Fortress.exe" patch.dif`` - Checks and prints if the patch is currently applied. - -``binpatch apply "Dwarf Fortress.exe" patch.dif`` - Applies the patch, unless it is already applied or in conflict. - -``binpatch remove "Dwarf Fortress.exe" patch.dif`` - Removes the patch, unless it is already removed. - -The patches are expected to be encoded in text format used by IDA. diff --git a/docs/Licenses.rst b/docs/Licenses.rst index 0f7b41cb5..c02227720 100644 --- a/docs/Licenses.rst +++ b/docs/Licenses.rst @@ -1,3 +1,5 @@ +.. _license: + ######## Licenses ######## @@ -7,4 +9,3 @@ 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 - :literal: diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 5592889d7..fb948588f 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -18,6 +18,8 @@ Informative Plugins Visualizer and data export ========================== +.. _plugins/stonesense: + stonesense ---------- An isometric visualizer that runs in a second window. This requires working @@ -52,14 +54,14 @@ Exports a portion of your fortress into QuickFort style blueprint files.:: Options (If only region and name are given, export all): -:x,y,z: Size of map area to export -:name: Name of export files -:dig: Export dig commands to "-dig.csv" -:build: Export build commands to "-build.csv" -:place: Export stockpile commands to "-place.csv" -:query: Export query commands to "-query.csv" +:x,y,z: Size of map area to export +:name: Name of export files +:dig: Export dig commands to "-dig.csv" +:build: Export build commands to "-build.csv" +:place: Export stockpile commands to "-place.csv" +:query: Export query commands to "-query.csv" -Goes very well with ``fortplan``, for re-importing. +Goes very well with `plugins/fortplan`, for re-importing. Map inspection @@ -101,7 +103,7 @@ Examples: .. note:: - * If you do a full search (with the option "all") former ghosts will show up + If you do a full search (with the option "all") former ghosts will show up with the cursetype "unknown" because their ghostly flag is not set anymore. But if you happen to find a living/active creature with cursetype "unknown" please report that in the dfhack thread on the modding forum or @@ -118,6 +120,8 @@ probe ----- Can be used to determine tile properties like temperature. +.. _plugins/prospect: + prospect -------- Prints a big list of all the present minerals and plants. By default, only @@ -144,31 +148,33 @@ Options: :all: Also estimate vein mineral amounts. +.. _plugins/reveal: + reveal ------ This reveals the map. By default, HFS will remain hidden so that the demons -don't spawn. You can use 'reveal hell' to reveal everything. With hell revealed, +don't spawn. You can use ``reveal hell`` to reveal everything. With hell revealed, you won't be able to unpause until you hide the map again. If you really want -to unpause with hell revealed, use 'reveal demons'. +to unpause with hell revealed, use ``reveal demons``. Reveal also works in adventure mode, but any of its effects are negated once -you move. When you use it this way, you don't need to run 'unreveal'. +you move. When you use it this way, you don't need to run ``unreveal``. unreveal --------- -Reverts the effects of 'reveal'. +~~~~~~~~ +Reverts the effects of ``reveal``. revtoggle ---------- -Switches between 'reveal' and 'unreveal'. +~~~~~~~~~ +Switches between ``reveal`` and ``unreveal``. revflood --------- +~~~~~~~~ This command will hide the whole map and then reveal all the tiles that have a path to the in-game cursor. revforget ---------- +~~~~~~~~~ When you use reveal, it saves information about what was/wasn't visible before revealing everything. Unreveal uses this information to hide things again. This command throws away the information. For example, use in cases where @@ -179,10 +185,6 @@ showmood Shows all items needed for the currently active strange mood. - - - - ======== Bugfixes ======== @@ -211,13 +213,12 @@ This plugin fixes issues with unit occupancy, notably issues with phantom "unit blocking tile" messages (`Bug 3499`_). It can be run manually, or periodically when enabled with the built-in enable/disable commands: -* ``fix-unit-occupancy``: Run the plugin immediately. Available options: - - * ``-h``, ``here``, ``cursor``: Only operate on the tile at the cursor - * ``-n``, ``dry``, ``dry-run``: Do not write changes to map - -* ``fix-unit-occupancy interval X``: Run the plugin every ``X`` ticks (when enabled). - The default is 1200 ticks, or 1 day. Ticks are only counted when the game is unpaused. +:(no argument): Run the plugin once immediately, for the whole map. +:-h, here, cursor: Run immediately, only operate on the tile at the cursor +:-n, dry, dry-run: Run immediately, do not write changes to map +:interval : Run the plugin every ``X`` ticks (when enabled). + The default is 1200 ticks, or 1 day. + Ticks are only counted when the game is unpaused. .. _`Bug 3499`: http://bay12games.com/dwarves/mantisbt/view.php?id=3499 @@ -239,14 +240,15 @@ population booms as you go below the raised population cap, this plugin counts pregnancies toward the new population cap. It can still go over, but only in the case of multiple births. -`petcapRemover` - cause pregnancies now and schedule the next check -`petcapRemover every n` - set how often in ticks the plugin checks for possible pregnancies -`petcapRemover cap n` - set the new cap to n. if n = 0, no cap -`petcapRemover pregtime n` - sets the pregnancy duration to n ticks. natural pregnancies are 300000 ticks for the current race and 200000 for everyone else +Usage: + +:petcapRemover: cause pregnancies now and schedule the next check +:petcapRemover every n: set how often in ticks the plugin checks for possible pregnancies +:petcapRemover cap n: set the new cap to n. if n = 0, no cap +:petcapRemover pregtime n: sets the pregnancy duration to n ticks. natural pregnancies are + 300000 ticks for the current race and 200000 for everyone else + +.. _plugins/tweak: tweak ===== @@ -303,83 +305,35 @@ Subcommands that persist until disabled or DF quits: :fast-trade: Makes Shift-Down in the Move Goods to Depot and Trade screens select the current item (fully, in case of a stack), and scroll down one line. :fps-min: Fixes the in-game minimum FPS setting -:import-priority-category: Allows changing the priority of all goods in a - category when discussing an import agreement with the liaison +:import-priority-category: + Allows changing the priority of all goods in a + category when discussing an import agreement with the liaison :kitchen-keys: Fixes DF kitchen meal keybindings (bug 614) :kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences :kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs (bug 9000) :manager-quantity: Removes the limit of 30 jobs per manager order :max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile -:military-color-assigned: Color squad candidates already assigned to other squads in yellow/green - to make them stand out more in the list. - - .. image:: images/tweak-mil-color.png +:military-color-assigned: + Color squad candidates already assigned to other squads in yellow/green + to make them stand out more in the list. -:military-stable-assign: Preserve list order and cursor position when assigning to squad, - i.e. stop the rightmost list of the Positions page of the military - screen from constantly resetting to the top. + .. image:: images/tweak-mil-color.png +:military-stable-assign: + Preserve list order and cursor position when assigning to squad, + i.e. stop the rightmost list of the Positions page of the military + screen from constantly resetting to the top. :nestbox-color: Fixes the color of built nestboxes :shift-8-scroll: Gives Shift-8 (or ``*``) priority when scrolling menus, instead of scrolling the map :stable-cursor: Saves the exact cursor position between t/q/k/d/b/etc menus of fortress mode. :tradereq-pet-gender: Displays pet genders on the trade request screen +.. _plugins/fix-armory: + fix-armory ========== -Enables a fix for storage of squad equipment in barracks. - -Specifically, it prevents your haulers from moving squad equipment -to stockpiles, and instead queues jobs to store it on weapon racks, -armor stands, and in containers. - -.. note:: - - In order to actually be used, weapon racks have to be patched and - manually assigned to a squad. See the ``gui/assign-rack`` script. - -Note that the buildings in the armory are used as follows: - -* Weapon racks (when patched) are used to store any assigned weapons. - Each rack belongs to a specific squad, and can store up to 5 weapons. - -* Armor stands belong to specific squad members and are used for - armor and shields. - -* Cabinets are used to store assigned clothing for a specific squad member. - They are **never** used to store owned clothing. - -* Chests (boxes, etc) are used for a flask, backpack or quiver assigned - to the squad member. Due to a probable bug, food is dropped out of the - backpack when it is stored. - -.. warning:: - - Although armor stands, cabinets and chests properly belong only to one - squad member, the owner of the building used to create the barracks will - randomly use any containers inside the room. Thus, it is recommended to - always create the armory from a weapon rack. - -Contrary to the common misconception, all these uses are controlled by the -*Individual Equipment* usage flag. The *Squad Equipment* flag is actually -intended for ammo, but the game does even less in that area than for armor -and weapons. This plugin implements the following rules almost from scratch: - -* Combat ammo is stored in chests inside rooms with Squad Equipment enabled. - -* If a chest is assigned to a squad member due to Individual Equipment also - being set, it is only used for that squad's ammo; otherwise, any squads - with Squad Equipment on the room will use all of the chests at random. - -* Training ammo is stored in chests inside archery ranges designated from - archery targets, and controlled by the same Train flag as archery training - itself. This is inspired by some defunct code for weapon racks. - -There are some minor traces in the game code to suggest that the first of -these rules is intended by Toady; the rest are invented by this plugin. - - - - +`This plugin requires a binpatch `, which has not +been available since DF 0.34.11 =========== @@ -398,14 +352,14 @@ manipulator =========== An in-game equivalent to the popular program Dwarf Therapist. -To activate, open the unit screen and press 'l'. +To activate, open the unit screen and press ``l``. .. image:: images/manipulator.png The far left column displays the unit's Happiness (color-coded based on its value), Name, Profession/Squad, and the right half of the screen displays each -dwarf's labor settings and skill levels (0-9 for Dabbling thru Professional, A-E for -Great thru Grand Master, and U-Z for Legendary thru Legendary+5). +dwarf's labor settings and skill levels (0-9 for Dabbling through Professional, +A-E for Great through Grand Master, and U-Z for Legendary through Legendary+5). Cells with teal backgrounds denote skills not controlled by labors, e.g. military and social skills. @@ -419,7 +373,7 @@ Press ``t`` to toggle between Profession and Squad view. Use the arrow keys or number pad to move the cursor around, holding Shift to move 10 tiles at a time. -Press the Z-Up (<) and Z-Down (>) keys to move quickly between labor/skill +Press the Z-Up (``<``) and Z-Down (``>``) keys to move quickly between labor/skill categories. The numpad Z-Up and Z-Down keys seek to the first or last unit in the list. Backspace seeks to the top left corner. @@ -430,8 +384,8 @@ Press the ``+-`` keys to sort the unit list according to the currently selected skill/labor, and press the ``*/`` keys to sort the unit list by Name, Profession/Squad, Happiness, or Arrival order (using Tab to select which sort method to use here). -With a unit selected, you can press the "v" key to view its properties (and -possibly set a custom nickname or profession) or the "c" key to exit +With a unit selected, you can press the ``v`` key to view its properties (and +possibly set a custom nickname or profession) or the ``c`` key to exit Manipulator and zoom to its position within your fortress. The following mouse shortcuts are also available: @@ -444,13 +398,11 @@ The following mouse shortcuts are also available: * Left-click on a unit's name, profession or squad to view its properties. * Right-click on a unit's name, profession or squad to zoom to it. -Pressing ESC normally returns to the unit screen, but Shift-ESC would exit +Pressing ``ESC`` normally returns to the unit screen, but ``Shift-ESC`` would exit directly to the main dwarf mode screen. -Search +search ====== -Implemented by the 'search' plugin. - The search plugin adds search to the Stocks, Animals, Trading, Stockpile, Noble (assignment candidates), Military (position candidates), Burrows (unit list), Rooms, Announcements, Job List and Unit List screens. @@ -458,7 +410,7 @@ Noble (assignment candidates), Military (position candidates), Burrows .. image:: images/search.png Searching works the same way as the search option in "Move to Depot" does. -You will see the Search option displayed on screen with a hotkey (usually 's'). +You will see the Search option displayed on screen with a hotkey (usually ``s``). Pressing it lets you start typing a query and the relevant list will start filtering automatically. @@ -466,16 +418,16 @@ Pressing ENTER, ESC or the arrow keys will return you to browsing the now filtered list, which still functions as normal. You can clear the filter by either going back into search mode and backspacing to delete it, or pressing the "shifted" version of the search hotkey while browsing the -list (e.g. if the hotkey is 's', then hitting 'shift-s' will clear any +list (e.g. if the hotkey is ``s``, then hitting ``Shift-s`` will clear any filter). Leaving any screen automatically clears the filter. In the Trade screen, the actual trade will always only act on items that are actually visible in the list; the same effect applies to the Trade -Value numbers displayed by the screen. Because of this, the 't' key is +Value numbers displayed by the screen. Because of this, the ``t`` key is blocked while search is active, so you have to reset the filters first. -Pressing Alt-C will clear both search strings. +Pressing ``Alt-C`` will clear both search strings. In the stockpile screen the option only appears if the cursor is in the rightmost list: @@ -501,16 +453,15 @@ Usage:: Tools: -* ``anywhere``: Allows embarking anywhere (including sites, mountain-only biomes, and oceans). Use with caution. -* ``mouse``: Implements mouse controls (currently in the local embark region only) -* ``sand``: Displays an indicator when sand is present in the currently-selected area, similar to the default clay/stone indicators. -* ``sticky``: Maintains the selected local area while navigating the world map - +:anywhere: Allows embarking anywhere (including sites, mountain-only biomes, + and oceans). Use with caution. +:mouse: Implements mouse controls (currently in the local embark region only) +:sand: Displays an indicator when sand is present in the currently-selected + area, similar to the default clay/stone indicators. +:sticky: Maintains the selected local area while navigating the world map -AutoMaterial +automaterial ------------ -Implemented by the 'automaterial' plugin. - This 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. @@ -524,7 +475,7 @@ preferred material type. .. image:: images/automaterial-mat.png -Pressing 'a' while highlighting any material will enable that material for "auto select" +Pressing ``a`` while highlighting any material will enable that material for "auto select" for this construction type. You can enable multiple materials as autoselect. Now the next time you place this type of construction, the plugin will automatically choose materials for you from the kinds you enabled. If there is enough to satisfy the whole placement, @@ -535,38 +486,76 @@ When choosing the construction placement, you will see a couple of options: .. image:: images/automaterial-pos.png -Use 'a' here to temporarily disable the material autoselection, e.g. if you need +Use ``a`` here to temporarily disable the material autoselection, e.g. if you need to go to the material selection screen so you can toggle some materials on or off. -The other option (auto type selection, off by default) can be toggled on with 't'. If you +The other option (auto type selection, off by default) can be toggled on with ``t``. If you toggle this option on, instead of returning you to the main construction menu after selecting materials, it returns you back to this screen. If you use this along with several autoselect enabled materials, you should be able to place complex constructions more conveniently. +buildingplan +------------ +When active (via ``enable buildingplan``), this plugin adds a planning mode for +furniture placement. You can then place furniture and other buildings before +the required materials are available, and the job will be unsuspended when +the item is created. + +Very useful when combined with `plugins/workflow` - you can set a constraint +to always have one or two doors/beds/tables/chairs/etc available, and place +as many as you like. The plugins then take over and fulfill the orders, +with minimal space dedicated to stockpiles. + confirm ------- - Implements several confirmation dialogs for potentially destructive actions (for example, seizing goods from traders or deleting hauling routes). Usage: -* ``enable confirm`` or ``confirm enable all``: Enable all confirmations (replace with ``disable`` to disable) -* ``confirm enable option1 [option2...]``: Enable (or disable) specific confirmations. Run ``confirm help`` for a complete list of options. +:enable confirm, confirm enable all: + Enable all confirmations (replace with ``disable`` to disable) +:confirm enable option1 [option2...]: + Enable (or disable) specific confirmations. Run ``confirm help`` + for a complete list of options. follow ------ -Makes the game view follow the currently highlighted unit after you exit from -current menu/cursor mode. Handy for watching dwarves running around. Deactivated +Makes the game view follow the currently highlighted unit after you exit from the +current menu or cursor mode. Handy for watching dwarves running around. Deactivated by moving the view manually. +mousequery +---------- +Adds mouse controls to the DF interface, eg click-and-drag designations. + +Options: + +:plugin: enable/disable the entire plugin +:rbutton: enable/disable right mouse button +:track: enable/disable moving cursor in build and designation mode +:edge: enable/disable active edge scrolling (when on, will also enable tracking) +:live: enable/disable query view when unpaused +:delay: Set delay when edge scrolling in tracking mode. Omit amount to display current setting. + +Usage:: + + mousequery [plugin] [rbutton] [track] [edge] [live] [enable|disable] + +.. _plugins/resume: + +resume +------ +Allows automatic resumption of suspended constructions, along with colored +UI hints for construction status. + tidlers ------- Toggle between all possible positions where the idlers count can be placed. trackstop --------- -Adds a `q` menu for track stops, which is completely blank by default. +Adds a ``q`` menu for track stops, which is completely blank by default. This allows you to view and/or change the track stop's friction and dump direction settings, using the keybindings from the track stop building interface. @@ -577,10 +566,12 @@ Toggle between displaying/not displaying liquid depth as numbers. stockpile management -------------------- +.. _plugins/stocksettings: + import/export ~~~~~~~~~~~~~ The following commands allow you to save and load stockpile settings. -See the gui/stockpiles for an in-game GUI to this plugin. +See `scripts/gui/stockpiles` for an in-game interface. :copystock: Copies the parameters of the currently highlighted stockpile to the custom stockpile settings and switches to custom stockpile placement mode, effectively @@ -593,10 +584,10 @@ See the gui/stockpiles for an in-game GUI to this plugin. :loadstock: Loads a saved stockpile settings file and applies it to the currently selected stockpile. eg: ``loadstock food_settings.dfstock`` -To use savestock and loadstock, use the 'q' command to highlight a stockpile. +To use savestock and loadstock, use the ``q`` command to highlight a stockpile. Then run savestock giving it a descriptive filename. Then, in a different (or -same!) gameworld, you can highlight any stockpile with 'q' then execute the -'loadstock' command passing it the name of that file. The settings will be +the same!) gameworld, you can highlight any stockpile with ``q`` then execute the +``loadstock`` command passing it the name of that file. The settings will be applied to that stockpile. Note that files are relative to the DF folder, so put your files there or in a @@ -615,13 +606,14 @@ When querying a stockpile, options will appear to toggle automation settings for When automelt is enabled for a stockpile, any meltable items placed in it will be designated to be melted. When autotrade is enabled for a stockpile, any items placed in it will be designated to be taken to the Trade Depot whenever merchants are on the map. -When autotrade is enabled for a stockpile, any items placed in this stockpile will +When autodump is enabled for a stockpile, any items placed in this stockpile will automatically be designated to be dumped. +.. _plugins/rename: rename ------ -Allows renaming various things. +Allows renaming various things. Use `scripts/gui/rename` for an in-game interface. Options: @@ -642,24 +634,17 @@ Options: rendermax --------- A collection of renderer replacing/enhancing filters. For better effect try changing the -black color in palette to non totally black. For more info see `the Bay12 forum thread`_. - -.. _`the Bay12 forum thread`: http://www.bay12forums.com/smf/index.php?topic=128487 +black color in palette to non totally black. For more info see +`the Bay12 Rendermax thread `_. Options: -``rendermax trippy`` - Randomizes the color of each tiles. Used for fun, or testing. -``rendermax light`` - Enable lighting engine. -``rendermax light reload`` - Reload the settings file. -``rendermax light sun |cycle`` - Set time to (in hours) or set it to df time cycle. -``rendermax occlusionON|occlusionOFF`` - Show debug occlusion info. -``rendermax disable`` - Disable any filter that is enabled. +:trippy: Randomizes the color of each tiles. Used for fun, or testing. +:light: Enable lighting engine. +:light reload: Reload the settings file. +:light sun |cycle: Set time to (in hours) or set it to df time cycle. +:occlusionON, occlusionOFF: Show debug occlusion info. +:disable: Disable any filter that is enabled. An image showing lava and dragon breath. Not pictured here: sunlight, shining items/plants, materials that color the light etc... @@ -677,25 +662,25 @@ expansion while digging. Options: -**enable feature ...** +:enable feature ...: Enable features of the plugin. -**disable feature ...** +:disable feature ...: Disable features of the plugin. -**clear-unit burrow burrow ...** +:clear-unit burrow burrow ...: Remove all units from the burrows. -**clear-tiles burrow burrow ...** +:clear-tiles burrow burrow ...: Remove all tiles from the burrows. -**set-units target-burrow src-burrow ...** +:set-units target-burrow src-burrow ...: Clear target, and adds units from source burrows. -**add-units target-burrow src-burrow ...** +:add-units target-burrow src-burrow ...: Add units from the source burrows to the target. -**remove-units target-burrow src-burrow ...** +:remove-units target-burrow src-burrow ...: Remove units in source burrows from the target. -**set-tiles target-burrow src-burrow ...** +:set-tiles target-burrow src-burrow ...: Clear target and adds tiles from the source burrows. -**add-tiles target-burrow src-burrow ...** +:add-tiles target-burrow src-burrow ...: Add tiles from the source burrows to the target. -**remove-tiles target-burrow src-burrow ...** +:remove-tiles target-burrow src-burrow ...: Remove tiles in source burrows from the target. For these three options, in place of a source burrow it is @@ -709,18 +694,22 @@ Features: This final '+' may be omitted in burrow name args of commands above. Digging 1-wide corridors with the miner inside the burrow is SLOW. +dig +--- +This plugin makes many automated or complicated dig patterns easy. + digv ----- +~~~~ Designates a whole vein for digging. Requires an active in-game cursor placed over a vein tile. With the 'x' option, it will traverse z-levels (putting stairs between the same-material tiles). digvx ------ +~~~~~ A permanent alias for 'digv x'. digl ----- +~~~~ Designates layer stone for digging. Requires an active in-game cursor placed over a layer stone tile. With the 'x' option, it will traverse z-levels (putting stairs between the same-material tiles). With the 'undo' option it @@ -728,11 +717,11 @@ will remove the dig designation instead (if you realize that digging out a 50 z-level deep layer was not such a good idea after all). diglx ------ +~~~~~ A permanent alias for 'digl x'. digexp ------- +~~~~~~ This command is for `exploratory mining`_. .. _`exploratory mining`: http://dwarffortresswiki.org/index.php/cv:Exploratory_mining @@ -766,7 +755,7 @@ Examples: Take current designations and replace them with the ladder pattern digcircle ---------- +~~~~~~~~~ A command for easy designation of filled and hollow circles. It has several types of options. @@ -796,11 +785,13 @@ repeats with the last selected parameters. Examples: -* 'digcircle filled 3' = Dig a filled circle with diameter = 3. -* 'digcircle' = Do it again. +``digcircle filled 3`` + Dig a filled circle with diameter = 3. +``digcircle`` + Do it again. digtype -------- +~~~~~~~ For every tile on the map of the same vein type as the selected tile, this command designates it to have the same designation as the selected tile. If the selected tile has no designation, they will be dig designated. If an argument is given, the designation of the selected tile is ignored, and all appropriate tiles are set to the specified designation. @@ -816,21 +807,22 @@ Options: digFlood -------- -Automatically digs out specified veins as they are discovered. It runs once every time a dwarf finishes a dig job. It will only dig out appropriate tiles that are adjacent to the finished dig job. To add a vein type, use `digFlood 1 [type]`. This will also enable the plugin. To remove a vein type, use `digFlood 0 [type] 1` to disable, then remove, then re-enable. - -`digFlood 0` disable +Automatically digs out specified veins as they are discovered. It runs once +every time a dwarf finishes a dig job. It will only dig out appropriate tiles +that are adjacent to the finished dig job. To add a vein type, use ``digFlood 1 [type]``. +This will also enable the plugin. To remove a vein type, use ``digFlood 0 [type] 1`` +to disable, then remove, then re-enable. -`digFlood 1` enable - -`digFlood 0 MICROCLINE COAL_BITUMINOUS 1` disable plugin, remove microcline and bituminous coal from monitoring, then re-enable the plugin - -`digFlood CLEAR` remove all inorganics from monitoring - -`digFlood digAll1` ignore the monitor list and dig any vein - -`digFlood digAll0` disable digAll mode +Usage: -See `help digFlood` for details. +:help digflood: detailed help message +:digFlood 0: disable the plugin +:digFlood 1: enable the plugin +:digFlood 0 MICROCLINE COAL_BITUMINOUS 1: + disable plugin, remove microcline and bituminous coal from monitoring, then re-enable the plugin +:digFlood CLEAR: remove all inorganics from monitoring +:digFlood digAll1: ignore the monitor list and dig any vein +:digFlood digAll0: disable digAll mode filltraffic ----------- @@ -891,25 +883,18 @@ Options: :-c: Clear designations instead of setting them :-x: Apply selected action to all plants except those specified (invert selection) -:-a: Select every type of plant (obeys -t/-s) +:-a: Select every type of plant (obeys ``-t``/``-s``) -Specifying both -t and -s will have no effect. If no plant IDs are specified, +Specifying both ``-t`` and ``-s`` will have no effect. If no plant IDs are specified, all valid plant IDs will be listed. - - - - - - - - - =========================== Job and Fortress management =========================== +.. _plugins/autolabor: + autolabor ========= Automatically manage dwarf labors to efficiently complete jobs. @@ -922,8 +907,10 @@ which dwarf or dwarves should take new jobs for that labor, and sets labors acco Labors with equiptment (mining, hunting, and woodcutting), which are abandoned if labors change mid-job, are handled slightly differently to minimise churn. -*Warning: autolabor will override any manual changes you make to labors* -*while it is enabled, including through other tools such as Dwarf Therapist* +.. warning:: + + *autolabor will override any manual changes you make to labors while + it is enabled, including through other tools such as Dwarf Therapist* Simple usage: @@ -932,25 +919,6 @@ Simple usage: Anything beyond this is optional - autolabor works well on the default settings. -Advanced usage: - -:`autolabor []`: Set number of dwarves assigned to a labor. -:`autolabor haulers`: Set a labor to be handled by hauler dwarves. -:`autolabor disable`: Turn off autolabor for a specific labor. -:`autolabor reset`: Return a labor to the default handling. -:`autolabor reset-all`: Return all labors to the default handling. -:`autolabor list`: List current status of all labors. -:`autolabor status`: Show basic status information. -:`autolabor-artisans `: Run a command for labors where skill affects output quality - -*Examples:* - -:`autolabor MINE 5`: Keep at least 5 dwarves with mining enabled. -:`autolabor CUT_GEM 1 1`: Keep exactly 1 dwarf with gemcutting enabled. -:`autolabor COOK 1 1 3`: Keep 1 dwarf with cooking enabled, selected only from the top 3. -:`autolabor FEED_WATER_CIVILIANS haulers`: Have haulers feed and water wounded dwarves. -:`autolabor CUTWOOD disable`: Turn off autolabor for wood cutting. - By default, each labor is assigned to between 1 and 200 dwarves (2-200 for mining). By default 33% of the workforce become haulers, who handle all hauling jobs as well as cleaning, pulling levers, recovering wounded, removing constructions, and filling ponds. @@ -972,11 +940,57 @@ and then assign additional dwarfs that meet any of these conditions: We stop assigning dwarfs when we reach the maximum allowed. +Advanced usage: + +:autolabor []: + Set number of dwarves assigned to a labor. +:autolabor haulers: Set a labor to be handled by hauler dwarves. +:autolabor disable: Turn off autolabor for a specific labor. +:autolabor reset: Return a labor to the default handling. +:autolabor reset-all: Return all labors to the default handling. +:autolabor list: List current status of all labors. +:autolabor status: Show basic status information. + +See `scripts/autolabor-artisans` for a differently-tunde setup. + +Examples: + +``autolabor MINE`` + Keep at least 5 dwarves with mining enabled. +``autolabor CUT_GEM 1 1`` + Keep exactly 1 dwarf with gemcutting enabled. +``autolabor COOK 1 1 3`` + Keep 1 dwarf with cooking enabled, selected only from the top 3. +``autolabor FEED_WATER_CIVILIANS haulers`` + Have haulers feed and water wounded dwarves. +``autolabor CUTWOOD disable`` + Turn off autolabor for wood cutting. + +autohauler +---------- +Rather than the all-of-the-above means of autolabor, autohauler will instead +only manage hauling labors and leave skilled labors entirely to the user, who +will probably use Dwarf Therapist to do so. + +Idle dwarves will be assigned the hauling labors; everyone else (including +those currently hauling) will have the hauling labors removed. This is to +encourage every dwarf to do their assigned skilled labors whenever possible, +but resort to hauling when those jobs are not available. This also implies +that the user will have a very tight skill assignment, with most skilled +labors only being assigned to just one dwarf, no dwarf having more than two +active skilled labors, and almost every non-military dwarf having at least +one skilled labor assigned. + +Autohauler allows skills to be flagged as to prevent hauling labors from +being assigned when the skill is present. By default this is the unused +ALCHEMIST labor but can be changed by the user. Job management ============== +.. _plugins/job: + job --- Command for general job query and manipulation. @@ -1034,10 +1048,10 @@ Usage: ``stockflow status`` Display whether the plugin is enabled. -While enabled, the 'q' menu of each stockpile will have two new options: +While enabled, the ``q`` menu of each stockpile will have two new options: -* j: Select a job to order, from an interface like the manager's screen. -* J: Cycle between several options for how many such jobs to order. +* ``j``: Select a job to order, from an interface like the manager's screen. +* ``J``: Cycle between several options for how many such jobs to order. Whenever the bookkeeper updates stockpile records, new work orders will be placed on the manager's queue for each such selection, reduced by the @@ -1046,10 +1060,15 @@ number of identical orders already in the queue. In fast mode, new work orders will be enqueued once per day, instead of waiting for the bookkeeper. +.. _plugins/workflow: + workflow -------- Manage control of repeat jobs. +Check out `scripts/gui/workflow` for a simple front-end integrated +in the game UI. + Usage: ``workflow enable [option...], workflow disable [option...]`` @@ -1077,7 +1096,6 @@ Usage: Function ~~~~~~~~ - When the plugin is enabled, it protects all repeat jobs from removal. If they do disappear due to any cause, they are immediately re-added to their workshop and suspended. @@ -1088,20 +1106,16 @@ amount goes above or below the limit. The gap specifies how much below the limit the amount has to drop before jobs are resumed; this is intended to reduce the frequency of jobs being toggled. -Check out the ``gui/workflow`` script below for a simple front-end integrated -in the game UI. - Constraint format ~~~~~~~~~~~~~~~~~ -The constraint spec consists of 4 parts, separated with '/' characters:: +The constraint spec consists of 4 parts, separated with ``/`` characters:: ITEM[:SUBTYPE]/[GENERIC_MAT,...]/[SPECIFIC_MAT:...]/[LOCAL,] The first part is mandatory and specifies the item type and subtype, using the raw tokens for items, in the same syntax you would e.g. use -for a custom reaction input. See `this page`_ for more info. - -.. _`this page`: http://dwarffortresswiki.org/index.php/Material_token +for a custom reaction input. For more information, see +`this page. `_ The subsequent parts are optional: @@ -1112,11 +1126,9 @@ The subsequent parts are optional: METAL STONE SAND GLASS CLAY MILK - A specific material spec chooses the material exactly, using the - raw syntax for reaction input materials, e.g. INORGANIC:IRON, - although for convenience it also allows just IRON, or ACACIA:WOOD etc. - See `this page`_ for more details on the unabbreviated raw syntax. - - .. _`this page`: http://dwarffortresswiki.org/index.php/Material_token + raw syntax for reaction input materials, e.g. ``INORGANIC:IRON``, + although for convenience it also allows just ``IRON``, or ``ACACIA:WOOD`` etc. + See the link above for more details on the unabbreviated raw syntax. - A comma-separated list of miscellaneous flags, which currently can be used to ignore imported items or items below a certain quality. @@ -1171,6 +1183,8 @@ Maintain 10-100 locally-made crafts of exceptional quality:: Cleanup and garbage disposal ============================ +.. _plugins/clean: + clean ----- Cleans all the splatter that get scattered all over the map, items and @@ -1183,15 +1197,17 @@ Options: :units: Clean the creatures. Will also clean hostiles. :items: Clean all the items. Even a poisoned blade. -Extra options for 'map': +Extra options for ``map``: :mud: Remove mud in addition to the normal stuff. :snow: Also remove snow coverings. spotclean --------- -Works like 'clean map snow mud', but only for the tile under the cursor. Ideal -if you want to keep that bloody entrance 'clean map' would clean up. +Works like ``clean map snow mud``, but only for the tile under the cursor. Ideal +if you want to keep that bloody entrance ``clean map`` would clean up. + +.. _plugins/autodump: autodump -------- @@ -1211,8 +1227,8 @@ Options: :forbidden: Only process forbidden items (default: only unforbidden). autodump-destroy-item ---------------------- -Destroy the selected item. The item may be selected in the 'k' list, or inside +~~~~~~~~~~~~~~~~~~~~~ +Destroy the selected item. The item may be selected in the ``k`` list, or inside a container. If called again before the game is resumed, cancels destroy. cleanowned @@ -1245,28 +1261,23 @@ Records dwarf activity to measure fort efficiency. Options: - ``dwarfmonitor enable ``: - Start monitoring ``mode``. ``mode`` can be "work", "misery", "weather", or "all". - This will enable all corresponding widgets, if applicable. - ``dwarfmonitor disable ``: - Stop monitoring ``mode`` (see above) - This will disable all corresponding widgets, if applicable. - ``dwarfmonitor stats``: - Show statistics summary - ``dwarfmonitor prefs``: - Show dwarf preferences summary - ``dwarfmonitor reload``: - Reload configuration file (``dfhack-config/dwarfmonitor.json``) +:enable : Start monitoring ``mode``. ``mode`` can be "work", "misery", + "weather", or "all". This will enable all corresponding widgets, + if applicable. +:disable : Stop monitoring ``mode``, and disable corresponding widgets, if applicable. +:stats: Show statistics summary +:prefs: Show dwarf preferences summary +:reload: Reload configuration file (``dfhack-config/dwarfmonitor.json``) Widget configuration: The following types of widgets (defined in ``hack/lua/plugins/dwarfmonitor.lua``) can be displayed on the main fortress mode screen: -* ``date``: Shows the in-game date -* ``misery``: Shows overall happiness levels of all dwarves -* ``weather``: Shows current weather (rain/snow) -* ``cursor``: Shows the current mouse cursor position +:date: Show the in-game date +:misery: Show overall happiness levels of all dwarves +:weather: Show current weather (rain/snow) +:cursor: Show the current mouse cursor position The file ``dfhack-config/dwarfmonitor.json`` can be edited to control the positions and settings of all widgets displayed. This file should contain a @@ -1317,6 +1328,10 @@ Some widgets support additional options: displayed as ``-1`` when the cursor is outside of the DF window; otherwise, nothing will be displayed. +workNow +------- +Force all dwarves to look for a job immediately, or as soon as the game is unpaused. + seedwatch --------- Watches the numbers of seeds available and enables/disables seed and plant cooking. @@ -1345,6 +1360,8 @@ Examples: ``seedwatch all 30`` adds all plants from the abbreviation list to the watch list, the limit being 30. +.. _plugins/zone: + zone ---- Helps a bit with managing activity zones (pens, pastures and pits) and cages. @@ -1492,6 +1509,8 @@ Options: :sleep: Must be followed by number X. Changes the timer to sleep X frames between runs. +.. _plugins/autobutcher: + autobutcher ----------- Assigns lifestock for slaughter once it reaches a specific count. Requires that @@ -1499,8 +1518,8 @@ you add the target race(s) to a watch list. Only tame units will be processed. Units will be ignored if they are: -* Nicknamed (for custom protection; you can use the ``rename unit`` tool - individually, or ``zone nick`` for groups) +* Nicknamed (for custom protection; you can use the `plugins/rename` ``unit`` tool + individually, or `plugins/zone` ``nick`` for groups) * Caged, if and only if the cage is defined as a room (to protect zoos) * Trained for war or hunting @@ -1509,15 +1528,15 @@ opposite sex or have been gelded) will be butchered before those who will. Older adults and younger children will be butchered first if the population is above the target (default 1 male, 5 female kids and adults). Note that you may need to set a target above 1 to have a reliable breeding population -due to asexuality etc. +due to asexuality etc. See `scripts/fix-ster` if this is a problem. Options: +:example: Print some usage examples. :start: Start running every X frames (df simulation ticks). Default: X=6000, which would be every 60 seconds at 100fps. :stop: Stop running automatically. -:sleep: Must be followed by number X. Changes the timer to sleep - X frames between runs. +:sleep : Changes the timer to sleep X frames between runs. :watch R: Start watching a race. R can be a valid race RAW id (ALPACA, BIRD_TURKEY, etc) or a list of ids seperated by spaces or the keyword 'all' which affects all races on your current @@ -1533,26 +1552,34 @@ Options: :list: Print the current status and watchlist. :list_export: Print the commands needed to set up status and watchlist, which can be used to import them to another save (see notes). -:target fk mk fa ma R: Set target count for specified race(s). - fk = number of female kids, - mk = number of male kids, - fa = number of female adults, - ma = number of female adults. - R can be a list of ids or the keyword 'all' or 'new'. - R = 'all': change target count for all races on watchlist - and set the new default for the future. R = 'new': don't touch - current settings on the watchlist, only set the new default - for future entries. -:example: Print some usage examples. +:target : + Set target count for specified race(s). The first four arguments + are the number of female and male kids, and female and male adults. + R can be a list of spceies ids, or the keyword ``all`` or ``new``. + ``R = 'all'``: change target count for all races on watchlist + and set the new default for the future. ``R = 'new'``: don't touch + current settings on the watchlist, only set the new default + for future entries. +:list_export: Print the commands required to rebuild your current settings. +.. note:: + + Settings and watchlist are stored in the savegame, so that you can have + different settings for each save. If you want to copy your watchlist to + another savegame you must export the commands required to recreate your settings. + + To export, open an external terminal in the DF directory, and run + ``dfhack-run autobutcher list_export > filename.txt``. To import, load your + new save and run ``script filename.txt`` in the DFHack terminal. + + Examples: You want to keep max 7 kids (4 female, 3 male) and max 3 adults (2 female, 1 male) of the race alpaca. Once the kids grow up the oldest adults will get slaughtered. Excess kids will get slaughtered starting with the youngest to allow that the older ones grow into adults. Any unnamed cats will -be slaughtered as soon as possible. -:: +be slaughtered as soon as possible. :: autobutcher target 4 3 2 1 ALPACA BIRD_TURKEY autobutcher target 0 0 0 0 CAT @@ -1561,8 +1588,7 @@ be slaughtered as soon as possible. Automatically put all new races onto the watchlist and mark unnamed tame units for slaughter as soon as they arrive in your fort. Settings already made -for specific races will be left untouched. -:: +for specific races will be left untouched. :: autobutcher target 0 0 0 0 new autobutcher autowatch @@ -1573,20 +1599,10 @@ settings so that you can use 'unwatch' without the need to enter the values again. Note: 'autobutcher unwatch all' works, but only makes sense if you want to keep the plugin running with the 'autowatch' feature or manually add some new races with 'watch'. If you simply want to stop it completely use -'autobutcher stop' instead.:: +'autobutcher stop' instead. :: autobutcher unwatch ALPACA CAT -**Note:** - -Settings and watchlist are stored in the savegame, so that you can have -different settings for each world. If you want to copy your watchlist to -another savegame you can export the commands with ``list_export``: - -To export, open an external terminal in the DF directory, and run -``dfhack-run autobutcher list_export > filename.txt``. To import, load your -new save and run ``script filename.txt`` in the DFHack terminal. - autochop --------- Automatically manage tree cutting designation to keep available logs withing given @@ -1600,12 +1616,25 @@ The plugin must be activated (with ``c``) before it can be used. You can then se and restrict designations to specific burrows (with 'Enter') if desired. The plugin's activity cycle runs once every in game day. -If you add:: +If you add ``enable getplants`` to your dfhack.init there will be a hotkey to +open the dashboard from the chop designation menu. - enable getplants +treefarm +-------- +Automatically manages special burrows and regularly schedules tree chopping +and digging when appropriate. -to your dfhack.init there will be a hotkey to open the dashboard from the chop designation -menu. +Every time the plugin runs, it checks for burrows with a name containing the +string ``"treefarm"``. For each such burrow, it checks every tile in it for +fully-grown trees and for diggable walls. For each fully-grown tree it finds, +it designates the tree to be chopped, and for each natural wall it finds, it +designates the wall to be dug. + +Usage: + +:treefarm: Enables treefarm monitoring, starting next frame +:treefarm n: Enables treefarm monitoring, starting next frame, and sets + interval to n frames. If n is less than one, disables monitoring. ============== @@ -1625,18 +1654,13 @@ Usage: advtools ======== -A package of different adventure mode tools. - -Usage: - -``list-equipped [all]`` - List armor and weapons equipped by your companions. - If all is specified, also lists non-metal clothing. -``metal-detector [all-types] [non-trader]`` - Reveal metal armor and weapons in - shops. The options disable the checks - on item type and being in shop. +A package of different adventure mode tools. Usage: +:list-equipped [all]: List armor and weapons equipped by your companions. + If all is specified, also lists non-metal clothing. +:metal-detector [all-types] [non-trader]: + Reveal metal armor and weapons in shops. The options + disable the checks on item type and being in shop. ================ Map modification @@ -1651,11 +1675,13 @@ the command for the second time should produce no change. It is best to run it just once immediately after embark. This command is intended as only a cosmetic change, so it takes -care to exactly preserve the mineral counts reported by ``prospect all``. +care to exactly preserve the mineral counts reported by `plugins/prospect` ``all``. The amounts of different layer stones may slightly change in some cases if vein mass shifts between Z layers. -Note that there is no undo option other than restoring from backup. +.. warning:: + + There is no undo option other than restoring from backup. changelayer =========== @@ -1666,7 +1692,7 @@ changes only the layer at the cursor position. Note that one layer can stretch across lots of z levels. By default changes only the geology which is linked to the biome under the cursor. That geology might be linked to other biomes as well, though. Mineral veins and gem clusters will stay on the map. Use -'changevein' for them. +`plugins/changevein` for them. tl;dr: You will end up with changing quite big areas in one go, especially if you use it in lower z levels. Use with care. @@ -1718,6 +1744,8 @@ Examples: Try reverting the changes manually or even better use an older savegame. You did save your game, right? +.. _plugins/changevein: + changevein ========== Changes material of the vein under cursor to the specified inorganic RAW @@ -1756,19 +1784,29 @@ Examples: ``changeitem q 5`` Change currently selected item to masterpiece quality. +cleanconst +========== +Cleans up construction materials. + +This utility alters all constructions on the map so that they spawn their +building component when they are disassembled, allowing their actual +build items to be safely deleted. This can improve FPS in extreme situations. + colonies ======== -Allows listing all the vermin colonies on the map and optionally turning them into honey bee colonies. +Allows listing all the vermin colonies on the map and optionally turning +them into honey bee colonies. Options: :bees: turn colonies into honey bee colonies - deramp ====== -Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation. -It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen). +Removes all ramps designated for removal from the map. This is useful for +replicating the old channel digging designation. It also removes any and +all 'down ramps' that can remain after a cave-in (you don't have to designate +anything for that to happen). feature ======= @@ -1785,24 +1823,27 @@ Options: :show X: Marks the selected map feature as discovered. :hide X: Marks the selected map feature as undiscovered. +.. _plugins/fortplan: + fortplan ======== Usage: fortplan [filename] Designates furniture for building according to a .csv file with -quickfort-style syntax. Companion to digfort. +quickfort-style syntax. Companion to `scripts/digfort`. The first line of the file must contain the following:: #build start(X; Y; ) ...where X and Y are the offset from the top-left corner of the file's area -where the in-game cursor should be located, and +where the in-game cursor should be located, and ```` is an optional description of where that is. You may also leave a description of the contents of the file itself following the closing parenthesis on the same line. -The syntax of the file itself is similar to digfort or quickfort. At present, +The syntax of the file itself is similar to `scripts/digfort` or +`quickfort `_. At present, only buildings constructed of an item with the same name as the building are supported. All other characters are ignored. For example:: @@ -1820,33 +1861,88 @@ fortplan with the .csv file. 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: +Usage: ``infiniteSky n`` Raise the sky by n z-levels. ``infiniteSky enable/disable`` Enables/disables monitoring of constructions. If you build anything in the second to highest z-level, it will allocate one more sky level. This is so you can continue to build stairs upward. -Bugs have been reported with this version of the plugin, so be careful. It is possible that new z-levels will suddenly disappear and possibly cause cave-ins. Saving and loading after creating new z-levels should fix the problem. + .. warning:: + + Bugs have been reported with this version of the plugin, so be careful. + It is possible that new z-levels will suddenly disappear and possibly + cause cave-ins. Saving and loading after creating new z-levels should + fix the problem. + +.. _plugins/liquids: liquids ======= Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey. Settings will be remembered as long as dfhack runs. Intended for use in combination with the command -liquids-here (which can be bound to a hotkey). +``liquids-here`` (which can be bound to a hotkey). -For more information, refer to the command's internal help. +See also `this issue. `_ .. note:: Spawning and deleting liquids can F up pathing data and temperatures (creating heat traps). You've been warned. +Settings will be remembered until you quit DF. You can call liquids-here to execute +the last configured action, which is useful in combination with keybindings. + +Usage: point the DF cursor at a tile you want to modify and use the commands available :) + +Commands +-------- +Misc commands: + +:q: quit +:help, ?: print this list of commands +:: put liquid + +Modes: + +:m: switch to magma +:w: switch to water +:o: make obsidian wall instead +:of: make obsidian floors +:rs: make a river source +:f: flow bits only +:wclean: remove salt and stagnant flags from tiles + +Set-Modes and flow properties (only for magma/water): + +:s+: only add mode +:s.: set mode +:s-: only remove mode +:f+: make the spawned liquid flow +:f.: don't change flow state (read state in flow mode) +:f-: make the spawned liquid static + +Permaflow (only for water): + +:pf.: don't change permaflow state +:pf-: make the spawned liquid static +:pf[NS][EW]: make the spawned liquid permanently flow +:0-7: set liquid amount + +Brush size and shape: + +:p, point: Single tile +:r, range: Block with cursor at bottom north-west (any place, any size) +:block: DF map block with cursor in it (regular spaced 16x16x1 blocks) +:column: Column from cursor, up through free space +:flood: Flood-fill water tiles from cursor (only makes sense with wclean) + liquids-here -============ +------------ Run the liquid spawner with the current/last settings made in liquids (if no settings in liquids were made it paints a point of 7/7 magma by default). @@ -1932,20 +2028,20 @@ This will change the brush to a rectangle spanning 10x10 tiles on one z-level. The range starts at the position of the cursor and goes to the east, south and up. -For more details, see the 'help' command while using this. +For more details, use ``tiletypes help``. tiletypes-command -================= +----------------- Runs tiletypes commands, separated by ;. This makes it possible to change tiletypes modes from a hotkey or via dfhack-run. tiletypes-here -============== +-------------- Apply the current tiletypes options at the in-game cursor position, including the brush. Can be used from a hotkey. tiletypes-here-point -==================== +-------------------- Apply the current tiletypes options at the in-game cursor position to a single tile. Can be used from a hotkey. @@ -1967,19 +2063,12 @@ A tool for creating shrubs, growing, or getting rid of them. Subcommands: -:create: Create a new shrub/sapling. -:grow: Make saplings grow into trees. -:extirpate: Kills trees and shrubs, turning them into ashes instantly. -:immolate: Sets the plants on fire instead. The fires can and *will* spread ;) - -``create`` creates a new sapling under the cursor. Takes a raw ID as -argument (e.g. TOWER_CAP). The cursor must be located on a dirt or grass -floor tile. - -``grow`` works on the sapling under the cursor, and turns it into a tree. -Works on all shrubs of the map if the cursor is hidden. - -``extirpate`` and ``immolate`` work only on the plant under the cursor. +:create: Creates a new sapling under the cursor. Takes a raw ID as argument + (e.g. TOWER_CAP). The cursor must be located on a dirt or grass floor tile. +:grow: Turns saplings into trees; under the cursor if a sapling is selected, + or every sapling on the map if the cursor is hidden. +:extirpate: Kills the tree or shrub under the cursor, instantly turning them to ashes. +:immolate: Sets the plants on fire instead. The fires can and *will* spread ;) For mass effects, use one of the additional options: @@ -2038,29 +2127,39 @@ Options: fastdwarf ========= -Controls speedydwarf and teledwarf. Speedydwarf makes dwarves move quickly and perform tasks quickly. Teledwarf makes dwarves move instantaneously, but do jobs at the same speed. +Controls speedydwarf and teledwarf. Speedydwarf makes dwarves move quickly +and perform tasks quickly. Teledwarf makes dwarves move instantaneously, +but do jobs at the same speed. + +:fastdwarf 0: disables both (also ``0 0``) +:fastdwarf 1: enables speedydwarf and disables teledwarf (also ``1 0``) +:fastdwarf 2: sets a native debug flag in the game memory that implements an + even more aggressive version of speedydwarf. +:fastdwarf 0 1: disables speedydwarf and enables teledwarf +:fastdwarf 1 1: enables both -* 'fastdwarf 0 0' disables both -* 'fastdwarf 0 1' disables speedydwarf and enables teledwarf -* 'fastdwarf 1 0' enables speedydwarf and disables teledwarf -* 'fastdwarf 1 1' enables both -* 'fastdwarf 0' disables both -* 'fastdwarf 1' enables speedydwarf and disables teledwarf -* 'fastdwarf 2 ...' sets a native debug flag in the game memory - that implements an even more aggressive version of speedydwarf. +.. _plugins/forceequip: + +forceequip +========== +Forceequip moves local items into a unit's inventory. It is typically used to +equip specific clothing/armor items onto a dwarf, but can also be used to put +armor onto a war animal or to add unusual items (such as crowns) to any unit. + +For more information run ``forceequip help``. See also `scripts/modtools/equip-item`. lair ==== -This command allows you to mark the map as 'monster lair', preventing item -scatter on abandon. When invoked as 'lair reset', it does the opposite. +This command allows you to mark the map as a monster lair, preventing item +scatter on abandon. When invoked as ``lair reset``, it does the opposite. -Unlike reveal, this command doesn't save the information about tiles - you -won't be able to restore state of real monster lairs using 'lair reset'. +Unlike `plugins/reveal`, this command doesn't save the information about tiles - you +won't be able to restore state of real monster lairs using ``lair reset``. Options: -:lair: Mark the map as monster lair -:lair reset: Mark the map as ordinary (not lair) +:lair: Mark the map as monster lair +:lair reset: Mark the map as ordinary (not lair) misery ====== @@ -2079,21 +2178,26 @@ Usage: mode ==== This command lets you see and change the game mode directly. -Not all combinations are good for every situation and most of them will -produce undesirable results. There are a few good ones though. -.. admonition:: Example +.. warning:: + + Only use ``mode`` after making a backup of your save! + + Not all combinations are good for every situation and most of them will + produce undesirable results. There are a few good ones though. - You are in fort game mode, managing your fortress and paused. - You switch to the arena game mode, *assume control of a creature* and then - switch to adventure game mode(1). - You just lost a fortress and gained an adventurer. - OR - You are in fort game mode, managing your fortress and paused at the esc menu. - You switch to the adventure game mode, assume control of a creature, then save or retire. - You just created a returnable mountain home and gained an adventurer. +Examples: + + * You are in fort game mode, managing your fortress and paused. + * You switch to the arena game mode, *assume control of a creature* and then + * switch to adventure game mode(1). + You just lost a fortress and gained an adventurer. Alternatively: + + * You are in fort game mode, managing your fortress and paused at the esc menu. + * You switch to the adventure game mode, assume control of a creature, then save or retire. + * You just created a returnable mountain home and gained an adventurer. -Only use ``mode`` after making a backup of your save! +.. _plugins/strangemood: strangemood =========== @@ -2101,12 +2205,17 @@ Creates a strange mood job the same way the game itself normally does it. Options: -:-force: Ignore normal strange mood preconditions (no recent mood, minimum moodable population, artifact limit not reached). -:-unit: Make the strange mood strike the selected unit instead of picking one randomly. Unit eligibility is still enforced. -:-type T: Force the mood to be of a particular type instead of choosing randomly based on happiness. - Valid values are "fey", "secretive", "possessed", "fell", and "macabre". -:-skill S: Force the mood to use a specific skill instead of choosing the highest moodable skill. - Valid values are "miner", "carpenter", "engraver", "mason", "tanner", "weaver", "clothier", "weaponsmith", "armorsmith", "metalsmith", "gemcutter", "gemsetter", "woodcrafter", "stonecrafter", "metalcrafter", "glassmaker", "leatherworker", "bonecarver", "bowyer", and "mechanic". +:-force: Ignore normal strange mood preconditions (no recent mood, minimum + moodable population, artifact limit not reached). +:-unit: Make the strange mood strike the selected unit instead of picking + one randomly. Unit eligibility is still enforced. +:-type : Force the mood to be of a particular type instead of choosing randomly based on happiness. + Valid values for Tare "fey", "secretive", "possessed", "fell", and "macabre". +:-skill S: Force the mood to use a specific skill instead of choosing the highest moodable skill. + Valid values are "miner", "carpenter", "engraver", "mason", "tanner", "weaver", + "clothier", "weaponsmith", "armorsmith", "metalsmith", "gemcutter", "gemsetter", + "woodcrafter", "stonecrafter", "metalcrafter", "glassmaker", "leatherworker", + "bonecarver", "bowyer", and "mechanic". Known limitations: if the selected unit is currently performing a job, the mood will not be started. @@ -2118,26 +2227,25 @@ These plugins, when activated via configuration UI or by detecting certain structures in RAWs, modify the game engine behavior concerning the target objects to add features not otherwise present. +.. _plugins/siege-engine: Siege Engine ------------ -The siege-engine plugin enables siege engines to be linked to stockpiles, and -aimed at an arbitrary rectangular area across Z levels, instead of the original -four directions. Also, catapults can be ordered to load arbitrary objects, not -just stones. - -Rationale -~~~~~~~~~ Siege engines are a very interesting feature, but sadly almost useless in the current state because they haven't been updated since 2D and can only aim in four directions. This is an attempt to bring them more up to date until Toady has time to work on it. Actual improvements, e.g. like making siegers bring their own, are something only Toady can do. +The siege-engine plugin enables siege engines to be linked to stockpiles, and +aimed at an arbitrary rectangular area across Z levels, instead of the original +four directions. Also, catapults can be ordered to load arbitrary objects, not +just stones. + Configuration UI ~~~~~~~~~~~~~~~~ -The configuration front-end to the plugin is implemented by the gui/siege-engine -script. Bind it to a key (the example config uses Alt-A) and activate after selecting -a siege engine in 'q' mode. +The configuration front-end to the plugin is implemented by `scripts/gui/siege-engine`. +Bind it to a key (the example config uses Alt-A) and activate after selecting +a siege engine in ``q`` mode. .. image:: images/siege-engine.png @@ -2146,27 +2254,29 @@ the allowed operator skill range. The map tile color is changed to signify if it hit by the selected engine: green for fully reachable, blue for out of range, red for blocked, yellow for partially blocked. -Pressing 'r' changes into the target selection mode, which works by highlighting two points +Pressing ``r`` changes into the target selection mode, which works by highlighting two points with 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 'p' in the main page of this script. The area to paste is kept until you quit +just by pressing ``p`` in the main page of this script. The area to paste is kept until you quit DF, or select another area manually. -Pressing 't' switches to a mode for selecting a stockpile to take ammo from. +Pressing ``t`` switches to a mode for selecting a stockpile to take ammo from. Exiting from the siege engine script via ESC reverts the view to the state prior to starting -the script. Shift-ESC retains the current viewport, and also exits from the 'q' mode to main +the script. Shift-ESC retains the current viewport, and also exits from the ``q`` mode to main menu. +.. _plugins/power-meter: + Power Meter ----------- The power-meter plugin implements a modified pressure plate that detects power being supplied to gear boxes built in the four adjacent N/S/W/E tiles. -The configuration front-end is implemented by the gui/power-meter script. Bind it to a +The configuration front-end is implemented by `scripts/gui/power-meter`. Bind it to a key (the example config uses Ctrl-Shift-M) and activate after selecting Pressure Plate in the build menu. @@ -2180,8 +2290,6 @@ Steam Engine The steam-engine plugin detects custom workshops with STEAM_ENGINE in their token, and turns them into real steam engines. -Rationale -~~~~~~~~~ The vanilla game contains only water wheels and windmills as sources of power, but windmills give relatively little power, and water wheels require flowing water, which must either be a real river and thus immovable and @@ -2271,18 +2379,16 @@ can easily result in inconsistent state once this plugin is available again. The effects may be as weird as negative power being generated. -Add Spatter +add-spatter ----------- This plugin makes reactions with names starting with ``SPATTER_ADD_`` produce contaminants on the items instead of improvements. The produced contaminants are immune to being washed away by water or destroyed by -the ``clean items`` command. +the `plugins/clean` ``items`` command. The plugin is intended to give some use to all those poisons that can be bought from caravans. :) -To be really useful this needs patches from bug 808, ``tweak fix-dimensions`` -and ``tweak advmode-contained``. - - +To be really useful this needs patches from bug 808, `plugins/tweak` +``fix-dimensions`` and `plugins/tweak` ``advmode-contained``. diff --git a/docs/Scripts.rst b/docs/Scripts.rst index 329e30d2a..90f213eb4 100644 --- a/docs/Scripts.rst +++ b/docs/Scripts.rst @@ -4,11 +4,12 @@ DFHack Scripts Lua or ruby scripts placed in the ``hack/scripts/`` directory are considered for execution as if they were native DFHack commands. They are listed at the end -of the 'ls' command output. +of the ``ls`` command output. Note: scripts in subdirectories of hack/scripts/ can still be called, but will -only be listed by ls if called as 'ls -a'. This is intended as a way to hide -scripts that are obscure, developer-oriented, or should be used as keybindings. +only be listed by ls if called as ``ls -a``. This is intended as a way to hide +scripts that are obscure, developer-oriented, or should be used as keybindings +or from the init file. ``kill-lua`` stops any currently-running Lua scripts. By default, scripts can only be interrupted every 256 instructions. Use ``kill-lua force`` to interrupt @@ -16,6 +17,30 @@ the next instruction. .. contents:: +================= +3rd-party scripts +================= + +This listing is autogenerated from ``.rst`` files in the 3rdparty scripts directory. + +.. warning:: + + Because this documentation is pulled in from external sources, + it may not match the DFHack distribution exactly. + + * Some scripts should have a prefix (eg listed as ``myscript``, + should be ``gui/myscript``) but don't. + * Some sections of documentation may refer to scripts which are + not distributed with DFHack. + + +.. toctree:: + :glob: + :maxdepth: 2 + + /scripts/3rdparty/*/* + + ======= devel/* ======= @@ -77,7 +102,7 @@ fix/stable-temp =============== Instantly sets the temperature of all free-lying items to be in equilibrium with the environment and stops temperature updates. In order to maintain this efficient -state however, use ``tweak stable-temp`` and ``tweak fast-heat``. +state however, use `plugins/tweak` ``stable-temp`` and `plugins/tweak` ``fast-heat``. fix/stuckdoors ============== @@ -124,39 +149,18 @@ An example of player digging in adventure mode: gui/advfort_items ================= -Does something with items in advnedute mode jobs. +Does something with items in adventure mode jobs. + +.. _scripts/gui/assign-rack: gui/assign-rack =============== -Bind to a key (the example config uses P), and activate when viewing a weapon -rack in the 'q' mode. - -.. image:: images/assign-rack.png - -This script is part of a group of related fixes to make the armory storage -work again. The existing issues are: - -* Weapon racks have to each be assigned to a specific squad, like with - beds/boxes/armor stands and individual squad members, but nothing in - the game does this. This issue is what this script addresses. - -* Even if assigned by the script, **the game will unassign the racks again without a binary patch**. - This patch is called ``weaponrack-unassign``, and can be applied via - the binpatch program, or the matching script. See `the bug report`_ for more info. - -.. _`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, - unless the ``fix-armory`` plugin above is used. - -The script interface simply lets you designate one of the squads that -are assigned to the barracks/armory containing the selected stand as -the intended user. In order to aid in the choice, it shows the number -of currently assigned racks for every valid squad. +`This script requires a binpatch `, which has not +been available since DF 0.34.11 gui/autobutcher =============== -An in-game interface for the ``autobutcher`` plugin. +An in-game interface for `plugins/autobutcher`. gui/choose-weapons ================== @@ -195,6 +199,8 @@ case. Must be in look or talk mode to issue command on tile. * follow - rejoin the party after "wait" * leave - remove from party (can be rejoined by talking) +.. _scripts/gui/create-item: + gui/create-item =============== A graphical interface for creating items. @@ -238,7 +244,7 @@ computes it when the order is executed for the first time. gui/hack-wish ============= -An alias for ``gui/create-item``. Deprecated. +An alias for `scripts/gui/create-item`. Deprecated. gui/hello-world =============== @@ -250,10 +256,13 @@ To use, bind to a key (the example config uses Alt-L) and activate in the 'k' mo .. image:: images/liquids.png -This script is a gui front-end to the liquids plugin and works similar to it, +This script is a gui front-end to `plugins/liquids` and works similarly, allowing you to add or remove water & magma, and create obsidian walls & floors. -Note that there is **no undo support**, and that bugs in this plugin have been -known to create pathfinding problems and heat traps. + +.. warning:: + + There is **no undo support**. Bugs in this plugin have been + known to create pathfinding problems and heat traps. The ``b`` key changes how the affected area is selected. The default *Rectangle* mode works by selecting two corners like any ordinary designation. The ``p`` @@ -298,13 +307,17 @@ gui/no-dfhack-init ================== Shows a warning at startup if no valid ``dfhack.init`` file is found. +.. _scripts/gui/power-meter: + gui/power-meter =============== -An in-game interface for the ``power-meter`` plugin. +An in-game interface for `plugins/power-meter`. + +.. _scripts/gui/rename: gui/rename ========== -Backed by the rename plugin, this script allows entering the desired name +Backed by `plugins/rename`, this script allows entering the desired name via a simple dialog in the game ui. * ``gui/rename [building]`` in 'q' mode changes the name of a building. @@ -340,28 +353,36 @@ either immediately or after opening the assign owner page. The script lists other rooms owned by the same owner, or by the unit selected in the assign list, and allows unassigning them. +.. _scripts/gui/siege-engine: + gui/siege-engine ================ -An in-game interface for the ``siege-engine`` plugin. +An in-game interface for `plugins/siege-engine`. + +.. _scripts/gui/stockpiles: gui/stockpiles ============== -Load and save stockpile settings from the 'q' menu. -Usage:: +An in-game interface for `plugins/stocksettings`, to +load and save stockpile settings from the 'q' menu. + +Usage: - gui/stockpiles -save to save the current stockpile - gui/stockpiles -load to load settings into the current stockpile - gui/stockpiles -dir set the default directory to save settings into - gui/stockpiles -help to see this message +:gui/stockpiles -save: to save the current stockpile +:gui/stockpiles -load: to load settings into the current stockpile +:gui/stockpiles -dir : 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 this plugin. +Don't forget to ``enable stockpiles`` and create the ``stocksettings`` directory in +the DF folder before trying to use the GUI. gui/unit-info-viewer ==================== Displays age, birth, maxage, shearing, milking, grazing, egg laying, body size, and death info about a unit. Recommended keybinding Alt-I. +.. _scripts/gui/workflow: + gui/workflow ============ Bind to a key (the example config uses Alt-W), and activate with a job selected @@ -369,8 +390,8 @@ in a workshop in the 'q' mode. .. image:: images/workflow.png -This script provides a simple interface to constraints managed by the workflow -plugin. When active, it displays a list of all constraints applicable to the +This script provides a simple interface to constraints managed by `plugins/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 @@ -387,8 +408,8 @@ items and expanding the range each gives a 2x bonus). Pressing '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 ``workflow`` documentation above. In this manner, this feature +the job material first using `plugins/job` ``item-material`` or `scripts/gui/workshop-job`, +as described in `plugins/workflow` documentation. In this manner, this feature can be used for troubleshooting jobs that don't match the right constraints. .. image:: images/workflow-new1.png @@ -423,6 +444,8 @@ 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). +.. _scripts/gui/workshop-job: + gui/workshop-job ================ Bind to a key (the example config uses Alt-A), and activate with a job selected in @@ -431,7 +454,7 @@ a workshop in the 'q' mode. .. image:: 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. +them like the `plugins/job` ``item-type`` and `plugins/job` ``item-material`` commands. Specifically, pressing the 'i' key pops up a dialog that lets you select an item type from a list. @@ -469,6 +492,8 @@ 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. +.. _scripts/modtools: + ======================== modtools/* - for modders ======================== @@ -508,11 +533,15 @@ modtools/create-unit ==================== Creates a unit. +.. _scripts/modtools/equip-item: + modtools/equip-item =================== Force a unit to equip an item; useful in conjunction with the ``create`` scripts above. +See also `plugins/forceequip`. + modtools/force ============== This tool triggers events like megabeasts, caravans, invaders, and migrants. @@ -604,7 +633,8 @@ or the gui invoked by running ``add-thought gui`` with a unit selected. armoks-blessing =============== -Runs the equivalent of rejuvenate, elevate-physical, elevate-mental, and brainwash +Runs the equivalent of `scripts/rejuvenate`, `scripts/elevate-physical`, +`scripts/elevate-mental`, and `scripts/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. Use in moderation; it's as 'cheaty' as DFHack gets. @@ -621,14 +651,18 @@ Usage:: autofarm default 30 autofarm threshold 150 helmet_plump tail_pig +.. _scripts/autolabor-artisans: + autolabor-artisans ================== -Runs the ``autolabor`` plugin, with settings tuned for small but highly skilled workforces. +Runs `plugins/autolabor`, with settings tuned for small but highly skilled workforces. + +.. _scripts/autounsuspend: autounsuspend ============= -Automatically unsuspend construction jobs, on a recurring basis. -See ``unsuspend`` for one-off use, or ``resume all``. +Automatically unsuspend jobs in workshops, on a recurring basis. +See `scripts/unsuspend` for one-off use, or `plugins/resume` ``all``. ban-cooking =========== @@ -636,15 +670,13 @@ A more convenient way to ban cooking various categories of foods than the kitchen interface. Usage: ``ban-cooking ``. Valid types are ``booze``, ``honey``, ``tallow``, ``oil``, and ``seeds`` (non-tree plants with seeds). +.. _scripts/binpatch: + binpatch ======== -Checks, applies or removes binary patches directly in memory at runtime:: - - binpatch check/apply/remove +Implements functions for in-memory binpatches. See `binpatches`. -If the name of the patch has no extension or directory separators, the -script uses ``hack/patches//.dif``, thus auto-selecting -the version appropriate for the currently loaded executable. +.. _scripts/brainwash: brainwash ========= @@ -702,6 +734,8 @@ dfusion ======= Interface to a lecacy script system. +.. _scripts/digfort: + digfort ======= A script to designate an area for digging according to a plan in csv format. @@ -726,18 +760,22 @@ 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). +``Dwarf Fortress.exe`` is found). drain-aquifer ============= Remove all 'aquifer' tag from the map blocks. Irreversible. +.. _scripts/elevate-mental: + elevate-mental ============== Set all mental attributes of a dwarf to 2600, which is very high. Other numbers can be passed as an argument: ``elevate-mental 100`` for example would make the dwarf very stupid indeed. +.. _scripts/elevate-physical: + elevate-physical ================ As for elevate-mental, but for physical traits. High is good for soldiers, @@ -802,6 +840,8 @@ fixnaked ======== Removes all unhappy thoughts due to lack of clothing. +.. _scripts/fix-ster: + fix-ster ======== Utilizes the orientation tag to either fix infertile creatures or inflict @@ -863,7 +903,7 @@ Lists the key, name, and jump position of your hotkeys in the DFHack console. item-descriptions ================= Exports a table with custom description text for every item in the game. -Used by ``view-item-info``. +Used by `scripts/view-item-info`. lever ===== @@ -897,7 +937,10 @@ Examples:: log-region ========== -When enabled in 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. +When enabled in 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. + lua === There are the following ways to invoke this command: @@ -988,7 +1031,26 @@ normally used in seasonal auto-save. region-pops =========== -Show or modify the populations of animals in the region. Use ``region-pops`` for details. +Show or modify the populations of animals in the region. + +Usage: + +:region-pops list [pattern]: + Lists encountered populations of the region, possibly restricted by pattern. +:region-pops list-all [pattern]: + Lists all populations of the region. +:region-pops boost : + Multiply all populations of TOKEN by factor. + If the factor is greater than one, increases the + population, otherwise decreases it. +:region-pops boost-all : + Same as above, but match using a pattern acceptable to list. +:region-pops incr : + Augment (or diminish) all populations of TOKEN by factor (additive). +:region-pops incr-all : + Same as above, but match using a pattern acceptable to list. + +.. _scripts/rejuvenate: rejuvenate ========== @@ -1005,6 +1067,8 @@ remove-wear =========== Sets the wear on all items in your fort to zero. +.. _scripts/repeat: + repeat ====== Repeatedly calls a lua script at the specified interval. @@ -1034,8 +1098,22 @@ combat in slow motion or something :) show-unit-syndromes =================== Show syndromes affecting units and the remaining and maximum duration, along -with (optionally) substantial detail on the effects. Call -``show-unit-syndromes help`` for further options. +with (optionally) substantial detail on the effects. + +Use one or more of the following options: + +:showall: Show units even if not affected by any syndrome +:showeffects: Show detailed effects of each syndrome +:showdisplayeffects: Show effects that only change the look of the unit +:ignorehiddencurse: Hide syndromes the user should not be able to know about (TODO) +:selected: Show selected unit +:dwarves: Show dwarves +:livestock: Show livestock +:wildanimals: Show wild animals +:hostile: Show hostiles (e.g. invaders, thieves, forgotten beasts etc) +:world: Show all defined syndromes in the world +:export: ``export:`` sends output to the given file, showing all + syndromes affecting each unit with the maximum and present duration. siren ===== @@ -1071,12 +1149,12 @@ The number argument is the target liquid level (0 = drain, 7 = source). To add more than 1 unit everytime, call the command again on the same spot. -To delete one source, place the cursor over its tile and use ``delete``. +To delete one source, place the cursor over its tile and use ``source delete``. To remove all existing sources, call ``source clear``. The ``list`` argument shows all existing sources. -Ex:: +Examples:: source add water - water source source add magma 7 - magma source @@ -1092,7 +1170,7 @@ The number must be 7 or greater. stripcaged ========== For dumping items inside cages. Will mark selected items for dumping, then -a dwarf may come and actually dump it. See also ``autodump``. +a dwarf may come and actually dump it. See also `plugins/autodump`. With the ``items`` argument, only dumps items laying in the cage, excluding stuff worn by caged creatures. ``weapons`` will dump worn weapons, ``armor`` @@ -1119,7 +1197,7 @@ To make any creature superfast, target it ingame using 'v' and:: Other options available: ``del``, ``clear``, ``list``. -This plugin also shortens the 'sleeping' and 'on break' periods of targets. +This script also shortens the 'sleeping' and 'on break' periods of targets. teleport ======== @@ -1135,10 +1213,14 @@ undump-buildings ================ Undesignates building base materials for dumping. +.. _scripts/unsuspend: + unsuspend ========= -Unsuspend construction jobs, on a one-off basis. See ``autounsuspend`` for regular use. -Equivalent to ``resume all``. +Unsuspend jobs in workshops, on a one-off basis. See `scripts/autounsuspend` +for regular use. + +.. _scripts/view-item-info: view-item-info ============== @@ -1155,6 +1237,6 @@ warn-starving ============= If any (live) units are starving, very thirsty, or very drowsy, the game will be paused and a warning shown and logged to the console. Use with the -``repeat`` command for regular checks. +`scripts/repeat` command for regular checks. Use ``warn-starving all`` to display a list of all problematic units. diff --git a/conf.py b/docs/conf.py.in similarity index 92% rename from conf.py rename to docs/conf.py.in index 0dccdf303..cfd348456 100644 --- a/conf.py +++ b/docs/conf.py.in @@ -56,21 +56,21 @@ author = 'The DFHack Team' # |version| and |release|, also used in various other places throughout the # built documents. -def get_version(): - """Return the DFHack version string, from CMakeLists.txt""" - version, release = '', '' - with open('CMakeLists.txt') as f: - for s in f.readlines(): - if fnmatch.fnmatch(s.upper(), 'SET(DF_VERSION "?.??.??")\n'): - version = s.upper().replace('SET(DF_VERSION "', '') - elif fnmatch.fnmatch(s.upper(), 'SET(DFHACK_RELEASE "r*")\n'): - release = s.upper().replace('SET(DFHACK_RELEASE "', '').lower() - return (version + '-' + release).replace('")\n', '') +#def get_version(): +# """Return the DFHack version string, from CMakeLists.txt""" +# version, release = '', '' +# with open('CMakeLists.txt') as f: +# for s in f.readlines(): +# if fnmatch.fnmatch(s.upper(), 'SET(DF_VERSION "?.??.??")\n'): +# version = s.upper().replace('SET(DF_VERSION "', '') +# elif fnmatch.fnmatch(s.upper(), 'SET(DFHACK_RELEASE "r*")\n'): +# release = s.upper().replace('SET(DFHACK_RELEASE "', '').lower() +# return (version + '-' + release).replace('")\n', '') # The short X.Y version. -version = get_version() +version = '@DFHACK_VERSION@' # The full version, including alpha/beta/rc tags. -release = get_version() +release = '@DFHACK_VERSION@' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -91,7 +91,7 @@ exclude_patterns = ['docs/_build/*', 'depends/*'] # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +default_role = 'any' # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True @@ -121,7 +121,7 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'alabaster' +html_theme = '@SPHINX_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 @@ -145,7 +145,7 @@ html_theme = 'alabaster' # 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 # pixels large. -#html_favicon = None +html_favicon = 'dfhack-icon.ico' # 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, diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index bdf8f257c..bca5eaab6 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -372,12 +372,12 @@ install(DIRECTORY lua/ DESTINATION ${DFHACK_LUA_DESTINATION} FILES_MATCHING PATTERN "*.lua") -install(DIRECTORY ${dfhack_SOURCE_DIR}/scripts - DESTINATION ${DFHACK_DATA_DESTINATION} - FILES_MATCHING PATTERN "*.lua" - PATTERN "*.rb" - PATTERN "3rdparty" EXCLUDE - ) +#install(DIRECTORY ${dfhack_SOURCE_DIR}/scripts +# DESTINATION ${DFHACK_DATA_DESTINATION} +# FILES_MATCHING PATTERN "*.lua" +# PATTERN "*.rb" +# PATTERN "3rdparty" EXCLUDE +# ) install(DIRECTORY ${dfhack_SOURCE_DIR}/patches DESTINATION ${DFHACK_DATA_DESTINATION} diff --git a/library/xml b/library/xml index 32960d384..4c327037d 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 32960d38410e7caedf2b38cff7ef3f21c1785bbd +Subproject commit 4c327037df627682812d2770aa77349702d09633 diff --git a/make.bat b/make.bat deleted file mode 100644 index 0d9adc6d3..000000000 --- a/make.bat +++ /dev/null @@ -1,263 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=docs\_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 2> nul -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\DFHack.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\DFHack.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end diff --git a/scripts/3rdparty/dscorbett b/scripts/3rdparty/dscorbett new file mode 160000 index 000000000..544f890a6 --- /dev/null +++ b/scripts/3rdparty/dscorbett @@ -0,0 +1 @@ +Subproject commit 544f890a62622e2c6188991afe61fdf3c0513227 diff --git a/scripts/3rdparty/kane-t b/scripts/3rdparty/kane-t new file mode 160000 index 000000000..e80864910 --- /dev/null +++ b/scripts/3rdparty/kane-t @@ -0,0 +1 @@ +Subproject commit e808649108be6bc97323b54151d621c57aded51f diff --git a/scripts/3rdparty/lethosor b/scripts/3rdparty/lethosor index ceed207e3..e3666a738 160000 --- a/scripts/3rdparty/lethosor +++ b/scripts/3rdparty/lethosor @@ -1 +1 @@ -Subproject commit ceed207e38220e21067a91b8d6f7b9680a476f69 +Subproject commit e3666a7385ca00565b95f3d7c6d41f6e7955816f diff --git a/scripts/3rdparty/maienm b/scripts/3rdparty/maienm new file mode 160000 index 000000000..8cffa1266 --- /dev/null +++ b/scripts/3rdparty/maienm @@ -0,0 +1 @@ +Subproject commit 8cffa1266d8903b568cf48366dd6f57095e3ae97 diff --git a/scripts/3rdparty/maxthyme b/scripts/3rdparty/maxthyme new file mode 160000 index 000000000..a0f48ba8a --- /dev/null +++ b/scripts/3rdparty/maxthyme @@ -0,0 +1 @@ +Subproject commit a0f48ba8a8fb7e32cb57125e31f76979e3687a1d diff --git a/scripts/3rdparty/roses b/scripts/3rdparty/roses new file mode 160000 index 000000000..9341dd35f --- /dev/null +++ b/scripts/3rdparty/roses @@ -0,0 +1 @@ +Subproject commit 9341dd35f83bcc2c4e41cdd4ee16060a049d374d diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index ed5cc1ffc..82edb19a9 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,2 +1,14 @@ include(Scripts.cmake) +DFHACK_3RDPARTY_SCRIPT_REPO(dscorbett) +DFHACK_3RDPARTY_SCRIPT_REPO(kane-t) DFHACK_3RDPARTY_SCRIPT_REPO(lethosor) +DFHACK_3RDPARTY_SCRIPT_REPO(maienm) +DFHACK_3RDPARTY_SCRIPT_REPO(maxthyme) +DFHACK_3RDPARTY_SCRIPT_REPO(roses) + +install(DIRECTORY ${dfhack_SOURCE_DIR}/scripts + DESTINATION ${DFHACK_DATA_DESTINATION} + FILES_MATCHING PATTERN "*.lua" + PATTERN "*.rb" + PATTERN "3rdparty" EXCLUDE + )