-
Notifications
You must be signed in to change notification settings - Fork 11
For modders: Making your mod compatible with Replimat
By default, Replimat is intrinsically compatible with nearly all third-party mods that add meal items.
However, modders wishing to fine-tune how Replimat interacts with their own mods may consult the guides on this page. While the Replimat mod is periodically updated with patches for popular third-party mods, it is preferable that mod authors ensure compatibility with Replimat on their end.
- How meal ingredient generation works
- Blacklisting meals
- Blacklisting meal ingredients
- Adding different survival meal types for batch replication
- Allowing hoppers to accept other items
- Examples
Once a pawn operating a Replimat Terminal randomly chooses a desired meal based on their own food restriction policy (or that of the patient/prisoner they are feeding), Replimat first checks whether the meal makes use of ingredients and has a recipe where the meal is the sole product.
If a valid recipe is found, meal ingredients are generated based on the recipe's allowed ingredient categories and/or fixed ingredients required. At this stage, humanlike and insectoid meats are usually excluded, as are any blacklisted ingredients. Any duplicate ingredients are also removed.
Next, if the intended eater pawn has an ideology, meal ingredients are selectively replaced depending on the associated precepts:
- Cannibals will have all other meats replaced with human meat
- Insect meat lovers will have all other meats replaced with insect meat
- Fungus preferred will have all other plant ingredients replaced with fungus
- Fungus despised will have any fungus removed
Finally, the compiled ingredient list is assigned to the meal being replicated.
Note: For Vanilla Cooking Expanded and its submodules, additional logic is used to:
- Limit meals to only have up to one condiment
- Look up recipes for cooked soups and stews (by identifying which uncooked equivalents they originated from)
If your mod contains meals that should never be replicated by Replimat Terminals (e.g. physically impossible to replicate, culturally protected, or should only available from your mod's cooking benches), you can add them to the Replimat Computer's internal disallowedMeals
blacklist in your mod's compatibility patch:
<!-- Example: Blacklist ruined grills from Vanilla Cooking Expanded, as they have no recipes and aren't possible to replicate in the first place anyway -->
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="ReplimatComputer"]/comps/li[@Class="Replimat.CompProperties_ReplimatRestrictions"]/disallowedMeals</xpath>
<value>
<li>VCE_RuinedSimpleGrill</li>
<li>VCE_RuinedFineGrill</li>
<li>VCE_RuinedLavishGrill</li>
<li>VCE_RuinedGourmetGrill</li>
</value>
</li>
If your mod contains ingredients that should never be used in any meal replicated by Replimat Terminals (e.g. physically impossible to replicate, limited availability, inappropriate), you can add them to the Replimat Computer's internal disallowedIngredients
blacklist in your mod's compatibility patch:
<!-- Example: For Vanilla Cooking Expanded:
- Blacklist canned ingredients, as Replimat conceptually makes food preservation irrelevant
- Blacklist resurrector mechanites, as they are meant to only be available as VCE quest rewards or trader inventory
-->
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="ReplimatComputer"]/comps/li[@Class="Replimat.CompProperties_ReplimatRestrictions"]/disallowedIngredients</xpath>
<value>
<li>VCE_CannedMeat</li>
<li>VCE_CannedProduce</li>
<li>VCE_CannedFruit</li>
<li>VCE_CannedAP</li>
<li>VCE_CannedFish</li>
<li>VCE_DigestibleResurrectorNanites</li>
</value>
</li>
Replimat Terminals come with a Batch Make Packaged Survival Meal gizmo, which allows players to replicate multiple survival meals for use in caravans and emergency stockpiles. By default, the only available type is the standard Packaged survival meal.
If your mod introduces new types of survival meals, you can add them to the Replimat Computer's internal batchReplicableSurvivalMeals
list in your mod's compatibility patch:
<!-- Example: Add UCF MREs and the UCF Humanitarian Daily Rations from Lethe - Lost Technologies of the United Colonial Federation mod to the list of survival meal types that can be batch replicated for emergency stockpiling
-->
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="ReplimatComputer"]/comps/li[@Class="Replimat.CompProperties_ReplimatRestrictions"]/batchReplicableSurvivalMeals</xpath>
<value>
<li>Lethe_SurvivalMealMilitary</li>
<li>Lethe_SurvivalMealCivilian</li>
</value>
</li>
If your mod contains new raw food items or other organic resources, you can add them to the Replimat Hopper's storage filters, so that they are converted into nutrient feedstock:
<!-- Example: Allow hoppers to process raw strange meat from the Call of Cthulhu - Cosmic Horrors mod -->
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="ReplimatHopper"]/building/fixedStorageSettings/filter/categories</xpath>
<value>
<li>ROM_StrangeMeatRaw</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="ReplimatHopper"]/building/defaultStorageSettings/filter/categories</xpath>
<value>
<li>ROM_StrangeMeatRaw</li>
</value>
</li>
Note that the conversion is based on the item's mass, so you can potentially write patches to allow Hoppers to recycle typically inedible or zero-nutrition organic resources (e.g. Wood Logs)
Further examples can be found in the mod's Patches directory.