Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 28 29 [30] 31 32 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457659 times)

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #435 on: February 06, 2012, 09:22:39 am »

Thanks for the response. Still I found no way to figure out how to, for example, make beds using stone boulders. I changed item-type 1 to BOULDER and item-material 1 to DIORITE but got a failure message in DF (not in the hack console) that there was no Diorite whereas my masons do not have this problem.
Also how can I make them using Logs for the reaction. I set item-material 1 (in the aforementioned bed creation) to CYPRESS and it would use cypress plant instead of logs. Where is my failure?

You can't expect to make the reaction take in whatever materials you want - this stuff is intended for tightening up the reagent filter where the built-in UI doesn't allow specifying the input materials with enough precision, e.g. for rock furniture & crafts. Everything else is at your own risk and dependent on the quirks of the implementation.

Cypress wood is "CYPRESS:WOOD"; "CYPRESS" is a shorthand for "CYPRESS:STRUCTURAL" in the raw syntax.

Also note that there is a bug in DF code that makes it ignore the precise subtype of creature or plant material unless the item type is also set.

P.S. Another example of a limitation: when an input reagent is intrinsically stored in a container, e.g. booze, leaves or flour for cooking, the technical reagent is the container, so you can't alter the selection of the contents at all. I.e. if you want to have booze or leaves cooked, you can set some reagents to require BARREL or BOX, and that's it.
« Last Edit: February 06, 2012, 09:46:08 am by ag »
Logged

thewonderidiot

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #436 on: February 06, 2012, 11:57:52 am »

What is the document format of the file exported by mapexport. Tried to open it with normal win editor but just got some weird stuff.

All of the weird stuff is because it's compressed with zlib, but even if you were to unzip it you wouldn't get much because it's a custom binary file format.  ;) Mapexport uses Google's Protocol Buffers to save its data (as a precursor to the interprocess API that will eventually use protobufs as well).

The messages I'm using can be found here in the DFHack repository. The method for writing them is as follows:

  • Write little endian unsigned 32-bit int 0x50414DDF to file (our file header, when stored as little endian appears as 0xDF 'MAP')
  • Write the varint-encoded 32-bit size of the "Map" message
  • Serialize the "Map" message to the file.
  • The rest of the file is just information directly from DF's blocks (16x16x1 groups of tiles). The "Block" messages are stored back-to-back, each prefixed with its size. So for each block:
    • Write the varint-encoded 32-bit size of the "Block" message
    • Serialize the "Block" message to the file

All of that is into a coded output stream with an underlying GzipOutputStream. I decided to zip it because DF map information is highly repetitive and simple zip gave me a compression ratio of 1/50.  :)

Reading it works almost exactly the same way. For some sample reading code, this is how I implemented mapexport file reading in my visualizer.

All that said, mapexport doesn't yet put out buildings, items, creatures, grass types, contaminants, and probably some other things, so it's still a work in progress. I don't foresee having to change the basic format (most of that information should fit happily inside either the map messages or the tile messages), but I can't quite guarantee that yet.  ::)
« Last Edit: February 06, 2012, 12:08:33 pm by thewonderidiot »
Logged

squishynoob

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #437 on: February 06, 2012, 02:18:02 pm »

For curiosity, what was used to get the addresses in Linux?

Is there a console command I can use to display the value of, or in general play with, the memory locations in offsets.log?
« Last Edit: February 06, 2012, 04:53:30 pm by squishynoob »
Logged

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #438 on: February 06, 2012, 04:48:07 pm »

This new stuff is fantastic! A few questions, though.
With 'fixwagons, fixdiplomats, and fixmerchants', are these changes persistent or would they have to be run each time you load your world?

Using workflow, does it understand that wood can be made into charcoal? There is no coal on my current map, and workflow has not given any jobs to my woodburner. It just kicked in. What is the name setting large pot production?

And do I need to redo my workflow settings each time I start DFhack or are the settings saved somehow? Thanks!


« Last Edit: February 06, 2012, 05:16:02 pm by BigFatStupidHead »
Logged

Aerval

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #439 on: February 06, 2012, 05:35:57 pm »

Spoiler (click to show/hide)
Thanks for the detailed answer. Just had a quick view into the unziped file now and got at least some less weird results ;)
Will have a look into it again when my exams are over
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.31.25 r9b
« Reply #440 on: February 06, 2012, 10:20:21 pm »

With 'fixwagons, fixdiplomats, and fixmerchants', are these changes persistent or would they have to be run each time you load your world?
They are permanent - you can run them in one fortress, and they will continue to be effective even after that fortress is destroyed/abandoned and you reclaim it or embark somewhere else (in the same world).
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.

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.31.25 r9b
« Reply #441 on: February 07, 2012, 03:26:34 am »

For curiosity, what was used to get the addresses in Linux?
Tools like IDA Pro, evan's debugger, gdb and a few others.
Is there a console command I can use to display the value of, or in general play with, the memory locations in offsets.log?
Nope. And you shouldn't do that because looking at invalid memory from the same process = crash :) offsets.log is almost the same thing as memory.xml, and that is now largely obsolete (and likely won't be even there in the next release). Everything is now generated from xml files from here: https://github.com/angavrilov/df-structures
To use the xml files for looking at DF data, you should use angavrilov's super cool GUI.

