Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 271 272 [273] 274 275 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1456303 times)

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4080 on: June 18, 2013, 02:24:16 pm »

Thanks, that did it.
Logged

catvanbrian

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4081 on: June 18, 2013, 07:01:18 pm »

(question for adventure mode dfhack) how do you catch and tame a animal?
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4082 on: June 18, 2013, 08:06:50 pm »

Hey memory editing types,

I found a bug(?) with [SHELL] having different physical properties in play from the ones defined in the raws. The properties I investigated were attack properties, but I'm pretty sure, anecdotally, that shell is also weaker for defense than its raws would indicate. Can one of y'all who knows how to navigate the whole "investigating memory while the game is running" thing check out what's going on?

No need, there is no bug: http://www.bay12forums.com/smf/index.php?topic=127386.msg4331393#msg4331393

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4083 on: June 19, 2013, 12:31:52 am »

Discovered the meanings of some more unknown vectors. These may be relevant to the healing script that crossmr was trying to write: http://www.bay12forums.com/smf/index.php?topic=91166.msg4297004#msg4297004 , in particular the body component severed and status flags.

See https://github.com/angavrilov/df-structures/blob/master/df.items.xml#L738
body_layer_328 is a 0-100 value indexed by nonsolid layer id. Initially 100 for all liquid, gas, etc. body part layers, it can be drained to 0 as the creatures lose material. I'd call it "percent fluid remaining". Used in fire men and iron men, among others.
body_layer_338 is normally 0 for each body part layer, but is 1 if the body part layer is severed (i.e. you can break away a layer without destroying the entire body part). It is also 2 if the body part layer is leaking (i.e. iron men), and 3 if the body part layer has completely leaked away (1+2=3).
body_layer_348 is the contact area of wounds on the body part layer. It seems to heal instantly to 0 outside of combat.
body_layer_358 is 100x the surface percentage of cuts/fractures on the body part layer. If you stab a dwarf with a contact area 50 weapon in a body part that has a calculated contact area of 80, the surface percentage of the wound is 63, so the corresponding value in body_layer_358 is 6300.
body_layer_368 is 100x the surface percentage of dents on the body part layer. It seems to heal instantly to 0 outside of combat.
body_layer_378 is 100x the surface percentage of "effects" on the body part layer (such as bruises, burns, frostbite, melting, freezing, necrosis, and blistering).

These are related to some of the wound data found here: https://github.com/angavrilov/df-structures/blob/master/df.units.xml#L1084

Also see this lua script that I wrote to explore the data:
Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

--printall(unit.body.components)
local lpart=""
local lname=""
local lid=""

for k,v in pairs(unit.body.components.body_layer_328) do
if true then
lid=unit.body.body_plan.nonsolid_layers[k]
lpart=unit.body.body_plan.layer_part[lid]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==lid then
lname=y.layer_name
end
end
print("FLUID LEFT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_338) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SEVER/LEAK",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_348) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("CONTACT AREA",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_358) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % DAMAGE",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_368) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % DENT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_378) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % EFFECT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_part_status) do
for kk,vv in pairs(v) do
if vv==true then
print("STATUS FLAG",kk,unit.body.body_plan.body_parts[k].name_singular[0].value)
end
end
end
Use it on creatures that are fighting in the arena and have wounds.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4084 on: June 19, 2013, 02:00:47 am »

(question for adventure mode dfhack) how do you catch and tame a animal?
Good question. That is almost uncharted territory. Generally i think you need to cage trap an animal, then having food use taming. I forget if i removed or left taming in.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4085 on: June 19, 2013, 03:06:56 am »

Discovered the meanings of some more unknown vectors. These may be relevant to the healing script that crossmr was trying to write: http://www.bay12forums.com/smf/index.php?topic=91166.msg4297004#msg4297004 , in particular the body component severed and status flags.

See https://github.com/angavrilov/df-structures/blob/master/df.items.xml#L738
body_layer_328 is a 0-100 value indexed by nonsolid layer id. Initially 100 for all liquid, gas, etc. body part layers, it can be drained to 0 as the creatures lose material. I'd call it "percent fluid remaining". Used in fire men and iron men, among others.
body_layer_338 is normally 0 for each body part layer, but is 1 if the body part layer is severed (i.e. you can break away a layer without destroying the entire body part). It is also 2 if the body part layer is leaking (i.e. iron men), and 3 if the body part layer has completely leaked away (1+2=3).
body_layer_348 is the contact area of wounds on the body part layer. It seems to heal instantly to 0 outside of combat.
body_layer_358 is 100x the surface percentage of cuts/fractures on the body part layer. If you stab a dwarf with a contact area 50 weapon in a body part that has a calculated contact area of 80, the surface percentage of the wound is 63, so the corresponding value in body_layer_358 is 6300.
body_layer_368 is 100x the surface percentage of dents on the body part layer. It seems to heal instantly to 0 outside of combat.
body_layer_378 is 100x the surface percentage of "effects" on the body part layer (such as bruises, burns, frostbite, melting, freezing, necrosis, and blistering).

