Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFHack help  (Read 715 times)

kahrkunne

  • Bay Watcher
    • View Profile
DFHack help
« on: October 25, 2014, 09:39:55 am »

Is there any way to delete a single unit with dfhack? I accidentally dropped a baby in my well. I could wait for it to drown, but then my well would get poluted.
Also what's the best way to learn all dfhack's commands?
EDIT: he died, and the well is not poluted, nice.
Anyways, the second questions still stands.
EDIT2: Or maybe (probably) he got out, cause I can't find a body.
« Last Edit: October 25, 2014, 09:43:24 am by kahrkunne »
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack help
« Reply #1 on: October 25, 2014, 10:31:59 am »

There is a dfhack thread in the utilities and third party tools, in case you didn't know, and there is a readme available through a link in the first post there. http://www.bay12forums.com/smf/index.php?topic=139553.0

More directly relevant, the only way to directly move a unit that I know of which isn't broken is the gui/gm-editor but it's a kind of dangerous tool as it lets you edit the values which the game uses to tell what everything is, so you can really break stuff playing with it.

On the other hand, pos is visible right at the top of it, and you can use it to directly move something, x being left/right, y is north/south, and z is the in/out (or up/down in game) axis.

If it's at the bottom of a single tile well which we'll say is three z deep, you'd change the position by x+1 and z+3 and he'd appear at the top to the right of the well. Be careful because you can put them inside a wall so don't unpause until you are sure they are on a safe tile.

Generally the readme and thread are good places to start.

You can also put the cursor in the dfhack console (or terminal if you launch from one as I do) and type ls or ls -a to get a list of commands/plugins/scripts, then you can use ls or man plus whatever command or plugin or script you're interested in to get some useful info, and several have help files as well.
« Last Edit: October 25, 2014, 10:34:28 am by Max™ »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack help
« Reply #2 on: October 25, 2014, 04:14:54 pm »

Keep in mind that modifying only a unit's position won't necessarily flag their old tile as unoccupied, which can lead to strange results when building and pathing (for example, in adventure mode, you'd need to crawl through the tile). There's a teleport script in recent versions of DFHack, which appears to handle these situations correctly.
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.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack help
« Reply #3 on: October 25, 2014, 05:19:46 pm »

Does it work right? I haven't had any luck but I was trying older ones I think.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack help
« Reply #4 on: October 25, 2014, 06:03:38 pm »

Ah, right. This pull request should fix it (to use it, you can replace hack/scripts/teleport.lua with this file).
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.