2009-09-13 18:02:46 -06:00
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
DFHack is a Dwarf Fortress memory access library and a set of basic tools using
|
|
|
|
this library. The library is a work in progress, so things might change as more
|
|
|
|
tools are written for it.
|
|
|
|
|
|
|
|
It is an attempt to unite the various ways tools access DF memory and allow for
|
|
|
|
easier development of new tools.
|
|
|
|
|
2009-09-13 18:02:46 -06:00
|
|
|
Getting DFHack
|
|
|
|
----------------
|
2010-03-26 05:20:30 -06:00
|
|
|
The project is currently hosted on github, for both source and binaries:
|
2010-02-24 07:06:40 -07:00
|
|
|
http://github.com/peterix/dfhack
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
* Packages
|
|
|
|
|
|
|
|
The library and tools are packaged for Archlinux and are available both in AUR
|
|
|
|
and the arch-games repository.
|
|
|
|
|
|
|
|
The package name is dfhack-git :)
|
|
|
|
|
|
|
|
Clarification
|
|
|
|
-------------
|
|
|
|
|
|
|
|
'fake SDL.dll', 'SHM', 'libdfconnect' and 'shim library' are basically the same
|
|
|
|
thing. A library that sits between DFHack and DF, provides some extra features,
|
|
|
|
synchronisation and access control. You should use it for everything that writes
|
|
|
|
data back to DF.
|
|
|
|
|
|
|
|
You'll need the SHM to attach more than one tool to DF on Linux.
|
|
|
|
The DFHack version of Dwarf Therapist requires it for writing creature names
|
|
|
|
and professions.
|
|
|
|
|
|
|
|
See 'Using DFHack Tools' for instructions on installing it.
|
2009-09-13 18:02:46 -06:00
|
|
|
|
2009-09-14 14:02:16 -06:00
|
|
|
Compatibility
|
|
|
|
-------------
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2009-09-14 14:02:16 -06:00
|
|
|
DFHack works on Windows XP, Vista, 7 or any modern Linux distribution.
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
Windows 2000 is currently *not supported* due to missing OS functionality.
|
|
|
|
If you know how to easily suspend processes, you can fix it :)
|
2009-09-14 14:02:16 -06:00
|
|
|
|
|
|
|
OSX is also not supported due to lack of developers with a Mac.
|
|
|
|
|
|
|
|
Currently supported Dwarf Fortress versions:
|
|
|
|
* Windows
|
2010-03-26 05:20:30 -06:00
|
|
|
38a - 40d19_2
|
2009-09-14 14:02:16 -06:00
|
|
|
|
|
|
|
* Linux
|
2010-03-26 05:20:30 -06:00
|
|
|
40d2 - 40d19
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
Currently supported DF versions *by the SHM*:
|
|
|
|
* Windows
|
|
|
|
40d15 - 40d19
|
|
|
|
|
|
|
|
* Linux
|
|
|
|
40d9 - 40d19 (40d2 - 40d8 might work, but are untested)
|
2009-09-14 14:02:16 -06:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
Using the library as a developer
|
|
|
|
--------------------------------
|
2009-09-13 18:02:46 -06:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
The library is compilable under Linux with GCC and under Windows with MinGW32
|
|
|
|
and MSVC compilers. It is using the cmake build system. See COMPILE for details.
|
|
|
|
|
|
|
|
DFHack is using the zlib/libpng license. This makes it easy to link to it, use
|
|
|
|
it in-source or add your own extensions. Contributing back to the dfhack
|
|
|
|
repository is welcome and the right thing to do :)
|
|
|
|
|
|
|
|
At the time of writing there's no API reference or documentation. The code does
|
2010-03-26 05:20:30 -06:00
|
|
|
have a lot of comments though (and getting better all the time).
|
2009-09-13 18:02:46 -06:00
|
|
|
|
|
|
|
|
2010-01-18 09:44:24 -07:00
|
|
|
Using DFHack Tools
|
|
|
|
------------------
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
The project comes with a special extra library you should add to your DF
|
|
|
|
installation. It's used to boost the transfer speed between DF and DFHack, and
|
|
|
|
provide data consistency and synchronization. DFHack will work without the
|
|
|
|
library, but at suboptimal speeds and the consistency of data written back
|
|
|
|
to DF is questionable.
|
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
!!! on Windows this currently only works with DF 40d15 - 40d19_2 !!!
|
|
|
|
On Linux, it works with DF 40d9 - 40d19
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2010-02-24 07:06:40 -07:00
|
|
|
!!! use the pre-compiled library intended for your OS and version of DF !!!
|
2010-02-15 23:21:38 -07:00
|
|
|
You can find them in the 'precompiled' folder.
|
2010-02-24 07:06:40 -07:00
|
|
|
|
2010-01-18 09:44:24 -07:00
|
|
|
|
|
|
|
** Installing on Windows
|
2010-02-15 23:21:38 -07:00
|
|
|
- Open your DF folder, locate SDL.dll and rename it to SDLreal.dll (making
|
|
|
|
a backup of it is a good idea)
|
|
|
|
- Copy the right DFHack SDL.dll into your DF folder.
|
|
|
|
- Restart DF if it is running
|
2010-01-18 09:44:24 -07:00
|
|
|
|
|
|
|
** Unistalling on Windows
|
|
|
|
- Open your DF folder, locate SDL.dll and delete it
|
2010-02-15 23:21:38 -07:00
|
|
|
- Rename SDLreal.dll to SDL.dll
|
2010-01-18 09:44:24 -07:00
|
|
|
- Restart DF if it is running
|
|
|
|
|
|
|
|
|
|
|
|
** Installing on Linux
|
|
|
|
- Open your DF folder and the libs folder within it
|
|
|
|
- copy DFHack libdfconnect.so to the libs folder
|
2010-03-26 05:20:30 -06:00
|
|
|
- copy the df-hacked script to your DF folder
|
2010-01-18 09:44:24 -07:00
|
|
|
- Use this new startup script to start DF
|
2010-03-26 05:20:30 -06:00
|
|
|
|
|
|
|
** Replacing libdfconnect.so
|
|
|
|
- Make sure you close DF before you replace this file! DF crashes whn you don't
|
|
|
|
close it first!
|
2010-01-18 09:44:24 -07:00
|
|
|
|
|
|
|
** Uninstalling on Linux
|
|
|
|
- Open your DF and DF/libs folders
|
|
|
|
- Delete libdfconnect.so and the dfhacked startup script
|
|
|
|
- Go back to using the df startup script
|
2009-09-13 18:02:46 -06:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2009-09-13 18:02:46 -06:00
|
|
|
Tools
|
|
|
|
-----
|
2009-09-14 14:02:16 -06:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
All the DFHack tools are terminal programs. This might seem strange to Windows
|
|
|
|
users, but these are meant mostly as examples for developers. Still, they can
|
|
|
|
be useful and are cross-platform just like the library itself.
|
2009-09-13 18:02:46 -06:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
If the tool writes back to DF's memory, make sure you are using the shared
|
|
|
|
memory interface mentioned in the previous section!
|
2009-09-14 14:02:16 -06:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
* catsplosion- Makes all cats pregnant and due in 100 game steps. Use with care.
|
|
|
|
|
|
|
|
* magma_create - creates 7/7 magma at the DF's cursor
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
* reveal - plain old reveal tool. It reveals all the map blocks already
|
|
|
|
initialized by DF.
|
2009-09-14 14:02:16 -06:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
* veinlook - a silly map viewer. It can mass-dig veins in a map square.
|
|
|
|
(Linux only)
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
* prospector - scans the map for minerals. by default it only scans only visible
|
|
|
|
veins. You can make it show hidden things with '-a' and base rock
|
|
|
|
and soil layers with '-b'. These can be combined ('-ab')
|
2010-01-18 09:44:24 -07:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
* cleanmap - cleans mud, vomit, snow and all kinds of mess from the map.
|
|
|
|
It will clean your irrigated farms too, so consider yourself
|
|
|
|
warned.
|
2010-01-18 09:44:24 -07:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
* incrementalsearch - incremental search utility (Linux only).
|
2010-01-18 09:44:24 -07:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
* bauxite - converts all mechanisms into bauxite mechanisms.
|
2010-01-18 09:44:24 -07:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
* itemdesignator - Allows mass-designating items by type and material - dump,
|
|
|
|
forbid, melt and set on fire ;)
|
2010-02-24 07:06:40 -07:00
|
|
|
* digger - allows designating tiles for digging/cutting/ramp removal
|
|
|
|
|
|
|
|
A list of accepted tile classes:
|
|
|
|
1 = WALL
|
|
|
|
2 = PILLAR
|
|
|
|
3 = FORTIFICATION
|
|
|
|
|
|
|
|
4 = STAIR_UP
|
|
|
|
5 = STAIR_DOWN
|
|
|
|
6 = STAIR_UPDOWN
|
|
|
|
|
|
|
|
7 = RAMP
|
2010-03-26 05:20:30 -06:00
|
|
|
8 = RAMP_TOP
|
2010-02-24 07:06:40 -07:00
|
|
|
|
2010-03-26 05:20:30 -06:00
|
|
|
9 = FLOOR
|
|
|
|
10 = TREE_DEAD
|
|
|
|
11 = TREE_OK
|
|
|
|
12 = SAPLING_DEAD
|
|
|
|
13 = SAPLING_OK
|
|
|
|
14 = SHRUB_DEAD
|
|
|
|
15 = SHRUB_OK
|
|
|
|
16 = BOULDER
|
|
|
|
17 = PEBBLES
|
2010-02-24 07:06:40 -07:00
|
|
|
|
|
|
|
Example : dfdigger -o 100,100,15 -t 9,10 -m 10
|
|
|
|
This will start looking for trees at coords 100,100,15 and designate ten of them for cutting.
|
2010-01-18 09:44:24 -07:00
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
|
2009-09-14 14:02:16 -06:00
|
|
|
Memory offset definitions
|
|
|
|
-------------------------
|
|
|
|
|
2010-02-15 23:21:38 -07:00
|
|
|
The file with memory offset definitions used by dfhack can be found in the
|
2010-03-26 05:20:30 -06:00
|
|
|
output folder.
|
2009-09-14 14:02:16 -06:00
|
|
|
|
2010-01-18 09:44:24 -07:00
|
|
|
~ EOF ~
|