RimWorld

RimWorld

Custom Butcher Framework
 This topic has been pinned, so it's probably important
epicfloor  [developer] 17 Aug, 2022 @ 12:46am
Optional function explanation.
It seems the mod description has word limitation. The following functions will be explained here

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

Here is an example:
<modExtensions> <li Class="CustomButcherFramework.CustomButcherExtension"> <customButcherProducts> <Plasteel>30</Plasteel> <Steel>100</Steel> <RawPotatoes>100</RawPotatoes> </customButcherProducts> <spawnChance> <li>0.3</li> <li>0.9</li> </spawnChance> <maxAmount> <li>50</li> <li>120</li> </maxAmount> <productFluctuation> <li>30</li> <li>60</li> </productFluctuation> <wasteIfDamaged> <li>true</li> <li>false</li> <li>true</li> </wasteIfDamaged> <wasteIfNotAdult> <li>false</li> <li>true</li> </wasteIfNotAdult> <damagedBodyPartThreshold>0.8</damagedBodyPartThreshold> <damagedMultiplier>0.75</damagedMultiplier> </li> </modExtensions>
Overwhelming? Let me explain.

<customButcherProducts>
This is essential, the rest are optional, so if you just want normal butcher product that scales with body size you can ignore the following guide.

<spawnChance>
The corresponding butcher product have a chance to spawn(or not). You may noticed the code up here only has two number in <spawnChance> but 3 <customButcherProducts>, the unmatched item will always be 1.0(100%) chance to spawn. So In the example, you have 30% chance to get plasteel, 90% get steel and 100% get potatoes when you butchered this monstrosity.

Each value should be a float between 0.0~1.0.
The default value is 1.0(always spawn).

<maxAmount>
The corresponding butcher product will not exceed the maxAmount. This will not be affect by body size. The unmatched item will have no limit. In the example, you can get 50 plasteel and 120 steel at most, but you can get as many potatoes as you can.

Each value should be a positive integer.
The default value is 2147483647(maximum integer value).

<productFluctuation>
The corresponding butcher product will yield (-x~+x) things, this is add onto <customButcherProducts> so it will be affected by body size, damage condition, max amount and butcher efficiency. In example, you may get 0~50(maxAmount) plasteel, 40~120(maxAmount) steel and 100 potatoes if the animal size is 1.0.

Each value should be a positive integer.
The default value is 0(no fluctuation).

<wasteIfDamaged>
If true, the corresponding butcher product will be wasted if the corpse is damaged. The unmatched item will not be affected. In example, If the corpse is damaged, you won't get plasteel and precious potatoes.

Each value should be true or false.
The default value is false.

<wasteIfNotAdult>
If true, the corresponding butcher product will be wasted if the corpse didn't reach adulthood. The unmatched item will not be affected. In example, If the creature was butchered prematurely, you won't get steel

Each value should be true or false.
The default value is false.

<damagedBodyPartThreshold>
If the remaining parts is lower than the thershold, the corpse is considered damaged. In example, if the missing part is 20% and above, the corpse will be considered damaged.

The value should be a float between 0.0~1.0.
The default value is 0.99(any organ or limb missing will be considered violently murdered).

<damagedMultiplier>
If the corpse is damaged, the butcher product will multiplied by the number. In example is 75%.

The value should be a float between 0.0~1.0.
The default value is 0.66(same as vanilla)

With these functions, you can truly make a mimic out of this library.
Last edited by epicfloor; 17 Aug, 2022 @ 1:34am