These are related to some of the wound data found here: https://github.com/angavrilov/df-structures/blob/master/df.units.xml#L1084

Also see this lua script that I wrote to explore the data:
Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

--printall(unit.body.components)
local lpart=""
local lname=""
local lid=""

for k,v in pairs(unit.body.components.body_layer_328) do
if true then
lid=unit.body.body_plan.nonsolid_layers[k]
lpart=unit.body.body_plan.layer_part[lid]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==lid then
lname=y.layer_name
end
end
print("FLUID LEFT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_338) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SEVER/LEAK",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_348) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("CONTACT AREA",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_358) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % DAMAGE",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_368) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % DENT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_layer_378) do
if v ~= 0 then
lpart=unit.body.body_plan.layer_part[k]
lname=" "
for x,y in pairs(unit.body.body_plan.body_parts[lpart].layers) do
if y.layer_id==k then
lname=y.layer_name
end
end
print("SURF % EFFECT",lname,v,unit.body.body_plan.body_parts[lpart].name_singular[0].value)
end
end

for k,v in pairs(unit.body.components.body_part_status) do
for kk,vv in pairs(v) do
if vv==true then
print("STATUS FLAG",kk,unit.body.body_plan.body_parts[k].name_singular[0].value)
end
end
end
Use it on creatures that are fighting in the arena and have wounds.

I wasn't trying to write, just trying to fix up, I've done some programming, but haven't had the time to get into the scripting language here yet. What I am wondering is about nerve damage. I think my legendary hammerdwarf and that immigrant that showed up all wrecked, had nerve damage. I had another dwarf with regular injuries, who lost the ability to stand, I fixed him up and he's good. But the hammerdwarf and migrant just won't take. You fix them, they're good for a little while, but after a short time they lose the ability to stand again. I seem to recall that he hammerdwarf had a sensory nerve or something shot. it doesn't show up anymore. Is there anyway I can dump his body status beyond what is shown in the wound/health screen? Somewhat to check those sensory nerves to see if there is something wrong with them?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4086 on: June 19, 2013, 04:17:15 am »

Could somebody please bring me up-to-date with the current custom scripts?

I know of warmists startdwarf.rb, the growthfix, exportlegendsmaps, urist-da-vincis control of embark/tradegoods (even though I had no time at all to play around with it) and expwnents digging invaders. (again, no time so far)

Anything I missed that might be benefitial to the usual player, that might be useful in the Masterwork pack?
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 :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4087 on: June 19, 2013, 04:30:50 am »

Could somebody please bring me up-to-date with the current custom scripts?

I know of warmists startdwarf.rb, the growthfix, exportlegendsmaps, urist-da-vincis control of embark/tradegoods (even though I had no time at all to play around with it) and expwnents digging invaders. (again, no time so far)

Anything I missed that might be benefitial to the usual player, that might be useful in the Masterwork pack?
None of the scripts are mine actually ;)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4088 on: June 19, 2013, 05:39:08 am »

I only meant the startdwarf, the link I found mentioned it was yours. Is it jjyg ? I never seen that name before.

Try DFHack and this tiny script.  (Thank you, Warmist.)

This is how I found it. It does work nicely. :)
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 :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4089 on: June 19, 2013, 07:36:30 am »

I only meant the startdwarf, the link I found mentioned it was yours. Is it jjyg ? I never seen that name before.

Try DFHack and this tiny script.  (Thank you, Warmist.)

This is how I found it. It does work nicely. :)
Yes it's jjyg in github or jj`` in #dfhack afaik

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4090 on: June 19, 2013, 09:05:21 am »

Quote
New Power Meter plugin
    When activated, implements a pressure plate modification that detects power in gear
    boxes built on the four adjacent N/S/W/E tiles. The gui/power-meter script implements
    the necessary build configuration UI.

