Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 333 334 [335] 336 337 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 988773 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5010 on: December 22, 2013, 08:17:16 pm »

What does
Code: [Select]
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
do?

I've been fooling around with one of those dwarves who's been injured and subsequently ignored, and my initial method of doing so was to pare down the fullheal script and force the dwarf unconscious for a while. This seemed to work, so I set about removing the mysterious parts of fullheal that I'd previously ignored. Doing this resulted in a script that KO'd the dwarf as before (allowing them to be fed and watered), but who went right back to lying about once they regained consciousness.

A script that's just
Spoiler (click to show/hide)
gets the layabout dwarf up and eating and drinking and sleeping, but due to her injuries she was still crawling around. An attempt to reinjure her by standing her on a raising bridge resulted in the old wounds vanishing and being replaced by the bruising caused by the bridge throw.

So, I'm guessing that that bit of code erases all wounds, but doesn't actually do anything about the consequences of those wounds until a round of combat happens.

What I'm really trying for here is a script that either makes the dwarf take a Rest job, or gets another dwarf to rescue them. One thing I picked up on is that dwarves in this state have a negative unconsciousness count... I think.

I'm away from my DFHack resources, but recall that the status stuff is tracked in several places - both a wound and some body component data would record a severed part, for example. There are some unit flags to get the game to recalculate the body, nerve, insulation, etc. structures.

Would it be better to go into each unit.body.wound entry and heal the wounds rather than erasing them?

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5011 on: December 22, 2013, 09:36:53 pm »

I don't want them healed directly, I just want them to Rest so they can get medical treatment. There's an occasional issue with dwarves who are injured but don't fall unconscious and don't make their own way to a hospital bed. They're sort of active, since they'll climb out of water and respond to civilian alerts, but otherwise they'll lie around with No Job until they starve or dehydrate.

As I said above, knocking them out allows for Give Food / Give Water jobs. I haven't run the save for long after each script attempt to be sure, but I think a simple KO script will change the cause of death from starvation or dehydration to drowniness-induced insanity.

I've seen discussion of the issue a few times on the forums, but I can't find any of the topics or conversations about it. The usual method of solving it is to drop things on top of the dwarf until they get a hospital-worthy injury.

A script that runs once a month and makes creatures with <0 unconsciousness (this would seem to be the way of targeting only affected creatures) take a Rest job would be the neatest way of doing it, but I can't reverse-engineer the basic function from the 'Wake up -> Clean self' part of the fullheal script.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5012 on: December 23, 2013, 08:44:21 am »

Based on research I've done on older versions, adding the unit ID of a wounded dwarf to ui.unk230c might generate a "Rescue Wounded" job to bring them to bed and/or make them Rest. No guarantee that it'll work, but it's worth a try.
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.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5013 on: December 23, 2013, 09:24:51 am »

I've fixed that a couple of times by knocking a dwarf out by setting the unconscious timer to some huge number, then toggling a few of the healthcare flags off and on.  I think it was the rq_diagnosis and needs_recovery flags.  I seem to recall this was somewhat unreliable, and might depend on setting the flags in a certain order or stepping the game between flag sets or unsets.
Logged
Success requires no explanation.  Failure allows none.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5014 on: December 23, 2013, 02:13:50 pm »

Can anyone point me to the docs for trueTransform? I can't seem to find anything, and I really need to use it for the guild system I want to add to Better Dorfs.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5015 on: December 23, 2013, 03:42:03 pm »

Can anyone point me to the docs for trueTransform? I can't seem to find anything, and I really need to use it for the guild system I want to add to Better Dorfs.

https://github.com/peterix/dfhack#true-transformation

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5016 on: December 23, 2013, 04:17:16 pm »

Exactly what I wanted...

BTW: How come my version of the DFHack r3 readme lacks that? It came with trueTransform (at least I think it did)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5017 on: December 23, 2013, 07:43:47 pm »

Back to the healthcare script...

