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일 오전 12시 46분
고정됨: Optional function explanation.
epicfloor
댓글 23
TurtleShroom 2024년 8월 10일 오전 10시 50분 
The Mooshroom Mod needs this Mod. Do you have any plans on updating this?
ProfileName 2024년 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 2024년 5월 11일 오전 3시 59분 
Really needs 1.5 update
gunns22 2024년 4월 29일 오전 9시 35분 
@epicfloor any news on the 1.5 update?
Fuzzy Pickles 2024년 4월 26일 오후 4시 59분 
Hello, do you have plans on updating this to 1.5?
that bird guy 2024년 4월 11일 오후 11시 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일 오전 12시 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