I just found this. Am I right to assume that this works as a simple power-to-signal converter? If it's a yes, then a BIG THANK YOU for whoever made this.

So, is it possible to modify other parameters of pressure plates with Dfhack? I ran into a limitation: the sensitivity of p.plates built on minecart tracks is 50 urists. Can it be modified to 10 urists?

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4091 on: June 19, 2013, 09:24:14 am »

...
Use it on creatures that are fighting in the arena and have wounds.

I wasn't trying to write, just trying to fix up, I've done some programming, but haven't had the time to get into the scripting language here yet. What I am wondering is about nerve damage. I think my legendary hammerdwarf and that immigrant that showed up all wrecked, had nerve damage. I had another dwarf with regular injuries, who lost the ability to stand, I fixed him up and he's good. But the hammerdwarf and migrant just won't take. You fix them, they're good for a little while, but after a short time they lose the ability to stand again. I seem to recall that he hammerdwarf had a sensory nerve or something shot. it doesn't show up anymore. Is there anyway I can dump his body status beyond what is shown in the wound/health screen? Somewhat to check those sensory nerves to see if there is something wrong with them?

See here: https://github.com/angavrilov/df-structures/blob/master/df.items.xml#L709

This lua script will detect if any body parts of the creature have status flags set, including motor/sensory nerves severed.
Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

for k,v in pairs(unit.body.components.body_part_status) do
for kk,vv in pairs(v) do
if vv==true then
print("STATUS FLAG",kk,unit.body.body_plan.body_parts[k].name_singular[0].value)
end
end
end

You can also use this:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.motor_nerve_severed=false
v.sensory_nerve_severed=false
end
or similar ruby code to repair all nerve damage stored at this location.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4092 on: June 19, 2013, 10:01:54 am »

...
Use it on creatures that are fighting in the arena and have wounds.

I wasn't trying to write, just trying to fix up, I've done some programming, but haven't had the time to get into the scripting language here yet. What I am wondering is about nerve damage. I think my legendary hammerdwarf and that immigrant that showed up all wrecked, had nerve damage. I had another dwarf with regular injuries, who lost the ability to stand, I fixed him up and he's good. But the hammerdwarf and migrant just won't take. You fix them, they're good for a little while, but after a short time they lose the ability to stand again. I seem to recall that he hammerdwarf had a sensory nerve or something shot. it doesn't show up anymore. Is there anyway I can dump his body status beyond what is shown in the wound/health screen? Somewhat to check those sensory nerves to see if there is something wrong with them?

See here: https://github.com/angavrilov/df-structures/blob/master/df.items.xml#L709

This lua script will detect if any body parts of the creature have status flags set, including motor/sensory nerves severed.
Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

for k,v in pairs(unit.body.components.body_part_status) do
for kk,vv in pairs(v) do
if vv==true then
print("STATUS FLAG",kk,unit.body.body_plan.body_parts[k].name_singular[0].value)
end
end
end

You can also use this:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.motor_nerve_severed=false
v.sensory_nerve_severed=false
end
or similar ruby code to repair all nerve damage stored at this location.

ah-ha. Okay. According to that, He has organ loss and organ damage to his lower spine. That would explain it. Anyway to restore that organ?

Tracked down that migrant, and he has the same thing.

Logged

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4093 on: June 19, 2013, 12:12:53 pm »

Nvm, found the answer!
« Last Edit: June 19, 2013, 11:07:53 pm by VerdantSF »
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4094 on: June 19, 2013, 02:07:53 pm »

Could somebody please bring me up-to-date with the current custom scripts?

I know of warmists startdwarf.rb, the growthfix, exportlegendsmaps, urist-da-vincis control of embark/tradegoods (even though I had no time at all to play around with it) and expwnents digging invaders. (again, no time so far)

Anything I missed that might be benefitial to the usual player, that might be useful in the Masterwork pack?

There is also unit-info-viewer for age, grazing, shearing products, milking products, and body size.  I think I need to add egg layer in the next update.

EDIT:  updated to add egg laying info, remove body size calc because it isn't needed anymore, and a few other little things.  Also forgot to mention that unit-info-viewer is also useful for providing a unit context to other selected unit scripts/mods/plugins such as the set nickname or set custom profession because unit-info-viewer gets the selected unit from more places than dfhack.gui.getSelectedUnit() currently supports.
« Last Edit: June 19, 2013, 05:11:05 pm by Kurik Amudnil »
Logged
Pages: 1 ... 271 272 [273] 274 275 ... 373