Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 80 81 [82] 83 84 ... 108

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

jaxad0127

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1215 on: April 11, 2011, 09:18:43 am »

You could use what DFHack has now and read the rest from raws. Just need to match up the raw names.

Is there anyway to get the loaded world's location in the file system? At least it's name? I'm writing a tool that will load it's raws in addition to what DFHack provides to provide more detail.
Logged

notfood

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.12
« Reply #1216 on: April 11, 2011, 02:14:53 pm »

I hope this helps, it gets annoying having to reload every time a new unit makes it to the list. Thanks.
Try the new version now.

Works like a charm, thanks!
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.5.13
« Reply #1217 on: April 11, 2011, 03:51:06 pm »

Thank you in advance!
I am working on some sort of macro program. It needs to read things like list of available building materials from screen so it can select the proper one.
This might take some time to update for the newer DF versions, but you might be able to already do this with some of the old ones. Both linux and windows DF 0.31.12 should work.
If you use these together:
Code: [Select]
bool Gui::getWindowSize (int32_t &width, int32_t &height)
bool Gui::getScreenTiles (int32_t width, int32_t height, t_screen screen[])
and provide a t_screen array of size
Code: [Select]
sizeof(t_screen)*width*height, you should get the screen contents.
Emphasis on should. I don't think anyone's been using this for quite some time... I'm not even sure if the layout of those things is still the same as it was then. It also had problems with black scanlines, because the reading wasn't synchronized with DF's screen repaints, so it might not be entirely trivial.

Guess we'll find out.

Works like a charm, thanks!
Don't thank me, I'm not the one who fixed it. It was a very bad and hard to spot problem related to linux large file support... I thought I had it fixed already so I didn't even check that part ~_~

Oh, and next version could have the items support back, along with the 'set pants on fire' type of tools.

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: DFHack 0.5.13
« Reply #1218 on: April 11, 2011, 03:59:53 pm »

So we will be able to make our legendary lier's pants burst into flames?  Awesome!   Perhaps the migrant lye makers too just for good measure, I mean, once you have one why would you need more?
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.5.13
« Reply #1219 on: April 11, 2011, 10:54:16 pm »

I need to ask about Dflair does the function swap the site function to lair or does it search through all the tiles in the fort then turn on the flag to prevent scattering? hopefully it's the latter. because it doesn't work for me.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

jaxad0127

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1220 on: April 12, 2011, 12:05:01 am »

I need to ask about Dflair does the function swap the site function to lair or does it search through all the tiles in the fort then turn on the flag to prevent scattering? hopefully it's the latter. because it doesn't work for me.
Yes, it sets every tile on the map to lair.
Logged

Corbine

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1221 on: April 12, 2011, 12:08:05 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
Logged
hat

Rafal99

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1222 on: April 12, 2011, 02:52:54 am »

This might take some time to update for the newer DF versions, but you might be able to already do this with some of the old ones. Both linux and windows DF 0.31.12 should work.
If you use these together:
Code: [Select]
bool Gui::getWindowSize (int32_t &width, int32_t &height)
bool Gui::getScreenTiles (int32_t width, int32_t height, t_screen screen[])
and provide a t_screen array of size
Code: [Select]
sizeof(t_screen)*width*height, you should get the screen contents.
Emphasis on should. I don't think anyone's been using this for quite some time... I'm not even sure if the layout of those things is still the same as it was then. It also had problems with black scanlines, because the reading wasn't synchronized with DF's screen repaints, so it might not be entirely trivial.

Guess we'll find out.

Thanks for info, I will take a look at it.

I checked Baughn's graphics code to see how the tiles are stored in DF.
They are a single array char[4*numberOfTiles]. For every tile [0 ] is tile character, [1] is foreground color, [2] is background color and [3] is whether the foreground is bright.
The graphicst class contains pointers to both the start and the end+1 of the tiles array (named "screen" and "screen_limit"). The struct itself ifs allocated in static memory.
I hope the code inside DF is similar. :)
I will play a little with CheatEngine to see.
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

TolyK

  • Bay Watcher
  • Nowan Ilfideme
    • View Profile
Re: DFHack 0.5.13
« Reply #1223 on: April 12, 2011, 03:08:53 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
just encase every invader in obsidian. then mine it out.
presto!
Logged
My Mafia Stats
just do whatevery tolyK and blame it as a bastard mod
Shakerag: Who are you personally suspicious of?
At this point?  TolyK.

Dante

  • Bay Watcher
  • Dante likes cats for their corrupt intentions.
    • View Profile
