Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 ... 54

Author Topic: Dwarf Companion - new version linked @first post  (Read 99750 times)

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #45 on: January 14, 2008, 04:42:00 pm »

Adding skills is complicated (need to allocate memory, painful!).

For the mood, it might be possible to add all the stuff that's usually asked, but to have a dwarf, for example, select a specific gem would be a lot of work.

Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Dwarf Companion
« Reply #46 on: January 14, 2008, 06:33:00 pm »

quote:
Originally posted by bartavelle:
<STRONG>Adding skills is complicated (need to allocate memory, painful!).</STRONG>

Injecting memory is easy with VirtualAllocEx().  The issue is getting said memory onto the heap, so that free() doesn't do bad things.

The way I see to do this is to inject a piece of code that calls new() or malloc() and stuffs the results into the proper place, then terminates itself.  Then fire off that code with CreateRemoteThread().  Then do the rest of your edits and resume the main DF thread.  This leaves the injected code hanging around in memory, which does no harm.

Fun stuff.  The source for my latitudes utility shows how to inject code.

Alternately, you could go to the trouble of creating a custom debugger, attaching to the process, and use breakpoints and stack massaging to do the call to malloc().  Note that the mere existance of an attached debugger will cause DF to run slower.  Note also that a debugger can't detach from a process in Windows NT or Windows 2000.

Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #47 on: January 15, 2008, 03:53:00 am »

Right now i'm content to just have to use readprocessmemory and writeprocessmemory, so that i can have several utils run at once (maximizing the probability of a fatal race condition). But i will probably want to inject code in the DF process soon. It would be cooler to run the function that adds materials to the mood requests intead of doing it by hand, but i would have to search into the TEXT for this function, and i'm reluctant to duplicate your work in python. I'd rather copy and paste it once i'll write a standalone .exe  :)

Oh and by the way, do NOT teleport a creature that is hauling something. Crashed the game everytime for me.

Logged

penguinofhonor

  • Bay Watcher
  • Minister of Love
    • View Profile
Re: Dwarf Companion
« Reply #48 on: January 21, 2008, 09:26:00 pm »

.
« Last Edit: October 20, 2015, 09:47:39 pm by penguinofhonor »
Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #49 on: January 22, 2008, 01:50:00 am »

I altered the wiki so that it's a bit more obvious, you should:

Double click on "dfcompanion_prototype.py"

Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #50 on: January 22, 2008, 03:30:00 am »

New version is up, notable new stuff:
* instamood button
* handles money, paralysis, stun ..
* combat reports in DF mode (spammy!)
Logged

Foxy111

  • Bay Watcher
    • View Profile
Re: Dwarf Companion
« Reply #51 on: January 22, 2008, 04:54:00 am »

Hi,

Thanks for a great utility.

The old version was running fine, however when I deleted the old files and installed the new version, I get an error, as follows:

Traceback (most recent call last):
 File "C:\Program Files\fortress\companion\dfcompanion_prototype.py", line 3, i
n <module>
   import gtk
 File "C:\Program Files\fortress\companion\gtk\__init__.py", line 38, in <modul
e>
   import gobject as _gobject
 File "C:\Program Files\fortress\companion\gobject\__init__.py", line 30, in <m
odule>
   from _gobject import *
ImportError: Module use of python24.dll conflicts with this version of Python.

I re-installed Python 2.5.1 and the Gtk+/Win32 Runtime Environment Installer, but that didn't help

would be great if you could give me a pointer!

thanks,

f

Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #52 on: January 22, 2008, 08:04:00 am »

Seems like a failed somewhere ...
I repackaged it, please try again!
Logged

Foxy111

  • Bay Watcher
    • View Profile
Re: Dwarf Companion
« Reply #53 on: January 22, 2008, 08:29:00 am »

thanks - really appreciate the help.

unfortunately still fails with the same error. Am I downloading the right package? (http://bartabox.banquise.net/df/companion-0.6-python25.zip )

cheers

Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #54 on: January 22, 2008, 11:12:00 am »

Yep, i fail to see the problem. Are you sure you uninstalled the previous (2.4) python version?
Logged

Foxy111

  • Bay Watcher
    • View Profile
Re: Dwarf Companion
« Reply #55 on: January 22, 2008, 12:12:00 pm »

Thanks - I had not uninstalled the previous version. I removed both versions and reinstalled 2.5.1 but had no joy - I then installed dwarf companion using the separate modules options, and this works great

thank you!

Logged

Stregone

  • Bay Watcher
    • View Profile
Re: Dwarf Companion
« Reply #56 on: January 22, 2008, 04:11:00 pm »

Does anyone have another link tot he python installer? python.org seems to be down (for me atleast).

EDIT: nevermind, site came back up.

[ January 22, 2008: Message edited by: Stregone ]

Logged

Nite/m4re

  • Bay Watcher
  • Too Deep
    • View Profile
Re: Dwarf Companion
« Reply #57 on: January 22, 2008, 04:58:00 pm »

Hmm can't get the instamood thing to work... How it works?

BTW, found some flags

0x8.4 = If enabled, makes the animal un-slaughterable (is this correct?) like a non-tame animal. The labor menu just get blank when enabled.

0x8.7 = Marks the animal as tame in the unit list

[ January 22, 2008: Message edited by: Nite/m4re ]

Logged

bartavelle

  • Bay Watcher
  • Coin coin!
    • View Profile
Re: Dwarf Companion
« Reply #58 on: January 22, 2008, 06:48:00 pm »

Instamood will not work if you do not qualify for a new artifact!

It means you should not have more than (items created / 200) and (underground squares revealled / (48*48)) artifacts already created! I'll add this check soon.

PS: thanks for the flags, marking them, which side for the 8.7?

[ January 22, 2008: Message edited by: bartavelle ]

[ January 22, 2008: Message edited by: bartavelle ]

Logged

Nite/m4re

  • Bay Watcher
  • Too Deep
    • View Profile
Re: Dwarf Companion
« Reply #59 on: January 22, 2008, 06:54:00 pm »

quote:
Originally posted by bartavelle:
<STRONG>Instamood will not work if you do not qualify for a new artifact!

It means you should not have more than (items created / 200) and (underground squares revealled / (48*48)) artifacts already created! I'll add this check soon.

PS: thanks for the flags, marking them, which side for the 8.7?
</STRONG>


Hmmm? What you mean with which side?

EDIT: Oh, its the right-most ones.

[ January 22, 2008: Message edited by: Nite/m4re ]

Logged
Pages: 1 2 3 [4] 5 6 ... 54