Possible to butcher/craft with specific animal corpse?

Started by Distman, June 11, 2017, 08:06:04 PM

Previous topic - Next topic

Distman

I want to add a custom job bill to crafting spot that let's you harvest organs from Boomrat corpses - is it possible?`
All i find is Animalcorpses... But nothing specific to animal race.

Question 2: is it possible to add an animal corpse in a crafting recipe? Had no luck, don't know if i reference it wrong... "Materials needed" blah blah

Shinzy

you can use corpses as crafting ingredient, their defname should be something like "Boomrat_corpse"
(one way to check those is to open your savefile where there is animal corpses present, in the savefile it'll be listed by it's defname.)

Distman

Thanks dude! "Boomrat_Corpse" worked fine.  :)
Strange that the reference is only found in translations.

Distman

Follow up question... Would it be possible to enable an operate job on a specific race of animals (Boomrat)?
I have made these Sleep Grenades and want to make a "harvest boom organ" operation job on just the boomrats. You know, before they go boom...

kaptain_kavern

#4
Have a look in your Core folders in Core/Defs/RecipeDefs/Recipes_Surgery.xml
 

For recipes that remove body part. For this to work you would also need to
- create the natural bodypart (I mean the actual dropped item) - Have a look in Core/Defs/ThingDefs_Items/Items_BodyParts.xml
- create the body bodypart ( This time I mean the part of the body - this are 2 distinct things for the game) and create a modded body for your boom rats (in which you will include the previous "body bodypart"
- "tell the game" that boomrats should use your modded body (create in the previous step)

I'm on my phone right now, can't elaborate more :-)

jamaicancastle

Quote from: Distman on June 11, 2017, 09:16:22 PM
Thanks dude! "Boomrat_Corpse" worked fine.  :)
Strange that the reference is only found in translations.

The reason for this is that a number of derivative defs are code-generated. What that means is that instead of having to spell out separate defs for each animal corpse, or each type of leather or whatnot, the game uses a couple of unique tags on each animal's def to quickly generate its corpse, leather, meat and the like.

Distman

Quote from: jamaicancastle on June 12, 2017, 11:02:40 AM
The reason for this is that a number of derivative defs are code-generated. What that means is that instead of having to spell out separate defs for each animal corpse, or each type of leather or whatnot, the game uses a couple of unique tags on each animal's def to quickly generate its corpse, leather, meat and the like.

Ah, makes sense! Thanks for the info.

Fregrant

#7
Also, there is <butcherBodyPart> tag in race defs for getting specified item on butcher. For example, thrumbo and elefant.
And yes, as I see game adds _corpse to all the corpses, Core or not. So Elefant_corpse or Megasuperalien_corpse should work.
On the operation, as KK said plus create a recipe for actual operation. Note - to add the operation on specific races, would be good to use <recipeUsers> tag too.

Distman

So when making a modded animal, do i keep the DefName, or should it be unique? This should replace the core def, am i right?

So far i have made:
Two Boomrat Organ defs. One version for bodypart and one for item.
Made a modded version of quadruped animal body that includes the new bodypart.
Made a modded version of Boomrat that uses this new body.

However, i'm getting this error message that deactivates the mod.
"Could not resolve cross-reference: No Verse.BodyPartDef named ALCHEMY_BoomratOrganBodypart found to give to Verse.BodyPartRecord BodyPartRecord(NULL_DEF parts.Count=0)"

Distman

And of course i made two ThingsDefs instead of one thingsdef and one BodyPartDef...
Now that works.

Now i just need to get that surgery in place.
Then the removing of explode on death when organ is harvested. No more booms please!