Skip to content

Recipes Inheritance

KylianB edited this page Mar 3, 2022 · 2 revisions

This is a new DefModExtension, that you can add to any Thing with the Building_WorkTable class (or one that inherit from it). It will allow your Thing to inherit all the recipes (including modded ones) of the wanted other Building_WorkTable.

How to use this code?

Here is the simplest example (from Vanilla Furniture Expanded Production):

<modExtensions>
  <li Class="RecipeInheritance.ThingDefExtension">
    <inheritRecipesFrom>
      <li>TableMachining</li>
    </inheritRecipesFrom>
  </li>
</modExtensions>

It will make your bench inherit from all the recipes of the machining table.

Other xml tags you can use:

  • allowedProductFilter, allow only the recipes that produce a thing matching this filter
  • allowedRecipes, to only allow specific recipes
  • disallowedProductFilter, disallow all the recipes that produce a thing matching this filter
  • disallowedRecipes, to disallow specific recipes

Here is a more advanced example:

<modExtensions>
  <li Class="RecipeInheritance.ThingDefExtension">
    <inheritRecipesFrom>
      <li>FabricationBench</li>
    </inheritRecipesFrom>
    <allowedProductFilter>
      <categories>
        <li>Manufactured</li>
      </categories>
    </allowedProductFilter>
  </li>
</modExtensions>

It inherits all recipes of the fabrication bench that produce a thing of the manufactured category.

XML patch needed

You also need to add your work table to the list of the workgiver. Let's take the first example of this page. We now need to add our worktable to the Machining workgiver :

<Operation Class="PatchOperationAdd">
  <xpath>/Defs/WorkGiverDef[defName="DoBillsMachiningTable"]/fixedBillGiverDefs</xpath>
  <value>
    <li>**OUR worktable name here**</li>
  </value>
</Operation>

VFE Core

General Comp classes

General DefModExtensions

Item Processor

PipeSystem

Custom Structure Generation

Multi Verb Combat Framework - MVCF

Animal Behaviours

Genes

Apparel

Cuisine

Furniture

Plants

Deprecated

Clone this wiki locally