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 Talk:Dwarf Companion

From Dwarf Fortress Wiki
Jump to navigation Jump to search

I did some cleaning (actually I just removed most of it).

Compatibility with Mods

Was working with the Dig Deeper mod, and found that it doesn't work with modded in creatures at all. That's a let-down. Jwguy 07:55, 5 July 2009 (UTC)

Not actual anymore. Works with all creatures, whether modded or not. --Blur 18:30, 8 February 2010 (UTC)

Not working

I'm on 40d, and have followed the instructions on the page, (GTK Win32 runtime, Python 2.5, All three modules, and the Program), started the program up before and after Dwarf Fortress, just to see if I did it wrong the first time, and it doesn't work. The Program just has some category tabs and a few buttons, but never shows any data. Jwguy 18:31, 29 May 2009 (UTC)

  • Additionally, in case it might help, all I am getting is a single box with Refresh, All Creatures, Only Dwarves, etc. There doesn't seem to be a load function or anything. I'd really appreciate some help with this. Jwguy 18:41, 29 May 2009 (UTC)
    • I believe I was able to correct the problem. Apparently, the program is centered around the C:/ drive only. I normally play Dwarf Fortress from my portable hard-drive, and tried initializing the program on both devices. After a bit of trial and error, I moved both to my desktop, and it seems to work, now. Hopefully, if anyone else has this problem, they can fix it like this; I still can't get my dwarves to stop dying from heat after running through a flow of lava, though. I threw them in water, doused the clothes and healed, but I digress. Jwguy 00:31, 30 May 2009 (UTC)

Bugs

There are a few known bugs :

  • exhaustion is sometimes maxed out when you edit a creature
  • bleeding seems not to be stoppable in most case : just turn the creature undead
  • if there is a problem related to python and/or gtk, just make sure you followed the installation instructions. If it doesn't work anyway, it is unlikely I can help you (would be a python or gtk problem, not a DC problem)


Feature requests!

What would be the chances of dwarf item manipulation? I'd love to bhttp://dwarffortresswiki.net/index.php/Utility_Talk:DwarfCompanione able to get rid of the rotting clothes that these stinking dwarves insist on wearing. Aristoi 15:01, 20 May 2009 (UTC)

Or maybe destroy that burning fire imp fat... Forsaken1111 06:08, 27 May 2009 (UTC)

Most Dwarves acquire dabbling level in all the social skills very quickly, which leaves these skills at the top of their skill list for all time. Even if they later become a Legendary Mason, you still have to scroll down to see it. Can you add something that reorders their skills by highest level, so the things they're best at show up first? --Oddrune 05:19, 1 June 2009 (UTC)


Ignite units would be a nice feature too. --Blur 17:23, 8 February 2010 (UTC)

Dwarf Companion - Cheating Fun in Adventure Mode!

I was tinkering about with the Dwarf Companion program earlier today, when a thought came to my mind. "What if you could do stuff with this program in Adventure mode?"

Well, it turns out that you can. By turning on the program and hitting the "All Creatures" box, you can access any loaded creature as well as your own adventurer. By doing this, you can make him as strong and legendary as you want, and effectively kill anything within the sector. You can also change your character into any creature in the game, including demons, goblins, etc. (NOTE: 'Shapeshifting' like this renders the tile where you changed un-passable, and you tend to teleport when you do so. Also, when I changed into a dragon, the game crashed.) Moods are also able to toggle, though I've only tested them upon my own adventurer. Going beserk in a human town triggered the mayor to start attacking me, but when I turned it off, he became friendly once again.

Here's a movie of some of my exploits with a fresh adventurer dwarf: http://mkv25.net/dfma/movie-348-dwarfcompanioninadventuremode17338a

I hope this strikes as interesting / useful for the future!

Please sign your additions to the discussion page. Forsaken1111 06:09, 27 May 2009 (UTC)

Easy Python/PyGTK installer

I was having some trouble getting all the Python dependencies to work properly together, but after some research I found a nice all-in-one PyGTK installer that works perfectly with companion 0.10. http://aruiz.typepad.com/siliconisland/2006/12/allinone_win32_.html Hope this helps!

DwarfCompanion Linux HOWTO

There are two major problems when trying to run DwarfCompanion-0.13 in Linux:

  • at least when started with "wine dwarfort.exe", dwarf-companion
    • cannot find the path to the executable when searching for the offsets
    • and has problems finding the process with "endswith()"

the following patch tries to work around these problems somewhat (you either have to run DwarfCompanion one directory-level down from your dwarfort.exe or change the path in the patch):