First, grab the DFHack sources using git, along with the submodules:
Code: [Select]
git clone git://github.com/peterix/dfhack.git
cd dfhack
git submodule init
git submodule update
Then go into library/xml/ and:
Code: [Select]
git clone git://github.com/angavrilov/cl-linux-debug.git
wget https://github.com/downloads/angavrilov/cl-linux-debug/sbcl-runtime.bz2
bzip2 -d sbcl-runtime.bz2

Now run DF in a second terminal and use something like htop or top in a third terminal to determine DF's PID.
Run ./start.sh from library/xml/, feed the program the PID number you got.

Now you can look at DF data, in a very awesome way, powered by LISP, which is totally hardcore ;) If you run into problems, visit us in the IRC channel.
* peterix hopes he didn't miss anything

And do I need to redo my workflow settings each time I start DFhack or are the settings saved somehow? Thanks!
The settings and on/off state should be saved as part of your world (it creates fake historical figures to store its data).  You may have to reset the settings manually when your fortress crumbles and you start a new one though.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.31.25 r9b
« Reply #442 on: February 07, 2012, 09:05:23 am »

* peterix hopes he didn't miss anything
Technically, you don't need to get all of DFHack - you just need df-structures:
Code: [Select]
git clone git://github.com/angavrilov/df-structures.git
cd df-structures
git clone git://github.com/angavrilov/cl-linux-debug.git
wget https://github.com/downloads/angavrilov/cl-linux-debug/sbcl-runtime.bz2
bzip2 -d sbcl-runtime.bz2
You'll also need to do `chmod +x sbcl-runtime`, otherwise it probably won't run.

Getting Dwarf Fortress's PID can also be done with `ps x` (with an optional ` | grep Dwarf` to filter out other stuff from your window manager).
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.

EngineerFromHell

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #443 on: February 07, 2012, 09:08:40 am »

I still don't get how to actually paint tiles with tiletypes. After I enter something like paint sh wall; paint m soil, what should I do next?
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.31.25 r9b
« Reply #444 on: February 07, 2012, 11:07:53 am »

Select the "k" cursor in-game, move it over the tile you want to update, then go to the DFHack console and just press Enter (just like with the Liquids tool).
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.

Silophant

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #445 on: February 07, 2012, 05:24:17 pm »

Maybe I'm just dumb, but I can't get the jobs plugin to work. Can someone give me the exact syntax for, say changing a stone statue's material to marble?
Logged

Steelweaver

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #446 on: February 08, 2012, 12:32:00 am »

Where i can find marerials id ? For example to change a log material from mapple to oak. Searching the dfhack sourcecode gives nothing  :(.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.31.25 r9a
« Reply #447 on: February 08, 2012, 12:35:19 am »

So any news on Fixed dwarf fortresses, Fixed elven fields, Fixed goblin towers?
You mean proper map generation for sites? I'd say wait for the next DF release.

Those sites have been confirmed to not be fixed in the next version. If they're not fixed, that means that proper map generation for them is even LESS possible for DFhack to do than it is in the current version.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #448 on: February 08, 2012, 01:42:53 am »

Where i can find marerials id ? For example to change a log material from mapple to oak. Searching the dfhack sourcecode gives nothing  :(.

How do you mean 'change a log material'? There is no command to change the material of an existing item, you can only change the input material constraints in jobs, e.g. to make beds only of oak.

Regarding the material and item tokens, dfhack uses the raw syntax:

http://df.magmawiki.com/index.php/Item_token
http://df.magmawiki.com/index.php/DF2010:Material_token

Except for the following modifications:

  • Instead of writing NONE as the subtype, you omit it.
  • You may omit the INORGANIC, CREATURE_MAT and PLANT_MAT prefixes if it doesn't result in ambiguity (e.g. due to there being a plant and creature with the same ID)
  • PLANT_MAT:FOO:STRUCTURAL may be abbreviated to just FOO
  • Currently there is no support for subtypes of COAL, METAL & STONE aliases for INORGANIC, USE_LAVA_STONE, etc.

Consequently, the oak wood material would be PLANT_MAT:OAK:WOOD, or just OAK:WOOD.
Logged

Steelweaver

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.31.25 r9b
« Reply #449 on: February 08, 2012, 03:37:49 am »

Where i can find marerials id ? For example to change a log material from mapple to oak. Searching the dfhack sourcecode gives nothing  :(.

How do you mean 'change a log material'? There is no command to change the material of an existing item, you can only change the input material constraints in jobs, e.g. to make beds only of oak.

Regarding the material and item tokens, dfhack uses the raw syntax:

http://df.magmawiki.com/index.php/Item_token
http://df.magmawiki.com/index.php/DF2010:Material_token

Except for the following modifications:

  • Instead of writing NONE as the subtype, you omit it.
  • You may omit the INORGANIC, CREATURE_MAT and PLANT_MAT prefixes if it doesn't result in ambiguity (e.g. due to there being a plant and creature with the same ID)
  • PLANT_MAT:FOO:STRUCTURAL may be abbreviated to just FOO
  • Currently there is no support for subtypes of COAL, METAL & STONE aliases for INORGANIC, USE_LAVA_STONE, etc.

Consequently, the oak wood material would be PLANT_MAT:OAK:WOOD, or just OAK:WOOD.

Thanks for reply, actually i mean a tool in dfusion wich allow item material editing, it says that for example a log lying on the ground has material id=420 (MAPPLE) when i change it to 421 i get log of "unknown frozen material substance". So actually i want an enum number for material.
Logged
Pages: 1 ... 28 29 [30] 31 32 ... 373