Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: DFHack : CreateItem - Animal Bone?  (Read 11019 times)

Geoclasm

  • Bay Watcher
    • View Profile
DFHack : CreateItem - Animal Bone?
« on: September 07, 2016, 06:26:15 pm »

I have a dwarf with a strange mood requiring an animal bone. I really don't want to butcher any of my livestock just for a single bone ( I mean, I will if I HAVE to but I'd really rather NOT if at all possible ).

Is there any way with DFHack to create an animal bone using the CreateItem command? Like, say, a DRAGON bone? ( haha I'd settle for a COW bone really ).
Logged
99 little bugs in the code. 99 little bugs.
Take one down, patch it around.
117 bugs in the code.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack : CreateItem - Animal Bone?
« Reply #1 on: September 07, 2016, 09:22:01 pm »

It can't be done with createitem - animal bones are body parts, and custom reactions (the underlying mechanism behind createitem) are not capable of synthesizing body parts.

You might be able to write a custom Lua script to manually construct an "item_corpsepiecest" and fill in all of the fields with correct values, but I don't know exactly what those values are (you'll have to examine one created by the game itself to see what's correct).
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.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #2 on: September 07, 2016, 11:09:05 pm »

So, to review...

Steps to acquire a cow bone:

1. Acquire a cow bone.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #3 on: September 08, 2016, 01:20:43 am »

So, to review...

Steps to acquire a cow bone:

1. Acquire a cow bone.
Imho: kill a cow and butcher it is way easier.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack : CreateItem - Animal Bone?
« Reply #4 on: September 08, 2016, 02:50:11 am »

So, to review...

Steps to acquire a cow bone:

1. Acquire a cow bone.

Actually, why don't we have a 'clone' script? create-item is somewhat difficult to use if you just want "more of this".

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack : CreateItem - Animal Bone?
« Reply #5 on: September 08, 2016, 10:20:32 am »

you can use createunit to spawn a pet, then butcher it. Thats the only way with dfhack to get body parts like bones.
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #6 on: September 08, 2016, 12:42:28 pm »

Is it possible to butcher a corpse with a script? I know create-unit uses code from the arena to spawn a creature. There is also the arena butchering. You could theoretically make a script that spawns a creature, kills it (blood = 0), butchers it, then erases all non-bone items.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #7 on: September 08, 2016, 01:47:24 pm »

Is it possible to butcher a corpse with a script? I know create-unit uses code from the arena to spawn a creature. There is also the arena butchering. You could theoretically make a script that spawns a creature, kills it (blood = 0), butchers it, then erases all non-bone items.
At that point, it's easier to create the bone.
I'm sure someone could edit this to work: https://gist.github.com/warmist/8450238
This of course is too complicated - it both removed the heart from the unit and then creates the heart item and places it on ground. So the first part is not needed and the second part can probably be simplified to not use historical id and so on...

Roses

  • Bay Watcher
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #8 on: September 08, 2016, 04:58:01 pm »

True, but I'd still be interested to see if we could butcher creatures with a script. It could have some interesting uses.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #9 on: September 09, 2016, 11:50:50 am »

Slaughtering units is one of the only tasks that is hardcoded so it only works at a specific workshop. A DFHack script that can determine butcher results from a living creature would be very valuable for those of us who want to remove all vanilla content.

I just assumed it would be too hard to do and left the vanilla butcher shop in.
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

Roses

  • Bay Watcher
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #10 on: September 09, 2016, 12:09:24 pm »

Thats why I was thinking of using the arena mode butcher. create-unit switches game type to arena mode to create the unit, I'd think it would be possible to butcher a creature using the same technique, but I don't really understand how it works, otherwise I would give it a try.
Logged

Sanctume

  • Bay Watcher
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #11 on: September 12, 2016, 04:41:27 pm »

I am anticipating the time I can create-item some dragon bone to stud my armory.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #12 on: September 12, 2016, 04:51:47 pm »

Thats why I was thinking of using the arena mode butcher. create-unit switches game type to arena mode to create the unit, I'd think it would be possible to butcher a creature using the same technique, but I don't really understand how it works, otherwise I would give it a try.
DFHack can invoke some DF routines that happen to be implemented as vmethods.  I have no idea if arena mode butchering is or not, but there is a distinct possibility that it's simply not possible.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Roses

  • Bay Watcher
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #13 on: September 12, 2016, 08:15:24 pm »

So I was able to butcher a unit in DFHack by following create-unit's work flow and switching the game_type to df.game_type.DWARF_ARENA and then butchering by simulating input. The only two things that are an issue now are, how do you select a tile with a corpse on it so that you can simulate the input, and how do you select the corpse on the tile if there are other things there as well?
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack : CreateItem - Animal Bone?
« Reply #14 on: September 13, 2016, 11:42:51 am »

Could you teleport the corpse to a known empty tile and do your stuff there? As for selecting the tile... Not sure, sorry.
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
Pages: [1] 2