Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10 11 ... 108

Author Topic: DFHack 0.5.15 (legacy)  (Read 404917 times)

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #120 on: July 23, 2010, 11:31:28 pm »

I uploaded an actual XML file to dffd for those who can't or don't know how to make XML files.

Find it here: http://dffd.wimbli.com/file.php?id=2795
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

SeveQ

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #121 on: July 24, 2010, 10:47:09 am »

It's probably considered cheating, I know, but do you think there is a way to use DFHack to add plants and/or trees to a running fortress, to "reforest" its surroundings? I'm running out of wood...  :'(
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #122 on: July 24, 2010, 11:05:25 am »

There is more wood in the caverns :P
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #123 on: July 24, 2010, 12:30:03 pm »

DF itself should be able to determine the needed offsets. I wonder if Toady was willing to add a feature that would log some offsets somewhere. Just my two cents...
it'd be nice if people stopped asking for toady to change the application to support this third party project. I mean, I doubt he'd want to anyways...
this is a cheating application, therefore it can and will not be supported by the developer.
I use this tool myself, but I don't thing it would be a good idea to do something such as this, changing the engine to support a utility designed to alter the engine? doesn't sound like it would be safe.

sizeak

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #124 on: July 24, 2010, 01:39:09 pm »

Err not really. Writing the offset's of various data structures used by the game to a file is hardly dangerous, nor would it be particularly difficult
Logged
Runesmith - http://www.bay12forums.com/smf/index.php?topic=59056.0 - A Dwarf Companion like tool

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #125 on: July 24, 2010, 02:36:53 pm »

Ok.. I need help.

I just started learning C++ a few days ago. My program works now and when you get below a specified amount of potash or ash it queues the creation of more for you automatically, it just leaks 1 meg of ram each time it loops. :(

It doesn't leak a single byte of ram in the loop if this line is taken out....
Code: [Select]
item = items->getItemDescription(p_items[i], Materials).c_str();




Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

soul4hdwn

  • Bay Watcher
  • make due with what you have
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #126 on: July 24, 2010, 03:20:29 pm »

Ok.. I need help.

I just started learning C++ a few days ago. My program works now and when you get below a specified amount of potash or ash it queues the creation of more for you automatically, it just leaks 1 meg of ram each time it loops. :(

It doesn't leak a single byte of ram in the loop if this line is taken out....
Code: [Select]
item = items->getItemDescription(p_items[i], Materials).c_str();

ahh the pitfalls of C
Logged

sizeak

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #127 on: July 24, 2010, 03:56:57 pm »

It's all good practice
Logged
Runesmith - http://www.bay12forums.com/smf/index.php?topic=59056.0 - A Dwarf Companion like tool

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #128 on: July 24, 2010, 04:45:41 pm »

Ok.. I need help.

I just started learning C++ a few days ago. My program works now and when you get below a specified amount of potash or ash it queues the creation of more for you automatically, it just leaks 1 meg of ram each time it loops. :(

It doesn't leak a single byte of ram in the loop if this line is taken out....
Code: [Select]
item = items->getItemDescription(p_items[i], Materials).c_str();
Amazing. And I thought I should rip that part of DFHack out and rewrite it... or spend much more time and document what's it actually doing ~_~
* peterix is amazed it works.

Also, I should have 31.11 supported shortly... seems like other people did most of the work already :) Just needs a bit of testing and doing the same for Maps stuff support on Linux.

Kadath

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #129 on: July 24, 2010, 05:21:01 pm »

Quote
Also, I should have 31.11 supported shortly...
Excellent.
Logged

marcusbjol

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #130 on: July 24, 2010, 06:10:00 pm »

DF itself should be able to determine the needed offsets. I wonder if Toady was willing to add a feature that would log some offsets somewhere. Just my two cents...
it'd be nice if people stopped asking for toady to change the application to support this third party project. I mean, I doubt he'd want to anyways...
this is a cheating application, therefore it can and will not be supported by the developer.
I use this tool myself, but I don't thing it would be a good idea to do something such as this, changing the engine to support a utility designed to alter the engine? doesn't sound like it would be safe.
This is sorta in/correct.  Dwarf Therapist is a memory hack, but is almost required to play the larger fortresses.  Abstracting the UI would fall under this category.
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #131 on: July 24, 2010, 06:12:17 pm »

You know what would be awesome? A way to attach all the modding tools to the UI. Could you imagine being able to use DT or DFHack or Runesmith or whatever from INSIDE Dwarf Fortress? That would be awesome. (I know, department of redundancy department, but still. It would be.)
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #132 on: July 24, 2010, 08:57:45 pm »

Amazing. And I thought I should rip that part of DFHack out and rewrite it... or spend much more time and document what's it actually doing ~_~
* peterix is amazed it works.

Also, I should have 31.11 supported shortly... seems like other people did most of the work already :) Just needs a bit of testing and doing the same for Maps stuff support on Linux.

Oh ok.. hrm. Well, all I am really needing to do is count the amount of certain types of items, not dump them. Gonna try looking at how the stocks screen does its job now I guess. Was hoping I would get lucky, the stock screen doesn't seem to keep a running total :P
« Last Edit: July 24, 2010, 09:23:43 pm by devek »
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

xDarkz

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #133 on: July 24, 2010, 10:13:51 pm »

Can't wait for for new version :].
« Last Edit: July 25, 2010, 03:43:54 am by xDarkz »
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.4 - tools and memory access library
« Reply #134 on: July 25, 2010, 05:04:31 am »

Ya, looks like the way to count items with DFhack and not leak memory is something like..

Code: [Select]
    ash = 0;
    logs = 0;
    potash = 0;
    DFHack::DfVector <uint32_t> p_items (p, p->getDescriptor()->getAddress ("items_vector"));
    uint32_t size = p_items.size();
    DFHack::Items *items = DF->getItems();
    for (unsigned int i=0;i<size;i++)
    {
        uint32_t vtable = p->readDWord(p_items[i]);
        if(p->readClassName(vtable).compare("item_woodst") == 0 ) { logs++; continue; }
        if((p->readClassName(vtable).compare("item_barst") == 0) &&
           (p->readWord(p_items[i]+138) == 9))  { ash++; continue; }
        if((p->readClassName(vtable).compare("item_barst") == 0) &&
           (p->readWord(p_items[i]+138) == 8))  { potash++; continue; }
    }
    items->Finish();

Works pretty fast, and I have had my program on an infinite loop the last hour without it gaining a byte.
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"
Pages: 1 ... 7 8 [9] 10 11 ... 108