Re: DFHack 0.5.13
« Reply #1224 on: April 12, 2011, 03:27:50 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
just encase every invader in obsidian. then mine it out.
presto!
It might still be useful to have, in the cases where there's a 'stuck' invader due to the creature being falling when the game is saved. I assume that's still a bug.
Also problematic when the invaders are higher than the maximum level you can cast obsidian, of course.

raoulxq

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1225 on: April 12, 2011, 04:17:41 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
Use Runesmith, it has an option to kill every creature of a type on the map. You can also select a creature in Runesmith and activate the "dead" flag.
Logged

raoulxq

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1226 on: April 12, 2011, 04:25:02 am »

Question:

Is Creatures.current_job.active currently broken? I never seems to be set.

Same about Creatures.ReadJob(), does it work?
Logged

Rafal99

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1227 on: April 12, 2011, 05:25:25 am »

I think I have hacked DF screen. :D
The values are aligned in exactly the same way as in Baughn's code.

Here are the offsets I got for DF 0.31.25 Windows SDL:
Code: [Select]
00B34D1C: screen
00B3508C: screen_limit
00B34D34: clipx[0]
00B34D38: clipx[1]
00B34D3C: clipy[0]
00B34D40: clipy[1]
00B3507C: dimx
00B35080: dimy
00B35084: mouse_x
00B35088: mouse_y

Explanation:

screen, screen_limit - pointers to start and end+1 of the tiles array. They constantly flip between 2 arrays, apparently they swap buffers.
The important thing is that the arrays are aligned vertically, it goes like: first column, second column etc.

clipx[0], clipx[1], clipy[0], clipy[1] - minimal and maximal coordinates of tiles. For standard 80x25 screen they will be 0, 24, 0, 79. They change when the screen is zoomed or resized.

dimx, dimy - size of view, for example 80, 25. They change when the screen is zoomed or resized.

mouse_x, mouse_y - coordinates of a tile which is currently pointed by the mouse cursor. Their value is FFFFFFFF when mouse is outside view.

I got all these with default values [PRINT_MODE:2D] and [SINGLE_BUFFER:NO].

Edit: Just tried with [PRINT_MODE:ACCUM_BUFFER] and [SINGLE_BUFFER:YES] and all offsets are the same. Even with single buffer the pointers swap between 2 arrays.
« Last Edit: April 12, 2011, 05:51:34 am by Rafal99 »
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

Corbine

  • Bay Watcher
    • View Profile
Re: DFHack 0.5.13
« Reply #1228 on: April 12, 2011, 06:17:55 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
Use Runesmith, it has an option to kill every creature of a type on the map. You can also select a creature in Runesmith and activate the "dead" flag.

Already did that, siege still rocking on.  Current theory on how to get it to work is to remove the dead flag and kill all the goblins again, but I can bring back a few, but within a few seconds dwarf fortress will crash.

Oh well, might as well start a new world with a scenario of xenophobic dwarves and see how long I last. :D
Logged
hat

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.5.13
« Reply #1229 on: April 12, 2011, 06:49:26 am »

Any chance there will be a 'siege breaker' addition to DFHack to help end sieges if everything else fails?
Use Runesmith, it has an option to kill every creature of a type on the map. You can also select a creature in Runesmith and activate the "dead" flag.

Already did that, siege still rocking on.  Current theory on how to get it to work is to remove the dead flag and kill all the goblins again, but I can bring back a few, but within a few seconds dwarf fortress will crash.

Oh well, might as well start a new world with a scenario of xenophobic dwarves and see how long I last. :D
It's possible to end a siege. I did it with 40d using some captured goblins - reset their invader flags and let them loose out of their cages. This fixes the siege when you recapture/kill the goblins. If you used any kind of drastic measure as setting the DEAD flag is, you made it only worse. Use magma next time.
The fort can be saved. I'll add tools for that eventually. Not now though, the process of finding the right offsets in this case is long and I don't have time for that.

Question:

Is Creatures.current_job.active currently broken? I never seems to be set.

Same about Creatures.ReadJob(), does it work?
Creatures.current_job.active should work. Actually, I just tested it with 31.25 on linux and it works nicely. I can see the jobs dwarves do. I'll check the windows version too.
Creatures.ReadJob() is not exactly related to the current job. It's meant for mood materials and it's missing the required offsets for the recent versions I think.

@Rafal99
Good job. It should be possible to work with that.
Pages: 1 ... 80 81 [82] 83 84 ... 108