--- companion/dwarfdbg.py	2008-09-07 22:04:12.000000000 +0000
+++ ~/dwarf_fortress/companion/dwarfdbg.py	2008-09-07 22:07:11.000000000 +0000
@@ -100,9 +100,9 @@
 		self.dbg = pydbg()
 		self.metals = None
 		for (pid, proc) in self.dbg.enumerate_processes():
-			if proc.lower().endswith("dwarfort.exe"):
+			if "dwarfort.exe" in proc.lower():
 				break
-		if not proc.lower().endswith("dwarfort.exe"):
+		if not "dwarfort.exe" in proc.lower():
 			print "Dwarf Fortress is not running, or could not be found"
 			sys.exit(-1)
 		self.image = proc
@@ -864,7 +865,7 @@
 
 	def getOs(self):
 		if self.ofs == None:
-			self.ofs = offsetsearch.offsetsearch(self.image)
+			self.ofs = offsetsearch.offsetsearch("../dwarfort.exe")
 		return self.ofs
 
 	def instaMood(self):


  • reading/writing from the dwarf-fortress process when attaching/detaching with ptrace() without waiting for the process to react to the ptrace() also leads to problems, basically it is timing-dependent if you can read or change anything

this is easily fixed with waitpid (though I'm not quite sure if this really fixes the problem or if some signals could screw everything up again, therefore the "print status" statement):

--- companion/dflinux.py	2008-01-09 10:50:00.000000000 +0000
+++ ~/dwarf_fortress/companion/dflinux.py	2008-09-07 21:29:50.000000000 +0000
@@ -33,6 +33,9 @@
 		pid = int(spid)
 		self.pid = pid
 		self.libc.ptrace(16, self.pid, 0, 0) #ptrace attach
+		status = 0
+		self.libc.waitpid(self.pid, status, 0)
+		print status
 	
 	def read(self, addr, size):
 		out = 
@@ -60,4 +63,7 @@
 	def detach(self):
 		if self.pid>0:
 			self.libc.ptrace(17, self.pid, 0, 0) #ptrace detach
+			status = 0
+			self.libc.waitpid(self.pid, status, 0)
+			print status
 			self.pid = 0
  • There are still some minor problems, e.g. when trying to set anything in the creature-editor, but at least healing and resting from the creature-list works now as expected. I will try to take a look at the creature-editor ...

--Penguin dwarf08 14:14, 11 September 2008 (EDT)

Thanks for this ! Bartavelle 09:20, 17 March 2009 (UTC)


Happydorf.py

I ran into a bug with a fortress that my dorfs were suiciding so I hacked this up to force their happiness to max, and it got me over the hump. It might help someone someday. Save as happydorf.py and dump it in your DC/scripts folder.

from dwarfdbg import * from eventname import jobName import sys dbg = dwarfdbg() #init dbg cl = dbg.getCreatures(0) #get the whole creature list (slow) for id in cl:

    if cl[id][1] != 'dwarf': #keep Dwarf (both alive and dead)
         continue
    c = cl[id][13] # creature structure
    if c.fe4&2:
         continue
    c.happiness = 65534 #Set happy to max -1, (max is 65535 as of 40D)
    dbg.saveCreature(c) #save

--Kittyz 14:56, 27 January 2009 (EST) Kittyz

Compatibility

Does this work in 0.28.181.40d11? It says DF isn't running or can't be found when I try. --Simmura McCrea 18:16, 12 May 2009 (UTC)

Nope. --Bartavelle 08:48, 13 May 2009 (UTC)
Damn. Cheers anyway. --Simmura McCrea 15:25, 13 May 2009 (UTC)
Workaround: Transport save file to a 40d folder, mess around, transport it back. 40d/40d11 are mutually compatible. -Heartofgoldfish 00:18, 18 May 2009 (UTC)
Are there any plans to update the memory locations? I tried simply renaming the file to dwarfort.exe as it is in 40d but it would not work as the memory locations are out of date. Forsaken1111 06:08, 27 May 2009 (UTC)
The problem lies in the name of the file, change Dwarf Fortress.exe to dwarfort.exe and the utility will find it, gave me a memory error, but it may work for you once you have the right name. Janizary 19:39, 18 May 2009 (UTC)
"B" is for Bold. You should put this out on the wiki proper, where it will be found by those who need it - start a Linux article, perhaps. Jo no habla linuxol, but once you do it will only grow.--Albedo 15:08, 20 May 2009 (UTC)

Unknown flags

0x1 =??? dead? =Kills creature when used with 'dead' 0x4 =??? artifact =designates whether creature has created an artifact 0x10 =hostile 0x20 =??? merch1? caravan guard? 0x100 0x200 !unitlist liaison? zombie skel working prone 0x1.4 inv1 hidden inv2 0x1.5 0x2.5 0x4.5 0x8.5 0x1.6 0x2.6 tame 0x8.6 r.guard f.guard 0x4.7 0x8.7 0x1b 0x2b 0x4b 0x8b 0x10b 0x20b 0x40b dead vanish? 0x200b 0x400b 0x800b 0x1000b winded? 0x4000b ground flying slaughter underwrld can't eat 0x1.5b 0x2.5b 0x4.5b visitor? 0x1.6b 0x2.6b 0x4.6b 0x8.6b 0x1.7b winded? 0x4.7b tame2

FTP SERVER DOWN!

THE FTP SERVER FOR THE PyObject AND WHATEVER THE OTHER TWO ARE IS DOWN! THE DAMN FTP SERVER IS DOWN! GOD DAMN IT THE FTP SERVER IS DOWN! I NEED FTP SERVER! FTP SERVER DOWN! FTP SERVER NOT WORKING! FTP SERVER DEAD! FTP SERVER SUFFERING MANGLED HEART!

I found a site that mirrors these files (possibly not the most up-to-date ones though) http://www.filewatcher.com/b/ftp/ftp.dit.upm.es/linux/mirrors/ftp.gnome.org/binaries/win32.0.0.html

Additional in-game languages (v0.17)

If you have additional languages modded into the game, out-of-the-box DwarfCompanion 0.17 will bomb with an error:

File "[PATH]\dwarfdbg.py", line 477, in getCreature name = self.getName(c, details) File "[PATH]\dwarfdbg.py", line 323, in getName lastname = self.printName(table, lang) File "[PATH]\dwarfdbg.py", line 219, in printName lastname += self.rwords[lang][v] IndexError: list index out of range

To make it work, count the number of languages you have (but not language_SYM.txt).

Find the line in dwarfdbg.py which reads:

for race in range(4):

Replace the 4 with the number of languages you have, run again, and it should work fine.

As of 0.17c this is no longer necessary.

Loading error

I'm not sure if you actually check this, but here goes anyway.

I have all the other things installed (GTK, PYCairo, etc.), and when I click it, it simply opens a black window for a moment and closes. So I tried to run it through the command prompt, and it comes up with the following error:

C:\Games\Dwarf Fortress>dfcompanion_prototype.py
Timestamp = 0x48c330df
Traceback (most recent call last):
File "C:\Games\Dwarf Fortress\dfcompanion_prototype.py", line 409, in <module>
DFcmp = DFcompanion()
File "C:\Games\Dwarf Fortress\dfcompanion_prototype.py", line 353, in __init__
self.dd = dwarfdbg(verbose=True)
File "C:\Games\Dwarf Fortress\dwarfdbg.py", line 131, in __init__
self.configoffsets()
File "C:\Games\Dwarf Fortress\dwarfdbg.py", line 89, in configoffsets
raise "can't guess offsets if not PE"
TypeError: exceptions must be classes or instances, not str

A similar thing happens when I try to use the executable version:

C:\Documents and Settings\****\My Documents\Downloads\dist>dfcompanion_prototype.exe
Timestamp = 0x48c330df
C:\Documents and Settings\****\My Documents\Downloads\dist\library.zip\dwarfdbg.py:98: DeprecationWarning: raising a string exception is deprecated
Traceback (most recent call last):
File "dfcompanion_prototype.py", line 409, in <module>
File "dfcompanion_prototype.py", line 353, in __init__
File "dwarfdbg.pyc", line 131, in __init__
File "dwarfdbg.pyc", line 89, in configoffsets
can't guess offsets if not PE

What does this mean? How do I fix it? Did I do something stupid and obvious to mess it up? 69.109.124.77 09:37, 12 January 2010 (UTC)

tried running through the cmd.exe but I keep getting "the directory name is invalid"

It was flashing the black window so I tried to run it through run/cmd.exe, however it says that the directory name is invalid. I have tried several solutions, such as surrounding it with quotes (helps a little bit but not much), but I still can't get it to run. Which is a pity because I was looking forward to this. Suggestions?


Edit: I made the window flash enough times to get a glimpse of what was written, and it looks like I have a similar problem to the above poster. Pleeeeease respond, someone? :(