Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 198 199 [200] 201 202 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 876423 times)

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2985 on: July 10, 2021, 02:33:47 am »

:
As for the other plugin I want to create that will replace worn clothes. It appears that worn clothes getWear value go from 1 to 4, at the least, based on code, and 0 means no wear. The code does not show whether there is an upper limit, but that 4 and 5 would have the same wear label. At what point is worn clothing scrapped by a dwarf?
I don't think dorf clothing behavior has been identified in detail. On the top level, dorfs tend to replace clothing worn down to the 'x' level (which I expect to be 1) as soon as there's a replacement available. If there isn't a replacement, they'll wear clothes until they rot off their bodies and are destroyed, resulting in a bad thought (I suspect that might be level 5, which, in that case, would exist only very briefly until the clothing item is destroyed by a DF cleanup sweep).

However, dorfs are often caught hoarding pristine clothing, including masterworks ones, so there's something going on on top of wear. Some or all dorfs probably replace clothes of a lower quality with higher quality ones, and some probably replace clothes of the same quality but with a lower value with more valuable ones. I don't think this behavior has been researched, but I wouldn't be surprised if personality traits affect how much "better" a piece of clothing would have to be to be claimed.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2986 on: July 10, 2021, 05:51:36 am »

:
As for the other plugin I want to create that will replace worn clothes. It appears that worn clothes getWear value go from 1 to 4, at the least, based on code, and 0 means no wear. The code does not show whether there is an upper limit, but that 4 and 5 would have the same wear label. At what point is worn clothing scrapped by a dwarf?
I don't think dorf clothing behavior has been identified in detail. On the top level, dorfs tend to replace clothing worn down to the 'x' level (which I expect to be 1) as soon as there's a replacement available. If there isn't a replacement, they'll wear clothes until they rot off their bodies and are destroyed, resulting in a bad thought (I suspect that might be level 5, which, in that case, would exist only very briefly until the clothing item is destroyed by a DF cleanup sweep).

However, dorfs are often caught hoarding pristine clothing, including masterworks ones, so there's something going on on top of wear. Some or all dorfs probably replace clothes of a lower quality with higher quality ones, and some probably replace clothes of the same quality but with a lower value with more valuable ones. I don't think this behavior has been researched, but I wouldn't be surprised if personality traits affect how much "better" a piece of clothing would have to be to be claimed.

The logic is easily presentable through the military screen.

If you simply create a replace-clothes uniform in the military screens composing of a simple trousers, shoes socks etc, dwarves during inactive phases of having no schedule within a active squad will always prioritize to change their clothes for masterwork articles, even if its premature because the military screen always nessecitates the best availible specified 'armor' is used.

There are also instances where preferences for a finished goods object and high amounts of desire to aquire objects often creates a dwarf which weighs themselves down possibly to death with a amount of rings and crowns they wear from interacting with a bin of finished good materials (which each object inside the container is noticed by the dwarf as a wearing candidate/seperate to clothing where every dwarf is meta-aware of the location and quality of clothes to put on related to the military-clothing situation). Normallly dwarf clothes that have become unowned and obsolete due to damage will be dropped in their rooms/stored in cabinets or instantly returned to a designated open armor pile when the totally destroyed threshold is met, i dont know why your dwarves still persist to wear broken clothes unless that open armor pile is just inacessable/not made likely.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2987 on: July 10, 2021, 06:03:35 am »

@FantasticDorf: You've made the assumption that the military equipment replacement scheme is the same as the civilian one, which I don't think has been proven.

Dorfs wear clothing items until those rot off when there are no replacements. That situation typically occurs with underwear, as dorfs can't produce them, and the influx from elven caravans and gobbo invaders typically is very insufficient to meet the demand. You'll get the same situation if you try to use a minimalistic clothing production strategy of only producing the minimum number of clothing items required to cover the body, as the unsatisfied clothing layers will be filled with clothing grabbed from invaders as soon as those become available.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2988 on: July 10, 2021, 07:00:53 am »

I don't know if the number of logs produced by a tree corresponds exactly to anything (e.g. the number of trunk tiles), but there's a chance it does, or that it's close.

Edit: it seems that you all have figured out that it's more complicated. I mainly just wanted to track down this script again. Carry on!

Logs do correspond exactly to trunk tiles. Mushroom trees only drop 1 log because they use "connection_north" for their caps instead of "trunk" (as seen with my script you linked.)

Figuring out if a tree is fully grown is a separate issue that can't be determined by trunks.

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. This was inevitable (Y/y)?

Kat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2989 on: July 12, 2021, 12:09:25 pm »

It's an issue with the script. Looks like you're the first one that's reported it since it broke a year or so ago, so thank you! (It may be a rare case - I don't seem to have a save where I can reproduce the issue easily.)

Here's a fix that should work. If you can test it out, that'd be great. You can either make the changes manually to hack/scripts/show-unit-syndromes.rb, or replace that file with the new version (be sure to save the new one with a ".rb" extension and overwrite the existing one).

This fix will also be in the next DFHack release, which is hopefully soon.

Didn't have an earlier save of the game with the cursed unit that caused an error, unfortunately.

Though some other werecreatures and vampires turned up later, and the new script didn't seem to cause any issues, if that's any help.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2990 on: July 12, 2021, 12:22:34 pm »

