Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 144 145 [146] 147 148 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1459213 times)

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2175 on: July 16, 2012, 02:02:59 pm »

Does anyone know what these values mean?

If somebody knew, they wouldn't've been called "unk" and "anon" - well, unless somebody does know, but keeps mighty quiet about it ;)
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2176 on: July 16, 2012, 03:52:24 pm »

oh heh... it appears yet another thing from dfusion is outdated :<
maybe this could be useful (maybe more so for ag)
Code: [Select]
ptr_subitems["item_eggst"]={}
ptr_subitems["item_eggst"].race={off=0x78,rtype=DWORD}
ptr_subitems["item_eggst"].isfertile={off=0xa0,rtype=DWORD} --0 or 1
ptr_subitems["item_eggst"].hatchtime={off=0xa4,rtype=DWORD}
unfortunately I'm not sure for witch version it is... I guess for some of the older ones... Also offsets are from start of class. But i guess if race=0 (from xmls)
so it should be:
Code: [Select]
race=0 -- from xmls
isfertile=0x28
hatchtime=0x2c
Also i find it quite strange that there is no pointer to traits that is needed for pregnancy... It should be there somewhere.

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2177 on: July 16, 2012, 04:53:56 pm »

So, in this fashion:

[lua]# print(df.item_type[5])
WOOD

[lua]# print(df.item_type.WOOD)
5

What is the reverse syntax (if any) for:

[lua]# print(dfhack.matinfo.decode(421,41))
<material 421:41 PLANT:GRASS_TAIL_PIG:SEED>

?  I've tried a few variations, but can't get any results, if it is similar.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r1
« Reply #2178 on: July 16, 2012, 05:43:34 pm »

Try this:
Code: [Select]
[lua]# ~dfhack.matinfo.find("PLANT:GRASS_TAIL_PIG:SEED")
<material 421:41 PLANT:GRASS_TAIL_PIG:SEED>
index                    = 41
material                 = <material: 0x0a358680>
plant                    = <plant_raw: 0x0a3574b8>
type                     = 421
mode                     = plant
subtype                  = 2
« Last Edit: July 16, 2012, 05:45:23 pm by Quietust »
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.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2179 on: July 16, 2012, 05:48:47 pm »

Unfortunately not for adventure mode. The actual eating and crafting is ethics I believe, but you have to be starving to butcher sentients or you get the message "You are not hungry enough for that."
wellllll it gets tricker but I think you can write up an adventure interaction that removes their can_speak tag so you can butcher them easily.
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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2180 on: July 16, 2012, 06:36:14 pm »

feature requests:

sort rooms (R) command by unit name

also...

sort inventory menu by item name

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2181 on: July 16, 2012, 11:16:04 pm »

Try this:
Code: [Select]
[lua]# ~dfhack.matinfo.find("PLANT:GRASS_TAIL_PIG:SEED")
<material 421:41 PLANT:GRASS_TAIL_PIG:SEED>
index                    = 41
material                 = <material: 0x0a358680>
plant                    = <plant_raw: 0x0a3574b8>
type                     = 421
mode                     = plant
subtype                  = 2

Perfecto, that'll do the job.  Thanks, Quietust.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2182 on: July 17, 2012, 04:26:44 pm »

vjek, have you updated your scripts yet?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2183 on: July 17, 2012, 06:19:49 pm »

vjek, have you updated your scripts yet?
If you mean for 34.11, yep, did that on July 4th.  They're on the wiki now, and all updates will be there from now on.

Altaree

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2184 on: July 18, 2012, 09:47:32 am »

I am trying to check the status of some eggs. 
When I try this:
Code: [Select]
printall(item.unk_cc)I get
Code: [Select]
--------------------unk_cc
anon_1                   = -1
anon_2                   = -1
anon_3                   = -1
anon_4                   = -1
anon_5                   = -1
anon_6                   = -1
anon_7                   = 0

Across many eggs only anon_7 changes from 0 to -1.

After a bit of testing, only eggs with anon_7 == -1 hatch.
Logged
Dan Pearson:
This is a game which calculates the volume of blood in every creature it generates so it knows how much alcohol it would have to consume to get drunk, an update which, remarkably, ended up covering people's fortresses in cat vomit.

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2185 on: July 18, 2012, 11:30:33 am »

Heh I'm completely new to lua and am only mildly experienced in Python as my only programming background, but I've been spending a couple days straining my eyes decoding these structures and figuring out why stuff works and what doesn't.  Anyway, finally got a working command to change all your clothing on all your dwarves to 0 wear.

Code: [Select]
--THIS WILL SET ALL YOUR DWARVES' EQUIPMENT TO NO WEAR
for k,v in ipairs(df.global.world.items.all) do
if v.flags.owned and (v:getType() >= 25 and v:getType() <= 29 or v:getType() == 58) then
v:setWear(0)
v.wear_timer = 0
end
end

The conditionals for item type checks might not be strictly necessary for wear alone, but I was also tweaking with item quality which breaks on some quality-less item types. But the script here only resets wear and the incrementing timer. If you want max-quality equips too, just add v:setQuality(5) after the wear_timer line.

Note: I don't know how to make it so the equipment doesn't wear ever.  Probably like the modest mod does with setting armor quality to a certain level but this works for me.

Someone else posted a snippet here that did the wear stuff one item at a time so I just had to figure out how to iterate it :P. I think I got the feel for some of it now though.  Thank goodness. Maybe now I can actually play :P.
Just wanted to mention, this has been working well, with one small bug.  Item type 58 is for TOTEMS, while 59 is for PANTS.  I suspect it was just a typo.  In any case, I noticed only the trousers on my dwarves were wearing out, and tracked this down.  Changing the last type from 58 to 59 solved the problem.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2186 on: July 18, 2012, 01:48:30 pm »

Just wanted to mention, this has been working well, with one small bug.  Item type 58 is for TOTEMS, while 59 is for PANTS.  I suspect it was just a typo.  In any case, I noticed only the trousers on my dwarves were wearing out, and tracked this down.  Changing the last type from 58 to 59 solved the problem.

Why use any magic constants, when there are df.item_type.PANTS etc? ;)

Also, I believe setWear actually resets the timer field too - I saw something like that in its disassembly.
« Last Edit: July 18, 2012, 01:52:35 pm by ag »
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2187 on: July 18, 2012, 04:25:40 pm »

Is there a quickstart guide to the language DFHack uses? I'd like to add a variable to the rejuvenate function so that I can use it on animals without editing the .lua file each time.
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.

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.34.11 r1
« Reply #2188 on: July 18, 2012, 05:46:36 pm »

Is there a quickstart guide to the language DFHack uses? I'd like to add a variable to the rejuvenate function so that I can use it on animals without editing the .lua file each time.
Here's one: http://luatut.com/crash_course.html

I'm sure there's more to be found around the net too. Just google for them ;)

The DFHack-specific extensions over base LUA are documented here: https://github.com/peterix/dfhack/blob/master/LUA_API.rst

Hanslanda

  • Bay Watcher
  • Baal's More Evil American Twin
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2189 on: July 18, 2012, 11:07:43 pm »

Is DFusion not updated for .34.11 yet? When I try to use it, I get errors. One moment and I'll post the exact errors.

Okay, typed in 'dfusion' sans apostraphes, and it gives me this:

Spoiler (click to show/hide)
« Last Edit: July 18, 2012, 11:12:59 pm by Hanslanda »
Logged
Well, we could put two and two together and write a book: "The Shit that Hans and Max Did: You Won't Believe This Shit."
He's fucking with us.
Pages: 1 ... 144 145 [146] 147 148 ... 373