RimWorld

RimWorld

MendAndRecycle
Skyclops Mar 16, 2022 @ 2:07am
Where is the "Product output" Defined in the XML?
I am trying look at mods for reference so that I try out making my own. I was wondering where the Product is "output" in the XML it doesn't seem to be where I expected it to be which was under the RecipeDefs.

For example, the recycle apparel recipe. The product you receive is a certain amount of fabric. Is this based on the Remaining Hitpoints of the item? How do I produce an item effected by the remaining hitpoints in the ingredients.

Same goes for Mending, I see there is a chance for failure which just completely disassembles the apparel that you're trying to mend. Where is that information in the XML files? Or how can I add that to my own mod.
< >
Showing 1-1 of 1 comments
Fulmir Sep 13, 2022 @ 8:25pm 
Hey, not the author, but I ended up digging into this a bunch to try and figure out a weird mod interaction.

The outputs of recycling aren't defined in the XML, it's defined in code. What it does is goes and gets the "Thing" and calls a default Rimworld method called "CostListAdjusted" which returns the items under "costlist" in the thing *being recycled's* XML ThingDef. You can see the method here: https://github.com/notfood/RimWorld-MendAndRecycle/blob/1cb491ab4ee485be1252b78eeeafbe1a7342a64d/Source/JobDriverUtils.cs#L10

It removes anything with the component exclusive "intricate" tag and then returns everything else.

So the recipe output is basically set in the ThingDef for the item being recycled.
< >
Showing 1-1 of 1 comments
Per page: 1530 50