Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 106 107 [108] 109 110 ... 116

Author Topic: DFHack 0.44.12-r2  (Read 144472 times)

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1605 on: January 11, 2019, 07:56:16 pm »

I found I had to load from the main world folder (not /data/save/current) even though I could save to either.
Oh, sorry, I thought that part was obvious. The current folder gets cleared after saving, after its contents are copied into the region folder. Writing directly to the region folder will lead to incorrect behavior if DF quits without saving.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1606 on: January 11, 2019, 08:02:18 pm »

I think I can make that work. Periodically saving to the current folder should be fine. I might have to modify the quick save script to trigger a write though to make sure the save and the files dont get out of sync if a crash happens between the two.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1607 on: January 11, 2019, 08:31:38 pm »

If a crash happens "between the two" what? If a crash happens while saving, it should only affect files in the current folder - that's how DF is designed, to cut down on corruption. A crash when moving files into the region folder is exceptionally unlikely.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1608 on: January 11, 2019, 08:46:44 pm »

I think the issue would be if the game saves with a stale version of foo.dat in current.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. Was this inevitable (Y/y)?

Tat45

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1609 on: January 11, 2019, 09:59:29 pm »

I'm getting a CTD under a very specific scenario: I'm trying to set up a zone ('i') submenu as a rectangular area with the mouse enabled. If I select the second corner in an unmined area and then hit "Enter" to place the zone, Dwarf Fortress immediately crashes with no discernibly related log output that I can see.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.44.12-r2
« Reply #1610 on: January 12, 2019, 11:08:52 am »

I found I had to load from the main world folder (not /data/save/current) even though I could save to either.
That should actually be the other way around - when reading, you should try data/save/current first and then fall back to data/save/regionX, but when writing, you should always go to data/save/current.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1611 on: January 12, 2019, 03:35:58 pm »

If a crash happens "between the two" what? If a crash happens while saving, it should only affect files in the current folder - that's how DF is designed, to cut down on corruption. A crash when moving files into the region folder is exceptionally unlikely.

I think the issue would be if the game saves with a stale version of foo.dat in current.

Yes, sorry. I meant if the game saves and moves an out of date dat file then updates the dat file in the data/save/current directory but crashes before that can get moved to the data/save/regionX folder. For normal saves this isn't an issue since there is the ON_WORLD_UNLOAD thing, and for autosaves it shouldn't be an issue since they happen at specific times and I can always make sure to get the updated dat file in the /current directory in the correct order. But quicksaves aren't predictable. Luckily it is easy enough to hook into the quicksave script and just make sure that the dat file is updated in the correct order.
Logged

Romi

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1612 on: January 18, 2019, 07:05:33 pm »

Is it possible to use DFHack to remove engravings?

I just noticed that all my main areas were engraved by low quality engravers, because I forgot to tick off stone detailing from the "peasant" squad that helped smoothed up the place. This a 5 year Fortress that I have meticulously micromanaged, and this really soured my playthrough.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1613 on: January 18, 2019, 09:13:17 pm »

Is it possible to use DFHack to remove engravings?

I just noticed that all my main areas were engraved by low quality engravers, because I forgot to tick off stone detailing from the "peasant" squad that helped smoothed up the place. This a 5 year Fortress that I have meticulously micromanaged, and this really soured my playthrough.
You could use gui/liquids to spawn magma on them, then remove it a tick later. Not sure that works for walls, however.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. Was this inevitable (Y/y)?

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1614 on: January 19, 2019, 03:35:26 am »

@Romi: Note that you can achieve it without DFHack by manually designating each sub standard tile for smoothing again (which of course is a pain, but if you're hard into perfect, that's the way to do it). It would presumably be possible to write a script that designated all non masterworks engravings for smoothing, although I don't know the details. In both cases the dorfs would actually do the work themselves, so it wouldn't be "cheating".
Logged

Romi

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1615 on: January 19, 2019, 05:34:13 am »

@Romi: Note that you can achieve it without DFHack by manually designating each sub standard tile for smoothing again (which of course is a pain, but if you're hard into perfect, that's the way to do it). It would presumably be possible to write a script that designated all non masterworks engravings for smoothing, although I don't know the details. In both cases the dorfs would actually do the work themselves, so it wouldn't be "cheating".

