RimWorld
48 人が評価
Custom Butcher Framework
   
アワード
お気に入り
お気に入り
お気に入りから削除
Mod, 1.3, 1.4
ファイルサイズ
投稿日
更新日
335.338 KB
2022年8月13日 5時43分
2022年10月8日 7時04分
9 項目の変更履歴 ( 表示 )

サブスクライブしてダウンロード
Custom Butcher Framework

解説
This is a modding library, it adds no new content to game. But it provide a mod extension for customizing what your animal would yield when you butcher it.

Which means you can make mushroom man from dark souls, a luxurious breed of cattle that yield many different cuts and parts, even lithoid, a living rock that yield mineral when enslaved as livestock in Stellaris.

Why?
In vanilla, meat is auto generated by fleshDefs or something like that, I'm not Tynan nor a coding expert so I don't know exactly how it works. Anyway the meat from animals is hard-coded and its properties cannot be changed.

You might ask there are walking cactus in Alpha Animal and they yield plant meat which's considered as veggie and manchicken from VGE has cursetom crispy meat. They are harmony patched in a hard-coded way, basically they check if the defName of the butchered animal is matched, then they took the first <thing> in <butcherProducts> and calculated the result.

TL;DR, Vanilla expanded team also hard-coded those custom meat generation.

Why not just use <butcherProducts>
Using <butcherProducts> yield a constant amount of resource no matter what, a fully-grown beast would yield the same as a newborn cub. That doesn't make sense, right?

How to use?
Update, after further inspection, I finally figured out how to make it looks like vanilla <butcherProduct> tag, so you don't have to match number and ThingDefs, sorry in advance if this mess up your mod development

adding the following code to ThingDef:
<modExtensions> <li Class="CustomButcherFramework.CustomButcherExtension"> <customButcherProducts> <ThingDef1>NumberYouWant1</ThingDef1> <ThingDef2>NumberYouWant2</ThingDef2> <ThingDef3>NumberYouWant3</ThingDef3> . . </customButcherProducts> </li> </modExtensions>

There is an example:
<ThingDef ParentName="AnimalThingBase"> <defName>TestPig</defName> (labels, attributes, stats, etc.) <modExtensions> <li Class="CustomButcherFramework.CustomButcherExtension"> <customButcherProducts> <Steel>100</Steel> <Milk>200</Milk> </customButcherProducts> </li> </modExtensions> </ThingDef>
This mean this creature called testpig would yield 100*1.7(bodysize) = 170 steel and 200*1.7=340 milk when butchered, but a baby testpig would only yield 100*0.34 = 34 steel and 200*0.34 = 68 milk.
Also the library detect if the animal is violently murdered by checking if there's any part missing, such method is not perfect as your animal would be consider damaged if they missed some part before butchered by colonist, resulting crippled and cybernetic-enhanced animal yield much less resource.(BTW if you don't know, In vanilla if animals were not killed by butchering will yield 1/3 less meat and leather)
There is the full example def in mod file for how to use the extension, also the custom resource won't be display on pawn information.

Update! again
Don't worry, this time only adds some optional functions, which shouldn't mess up your mod.I add 6 different tags to the assembly:

<spawnChance>
<maxAmount>
<productFluctuation>
<damagedBodyPartThreshold>
<damagedMultiplier>
<wasteIfDamaged> new function since August 13
<wasteIfNotAdult> new function since August 17

These function would be explained in discussion section.

FAQ
Q1: Does the mod affect normal meat generation?
A: No, they can be used togather, if you want to create a wagyu that yield both normal meat and prime steak, you can do that.

Q2: How many custom resource can be put in the extension?
A: As many as your computer can handle.

Q3: How about vanilla <butcherProducts> tag?
A: Unchanged, you can use them together with the mod.

Q4: May I use the library to make my mods?
A: Yes, as long as you follow the CC license below and maybe share your mod in comment section.

Q5: CE?
A: I don't see anything that would break it as the mod only add a modExtension class in game, but seriously...

Credit

Tynan Sylvester, creator of Rimworld.

Brrainz for HarmonyLib.

Epicfloor for C# coding and example.

(CC BY-NC-ND 4.0)[creativecommons.org]



Would you like to make a donation? It will be greatly appreciated.
[ko-fi.com]
人気スレッド 全て表示 (1)
0
2022年8月17日 0時46分
ピン留め: Optional function explanation.
epicfloor
23 件のコメント
TurtleShroom 8月10日 10時50分 
The Mooshroom Mod needs this Mod. Do you have any plans on updating this?
ProfileName 5月16日 5時31分 
RimPy screams about this mod when you use "More Animal Products." You only need this mod if you're on 1.4, so.
heymegalodon 5月11日 3時59分 
Really needs 1.5 update
gunns22 4月29日 9時35分 
@epicfloor any news on the 1.5 update?
Fuzzy Pickles 4月26日 16時59分 
Hello, do you have plans on updating this to 1.5?
that bird guy 4月11日 23時31分 
1.5?
awdiaf 2023年6月10日 3時13分 
pansexual muffalo
epicfloor  [作成者] 2022年12月7日 8時44分 
It's only work on pawns probably, 'cause I use Harmony patched the butcherProduct method to produce custom products, unless you can somehow utilize butcherProduct method to 'butcher' something that is not a corpse, As for multiplicative part I'm not sure about that.
Holgast 2022年12月7日 1時12分 
dumb question - does this only work on animals? I wanted to use it like vanilla does for the any stone blocks recipe
Holgast 2022年12月7日 0時12分 
if not, no worries, I can fluff it with the output of the bulk recipe being the minimum, so if you want a chance at better stuff you can use the butcherproduct recipe