Whats the longest amount of time people have managed to the new run post fort wg script for? We should run a QA test competition.
« Last Edit: July 12, 2021, 03:55:01 pm by FantasticDorf »
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2991 on: July 13, 2021, 02:29:51 am »

Something's off with the map_block_column struct in IDA, at least in my setup:
Spoiler (click to show/hide)

gui/gm-editor browses it fine.

Edit: Never mind. Data was actually a map block, not a column.
« Last Edit: July 14, 2021, 03:28:57 am by Bumber »
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. This was inevitable (Y/y)?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2992 on: July 13, 2021, 08:31:55 am »

Code: [Select]
function sigh2()
for k,v in pairs(df.global.world.squads.all) do
if v.alias == 'DFHACK' then
print(df.global.world.squads.all[k].alias)
for ki,vi in pairs(df.global.world.squads.all[k].positions) do
if df.global.world.squads.all[k].positions[ki].occupant ~= -1 then
local occup=vi.occupant
--local occup=df.global.world.squads.all[k].positions[ki].occupant
--print(occup)
local nemoccup=df.global.world.history.figures[occup].nemesis_id
insertreport(nemoccup)
end
end
end
end
end
--end
function insertreport(nemoccup)
for de,oe in pairs(df.global.world.army_controllers.all) do
if oe.mission_report == nil then else
print ( de,oe.mission_report.title)
for e,o in pairs(df.global.world.armies.all) do
if oe.id == o.controller_id then
print (e)
--return e,o
local forv=df.global.world.armies.all[e].members[0]
df.global.world.armies.all[e].members:insert("#",{new=true,nemesis_id=nemoccup,
stored_fat = forv.stored_fat,
unk_2c= forv.unk_2c,
unk_28= forv.unk_28,
unk_1= forv.unk_1,
unk_30= forv.unk_30,
unk_34= forv.unk_34})
end
end
end
end
end
sigh2()

ok just remember I forgot to post this script for returning squad members here uhh I probably need to test this for R2 when I get around to installing r2
but uhh yeah here's a script for
a, you went around the world in adventure mode as a military commander and recruited folks to the military and want to recall them all back to the player fort.
b, you lost some squad members after unretiring and want them back
c, other... mostly you mess with the other military army scripts I work on and decided to add a kobold that tried to steal some socks to the military and want to return them back to the site.
had to do a safety test on this to see if it work on my copy of Dfhack r1 and I want to advise caution on using this script as I just had lost everyone to the void and the only means of them returning was when I added another person to the squad then sent them out after which I had the chance to insert the missing folks to the new army.
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

Silverwing235

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2993 on: July 14, 2021, 05:46:50 am »

Not certain where this came from originally - more of a chance subreddit discovery, at that - but it is a spelling error, seemingly having polluted the documentation:

Quote from: ui_advmode
idenfitied several fields

Thoughts?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2994 on: July 14, 2021, 10:51:17 am »

Yes, that's a typo. Can't be fixed in the release docs, unfortunately, but it can be fixed on develop.
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.

DwarfStar

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2995 on: July 14, 2021, 01:32:07 pm »

Dear DFHack team,

I use this revealdesignated script a lot while playing:

http://www.bay12forums.com/smf/index.php?topic=168607.0

It's the best way I know of to dig out a bunch of warm or damp tiles that I know are safe without endless cancellations. Is there another way to solve that problem? I think this is a better way to eliminate cancellations than disabling them altogether, because you might forget to turn them back on.

If this is useful, could you incorporate it into the DFHack release? Maybe it would be useful for other people as well. And then I wouldn't have to keep installing it by hand. :)
Logged

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2996 on: July 18, 2021, 12:49:39 am »

I've got a question:

Logged
Really hoping somebody puts this in their signature.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2997 on: July 18, 2021, 01:50:50 am »

Just discovered that DF uses binary search to find a construction at a tile. It's probable that DF does so in a number of places.

So then: Does DFHack take into account that some DF vectors must be sorted when it inserts new entries into them?

Does a vector insert handle that on its own?
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. This was inevitable (Y/y)?

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2998 on: July 18, 2021, 03:44:40 am »

Just discovered that DF uses binary search to find a construction at a tile. It's probable that DF does so in a number of places.

So then: Does DFHack take into account that some DF vectors must be sorted when it inserts new entries into them?

Does a vector insert handle that on its own?

Isn't this bit of information somewhat related to Quietust's and other's binary-patches for ageing past versions regarding things like weaponstands etc?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r2
« Reply #2999 on: July 18, 2021, 09:57:49 pm »

Just discovered that DF uses binary search to find a construction at a tile. It's probable that DF does so in a number of places.

So then: Does DFHack take into account that some DF vectors must be sorted when it inserts new entries into them?

Does a vector insert handle that on its own?
We're aware. A lot vectors are sorted by a primitive "id" field of each item they contain (or something with a similar name), and "df.some_type.find()" uses this to speed up searches. For insertions, there is "insert_into_vector" (in C++, in MiscUtils.h) and "utils.insert_sorted" in Lua. However, in most cases, IDs cannot be reused, so newly-created items should have the largest ID and can be inserted at the end of vectors without causing problems. This doesn't apply to items with more complex keys, like constructions sorted by coordinate, and I'm not even sure if insert_sorted() works for those.

The insert() method of a vector in both languages is the native C++ implementation (or a wrapper), which doesn't handle sorting.
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.
Pages: 1 ... 198 199 [200] 201 202 ... 244