I didn't know that, I much prefer this safe and sound method, Thanks!  There is no need for the script i'll just redo everything.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1616 on: January 19, 2019, 11:51:38 am »

Yes, sorry. I meant if the game saves and moves an out of date dat file then updates the dat file in the data/save/current directory but crashes before that can get moved to the data/save/regionX folder.
If the game crashes, the updated .dat file shouldn't get copied to the regionX folder. That's how the current persistent API works as well.

Quote
For normal saves this isn't an issue since there is the ON_WORLD_UNLOAD thing, and for autosaves it shouldn't be an issue since they happen at specific times and I can always make sure to get the updated dat file in the /current directory in the correct order. But quicksaves aren't predictable. Luckily it is easy enough to hook into the quicksave script and just make sure that the dat file is updated in the correct order.
Keep in mind that the quicksave script doesn't run on "normal" autosaves so you won't be able to detect those. edit: I guess you can use the fact that autosave times are fixed, yeah.

Again, I'm saying you should write to data/save/current/foo.dat whenever something changes, and you will be fine. You don't need to worry about detecting save events at all. Granted, if you need to write to disk a lot (as in multiple times a second), it would be better to detect saves, and writing only periodically could risk saving slightly stale data. As part of BenLubar's persistent JSON PR, I'll try to make sure scripts have a way to access the save events as well as plugins. But for non-intensive use, you don't have to detect save events.
« Last Edit: January 19, 2019, 11:53:36 am by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1617 on: January 19, 2019, 03:23:43 pm »

Yes, sorry. I meant if the game saves and moves an out of date dat file then updates the dat file in the data/save/current directory but crashes before that can get moved to the data/save/regionX folder.
If the game crashes, the updated .dat file shouldn't get copied to the regionX folder. That's how the current persistent API works as well.

Quote
For normal saves this isn't an issue since there is the ON_WORLD_UNLOAD thing, and for autosaves it shouldn't be an issue since they happen at specific times and I can always make sure to get the updated dat file in the /current directory in the correct order. But quicksaves aren't predictable. Luckily it is easy enough to hook into the quicksave script and just make sure that the dat file is updated in the correct order.
Keep in mind that the quicksave script doesn't run on "normal" autosaves so you won't be able to detect those. edit: I guess you can use the fact that autosave times are fixed, yeah.

Again, I'm saying you should write to data/save/current/foo.dat whenever something changes, and you will be fine. You don't need to worry about detecting save events at all. Granted, if you need to write to disk a lot (as in multiple times a second), it would be better to detect saves, and writing only periodically could risk saving slightly stale data. As part of BenLubar's persistent JSON PR, I'll try to make sure scripts have a way to access the save events as well as plugins. But for non-intensive use, you don't have to detect save events.

For testing I am just going to have it write out to data/save/current once a week (in game time), the problem with writing it every time something changes is that it could theoretically be changing a lot given that it tracks a large amount of information. If I find that in actuality it doesn't change that often I will move to just writing it out whenever it changes.

Questions about SC_WORLD/MAP_LOADED/UNLOADED
1. For loading, does it matter if I use world or map? There will just be a single file for an entire region and it's just being read into a global table for access by other scripts.
2. For unloading, what is the order of operations? If I save to current as part of an unload state change, will the file be moved correctly?
Logged

bloop_bleep

  • Bay Watcher
  • U want sum seed?
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1618 on: January 20, 2019, 02:19:49 pm »

I have a bug report/fix.

kittens.cpp fails to compile on Windows with the Visual Studio C++ compiler because of the missing <array> include. I guess on the author's platform, one of the other standard library includes includes <array> itself, but that isn't true on Visual Studio.
Logged
bloop_bleep's Moving Fortress Parts Mod!

Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #1619 on: January 21, 2019, 11:34:06 pm »


well finish working on a refined script that teleports multiple campsites that are named BOAT.

pretty much spending my time in advmode with this script walking up to ambush points and plopping down a camp so that the ambush ends up being attacked by personal body guards... or undead camel, then realizing I'm also taking the ambush party with me when I leave.
combination of this saving everyone at the camp with zones and telling companions to leave one could build a small community anywhere.
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
Pages: 1 ... 106 107 [108] 109 110 ... 116