Spoiler (click to show/hide)
This seems to work, though I did have to remove the barracks bed the desired dwarf had been plonked in. Apart from the desired dwarf, it also catches a few other units: an armourer who was wounded in the same attack but received a crutch, a baby, and some animals. The armourer was brought to a bed after being knocked out.

I'd like to exclude the babies at least, just in case it messes with their healthcare once they grow into children. I've got the profession number for babies (97), but I can't figure out how to use it. I don't know what the script does with wounded invaders, so limiting it to the currently-played race would be good too.

There's a minor display issue in that it gives the red 'no unit selected in UI' message if it's run twice in succession. Not sure whether it's because there are no dwarves affected, or because there are no creatures affected. I can probably work that out by picking apart the fat-dwarves script.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5018 on: December 23, 2013, 07:47:36 pm »

It's because you included a completely superfluous local unit=dfhack.gui.getSelectedUnit() at the top.

Antalia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5019 on: December 24, 2013, 08:56:01 am »

I'm adding some more data to dwarfexport, and noticed a (probably minor) problem while I was working. The XML file written by dwarfexport claims to use 'ibm850' encoding, but that's not true if any dwarves' names contain common DF symbols. I think these are called "diacritics".

For example, "Edem" is a common dwarf name in my save data, but if diacritics are not removed, it is written "Edm" by the game, and subsequently printed that way in the XML file by dwarfexport. "Edm" isn't compatible with 'ibm850' encoding. So my XML viewer stops loading the XML and complains when it runs into that pesky "".

If I open the exported XML file in a plain text editor, and change the encoding string to 'ASCII', then my browser can properly read the XML file. (I think 'ASCII' is the most correct encoding. Maybe that should be a question...)

Should I correct the encoding string (from 'ibm850' to 'ASCII') in dwarfexport, while I'm in there? It's not a big deal - it's just confusing/annoying when I am using an XML viewer, and must manually change the encoding to 'ASCII' before the viewer will work.

Logged
Author of Saga of Nutscaves, a tale of unsafe working conditions, plague, and worse

Creator of Dwarf Organizer, a Java application to help assign labor in your fortress

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5020 on: December 24, 2013, 09:11:03 am »

Okay, I think this is good to go. Profession number for babies is actually 104, at least in 34.11.

Spoiler (click to show/hide)
Now it catches only the desired dwarf and the armourer. The armourer was injured in the same ambush, but ended up receiving medical care. She is knocked out, recovered, lies unconscious for a week, and then gets up and goes back to work.
« Last Edit: January 01, 2014, 06:55:09 pm by Sutremaine »
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Antalia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5021 on: December 24, 2013, 09:40:11 am »

I am adding a little data to dwarfexport (see above) and I am sorely tempted to fix something that has been driving me nuts for a long time:

When a dwarf lacks a middle name, dwarfexport writes the dwarf's first name twice in the XML <Name> attribute, followed by the surname(s).

For example, let's say you have nicknames set to [NICKNAME_DWARF:REPLACE_FIRST] or [NICKNAME_DWARF:CENTRALIZE] in d_init.txt. You have two dwarves, Urist Bistoksazir and `Bubbles' Zimeshinod (whose original first name was Zasit). You run dwarfexport. Dwarfexport writes <Name>Urist Urist Bistoksazir</Name> for Urist, and <Name>Zasit `Bubbles' Zimeshinod</Name> for Bubbles. (For completeness' sake, you'll get the same thing for Urist, and <Name>`Bubbles'</Name> for Bubbles, if your d_init.txt has the other nickname option, [NICKNAME_DWARF:REPLACE_ALL].)

I tentatively made a correction to dwarfexport, so that dwarves with no nickname just have their first name printed once in the <Name> attribute. So, Urist's record is always <Name>Urist Bistoksazir</Name>). (And, dwarves with nicknames behave exactly the same way as they do currently.)

BUT !

