Skip to content

Food Tracker (Partial Meals)

Choose a tag to compare

@Boarlock Boarlock released this 26 Aug 09:20
· 30 commits to master since this release

Mod Description

Ever had a pawn get interrupted 95% of the way through a lavish meal, only to watch the entire meal yield zero nutrition? Partial Meals fixes this vanilla quirk by granting pawns proportional nutrition based on how long they actually spent chewing before getting interrupted.

Installation instructions

Download the zip file. Open it and place the FoodTracker folder inside your Rimworld/Mods folder. 

Main features

Proportional Nutrition for Meals: If a pawn is interrupted while eating a single-item meal (Simple, Fine, Lavish, etc.), the remaining food isn't wasted. A custom tracking component saves the remaining nutrition directly to that specific food item.
Smart Resumption: When a pawn picks up a partially eaten meal (or batch food item(s)), the chewing duration is automatically reduced to match the remaining portion/nutrition available.
Batch Food Scaling: For bulk foods like Pemmican, Berries, or Raw Corn, the mod scales the stack count. If a pawn grabs 10 pieces, chews for half the duration, and gets interrupted, they consume 5 pieces and drop the remaining 5 back into the world.
Zero Bloat: Lightweight C# patches with minimal impact on performance.
Current Limitations & Caveats (v1.0)
Partially Eaten Meals Cannot Stack: To prevent RimWorld from merging a partially eaten meal into a fresh stack (which would erase its tracked nutrition data), meals with remaining nutrition are un-stackable. 
Visual Tracking: Currently, partial meals retain their standard item labels, (Partial) has been appended to their Description in game when you go to extra information. (Planned for a future update: UI/tooltip integration showing exact remaining percentages, e.g., "Fine Meal - 42% Remaining").

Requirements

Harmony - Hard Requirement, this mod will not work without it!

Compatibility & Mod Authors

Batch Foods: Works out-of-the-box with custom batch/bulk foods added by other mods, as long as they use standard vanilla stack/ingestible structures.
Custom Single Meals: Modded meals will function normally, but they require a quick XML patch to enable partial eating tracking.
How to Patch Your Custom Meals: If you want your mod's meals to support partial eating, add their
ThingDef, defName, label, description, graphicData, statBases, comps, etc..
 to
Defs/PartialNutritionComp.xml
inside this mod's folder.

<--Example Structure Inside .xml file -->
<ThingDef ParentName="MealCooked">
    <defName>InGame_defName/defName>
    <label>In-Game Name</label>
    <stackLimit>1</stackLimit>

    <description>Whatever you want the in game description to be.</description>

    <graphicData>
      <texPath>Things/Item/Meal/Simple</texPath>
      <graphicClass>Graphic_MealVariants</graphicClass>
    </graphicData>

    <statBases>
      <MarketValue>15</MarketValue>
      <WorkToMake>300</WorkToMake>
      <Nutrition>0.9</Nutrition>
    </statBases>

    <comps>
 <li Class="FoodTracker.CompProperties_PartialNutrition" /><!---For your meals to be compatible with this mod this component must be present!--->
      <li Class="Any custom components you might have for your meals" />
    </comps>
  </ThingDef>

Have feedback or run into an issue? Drop a comment below!