v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Utility:Dwarf Companion

From Dwarf Fortress Wiki
Jump to navigation Jump to search
This utility page is about v0.28.121.40d, an older version of DF.
This is a preliminary screenshot of the prototype.

What?[edit]

This project is about having a helper utility for dwarf fortress, hopefully filling gaps in the user interface. It will also allow some cool cheating, so that it would be possible to play with the engine. For example, you can now mark your nobles as butcherable! Ain't that cool?

For now, a PROTOTYPE utility is available, for testings. It uses python and requires many dependencies. It will end up as a standard .exe tool once features are ironed out.

It supports version 40d16, supposedly. The latest screenshot is at this place.

Important warning[edit]

When fiddling with DF memory, you might get crashes. Here are two important advices:

  • when writing into memory (like updating a creature's data), pause the game, load the data, update it, save it and then unpause the game
  • do not teleport creatures that are hauling

Self-packaged executables[edit]

There is an executable version by Valdemar available that does not require Python or any of the other of the dependencies to be installed. Unzip it and run "dfcompanion_prototype.exe" to bring up the core companion window. The scripts available in the pure python version also have exe equivalents:

  • revealVeins.exe - run with no arguments to reveal all vein tiles
  • reveal.exe - run with no arguments to reveal the whole map (very slow, a C utility like Tweak is recommended for this task)
  • designator.exe - see User:Bartavelle/DesignatorTiles
  • changeProfession.exe - run through command prompt like "changeProfession [id] [profession]" where id is the ID of the dwarf you want to change (find this through core companion; pull up the profile of a dwarf and look in the window title) and profession is the profession to change to (Mason, Peasant, Speardwarf, etc.)

Download (Version 0.16). Download (Version 0.17c).

How to install and run it[edit]

You need to install several things first. Do it right, or it will not work.

  • Python (should work with any version)
  • from this page, the latest "Gtk+/Win32 Runtime Environment Installer" (the files that is named like that : gtk-2.12.9-win32-2.exe, scroll down a bit).
  • For users of the -any versions, or python 2.4 users, you must:
    • Install the three modules from this page (PyCairo, PyGObject, PyGTK)
    • Grab the software, v0.17d, at this place.
  • Reboot your computer. Although the software doesn't demand it, if you don't do so Python won't know where to find modules, leading to errors.
  • Double click on "dfcompanion_prototype.py"!

Problems?[edit]

  • Some black window flashes and nothing happens!

You should run it from the command line. Start / run / cmd.exe. Then type


cd c:\where\companion\is\located\

dfcompanion_prototype.py


You can copy by clicking on the top-right icon, and click copy in the Edit submenu. Then select with mouse, and press enter to copy.

  • The error message is something about a not finding pygtk, pycairo or pygobject

You didn't install properly the 3 modules at the pygtk site (see link in the how section).

  • The error messages says it can't find a dll

The GTK runtime environment is not properly installed.

  • The error messages says something like "g_assert_warning not found in libglib-2.0.0.dll"

There is a DLL conflict. You should reinstall the GTK runtime environment. If this fails, you have to find the old DLL that is staying somewhere on your system and remove it. Probably in c:\windows\system32\

  • No-one responds when I ask questions on the talk page.

Have everyone look at the discussion page on the off chance that they might know something.

Usage - what can you do?[edit]

First run Dwarf Fortress, and load your game. It won't work otherwise.

The general idea is to have the main window open next to your DF windows. It should help you play the game by providing useful hints while playing. Order dwarves using the column "alerts" so that most important stuff is on top : hungry, unhappy, moody, hurt dwarves. You can play with creatures and view detailed views of their attributes by double clicking them. Right now, you can interact by:

  • clicking "heal", heals creature
  • clicking "hurt", hurts creature
  • clicking "apply", saves the following changes:
    • position X,Y,Z
    • strength, agility, toughness
    • all flags (the checkbox stuff), most being unknown, please let us know about their use if you get it!
    • pain, exhaustion, hunger, thirst, drowsiness
    • race (still needs to be tested!)
    • mood type (fey, macabre, ...), and mood skill increased

Interesting effects are butcherable dwarves and Corbine's crazy dogs. Oh, and skeletal legendary miners that turn against your fortress.

Random questions[edit]

  • How to prevent a dwarf from bleeding to death ? Turn him zombie. It will make him hostile, but cure his bleeding. Turn him back when happy.
  • Reveal like tools and discovering the underground features : you have to uncover a tile belonging to an underground feature for it to be officially found. Just unreveal some tiles and dig through them.

dwarfdbg scripts[edit]

Here is a collection of scripts that wouldn't fit in DC but might be useful. Copy them in the DC folder and run them.

Changelog[edit]

  • utils.zip : initial test, some bugs with accents
  • utils.0.1.zip : corrected problem with bad characters
  • utils.0.2.zip : corrected problem with long strings
  • utils.0.3.zip : corrected problem with creatures not in legends
  • utils.0.4.zip : quick (untested) upgrade to v0.27.169.33g
  • companion.0.5-any.zip - 07/01/2008
    • Skill edition
    • Removed the dependency on pydbg, should now work with python 2.x
    • Incomplete linux support, for those people who go on holiday with only their linux laptops ...
    • More details in the flags names
    • Disabled the regular refreshes for now
    • Body part name is resolved when showing damages
    • Right-click popup with quick features : heal, hurt, tame, make war animal, rest and restore
    • Civilization altering (steal that merchant swordsman!)
  • companion.0.6-any.zip - 22/01/2008
    • Better error handling for Window users, should help debugging ...
    • Firstname and nickname editor (finally)
    • Money warnings, and money cheat
    • Combat reports in DF mode
    • Bleeding/Paralysis/ ... can be tweaked
    • "Opinion poll"
    • More details
    • Instamood!
  • companion.0.7-any.zip - 07/02/2008
    • Couples list
    • Name editor
    • Right click / zoom now works
    • Support for 38a
  • companion.0.8-any.zip - 13/02/2008
    • Removal of the couple list, should hopefully fix bugs
    • Several scripts for more fun
    • Better support for stuff
    • Should be "final" of the prototype, next step will probably involve working on a standalone .exe, and the occasionnal fun script
  • companion.0.9-any.zip - 18/02/2008
    • Quick update to fix for the new DF version.
  • companion.0.9-any.zip - 26/02/2008
    • Another quick fix for 38b
  • companion.0.12-any.zip - 18/07/2008
    • tons of changes, this specific version just keeps up with DF
  • companion.0.13-any.zip - 18/08/2008
    • compatibility with 39f, should not work with previous versions
    • zoom feature is disabled, because of UI changes
    • added bugged slow reveal script :)
  • companion.0.14-any.zip - 14/09/2008
    • zoom is back
    • custom alerts are easier to add
    • corrected the map offsets, added a "revealVein.py" script
  • companion.0.15-any.zip
    • linux support is back
    • and now, it is fast
  • companion.0.16-any.zip - 05/10/2009
    • solves bug with additional languages
  • companion.0.17-any.zip - 27/11/2009
    • d16 support
    • ASLR support

thanks[edit]

  • the memory hackers!
  • Phil, for the clever python tricks
  • Corbine, for early testings, bug discovery, and flags discovery
  • sinoth, for early testings, bug discovery