I don't know if anyone else is relying on dwarfexport's duplicated first names. (One of my applications relies very heavily on dwarfexport, but I don't know whether other DFHackers are using dwarfexport.) If anyone wants to keep the duplicate names, I will keep my hands off, and perhaps add a <CorrectName> attribute or something, that doesn't have first name duplication.

TLDR: Is anyone relying on duplicate first names, for dwarves lacking a nickname, in the <Name> attribute from dwarfexport?
Logged
Author of Saga of Nutscaves, a tale of unsafe working conditions, plague, and worse

Creator of Dwarf Organizer, a Java application to help assign labor in your fortress

darling

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5022 on: December 25, 2013, 06:38:58 am »

Is there a version of dwarf manipulator where the custom labours of ☼MASTERWORK-DF☼ are a used.
I just installed V.4 of MDF and I got the vanilla job descriptions...

I like dwarf manipulator more than Dwarf Therapist, because it is ingame. Therapist gets me distracted from the game a lil bit.
I am about to write a little extension for dwarf manipulator, so I wondered about this.
Logged

ab9rf

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5023 on: December 25, 2013, 10:27:06 am »

What exactly did you type? Was it "stripcaged all" or something more targeted? And what do you mean by "it doesn't work"? Does it not dump any items, or does it only dump some items?

I tried both, just stripcaged and stripcaged all, and it only dumps weapons and the bags that thieves have. Haven't gotten any soldiers in the traps yet though, so I don't know about things other than thieves.

I tested "stripcaged all" on a pair of goblin crossbowmen that were caught in cage traps, and got the following results:

Dumped:
Crossbows
Quivers
Bolts that were embedded in a wound

Not Dumped:
Clothing
Armor
Bolts in the quiver

Using DFHack r4
EDIT: and there is no visible change between the code in the .rb file from r3 to r4. Haven't tested r3 behavior.

THANK YOU for confirming what I was trying to tell you guys. Doing it the old fashioned way works fine at least.

For some reason, the version says r3, but since Urist Da Vinci says that this is r4 and I'm seeing the same behavior, I guess I'm using r4. However, the behavior is exactly the same as Urist Da Vinci saw, the clothes don't get dumped, but the weapons (and bags apparently) do. Also, I'm using LNP r41, which is still the latest right now.

I'll see if it dumps corpses in cages and things left in there from animal training when I get the chance.

Also, I used stripcaged all the time in the previous r3 version and I can tell you. It used to have a few options like stripcaged all, stripcaged items and a few others. The behavior in the old r3 is what the description says, when I do stripcaged all, it dumps everything inside the cages, corpses, weapons, clothes, armor, stuff from taming, everything. Previously it would give the list of options if you just type stripcaged, but now it doesn't.
There are two different things in DFHack called "stripcaged", a Ruby script that Falconne wrote that has been included since r3 I think, and a C++ plugin also called "stripcaged" that I wrote that has been included since r2.  My plugin was marked as "development" so it's not included in the default DFHack build, but some integrators may have added it to their builds.  Falconne's script is superior to my plugin in every conceivable way.

It's possible that the reason for the change in behavior is that you had been using the C++ plugin before and are now using the Ruby script.  Or vice versa.  If you're using the stock DFHack build you are using the script.  If you're using a DFHack build provided by an integrator, you'll have to talk to the integrator to find out which you have, as which you get depends on the build options selected by the integrator.  Or you can try typing "unload stripcaged"; if it doesn't give you an error, then you were using the C++ plugin.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5024 on: December 25, 2013, 10:28:39 am »

Is there a version of dwarf manipulator where the custom labours of ☼MASTERWORK-DF☼ are a used.
I just installed V.4 of MDF and I got the vanilla job descriptions...

I like dwarf manipulator more than Dwarf Therapist, because it is ingame. Therapist gets me distracted from the game a lil bit.
I am about to write a little extension for dwarf manipulator, so I wondered about this.
There is no custom version. Someone who knows C++ would have to compile it again, changing the labor and profession names to fit the naming scheme in MDF.

I would like to repeat a request that I have made before: A plugin for power-requirements for workshops. Similar to the steamengine, just the other way around. IndigoFenix just started brainstorming a tech/steampunk race, and it would come in super handy. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::
Pages: 1 ... 333 334 [335] 336 337 ... 373