Help - New Meal Type

Started by milon, November 05, 2015, 06:27:17 PM

Previous topic - Next topic

milon

This was going to be a surprise, but I've been quietly learning how to mod RimWorld (VERY beginner level right now!), and I'm trying to update JuliaEllie's Canned Food mod to A12.

It keeps throwing a "MealCanned has null thingClass" error when I load mods, and when I've tried to play with it, the pawns refuse to create a Canned Food meal (for "lack of ingredients").  I strongly suspect the problem is with the new Item I'm creating; the recipe seems to be fine, and I can't test the new thoughts yet.

EDIT - I've done some balance tweaking, and maybe tried to change too many things at once.  The new meal "Canned Food" is supposed to be edible on its own, or be able to be used as an ingredient.

I've compared it to several different A12 mods and I really can't figure out what's broken.  Please see the attached zip file and tell me what I'm b0rking up.  Thanks!

[attachment deleted due to age]

SlimeCrusher

Missing "MealBase" parent.
Don't panic, just add this on your "Items_CannedFood":
  <ThingDef Name="MealBase" Abstract="True">
    <label>meal</label>
    <thingClass>Meal</thingClass>
    <category>Item</category>
    <useHitPoints>true</useHitPoints>
    <selectable>true</selectable>
    <statBases>
      <MaxHitPoints>50</MaxHitPoints>
      <Flammability>1.0</Flammability>
    </statBases>
    <altitudeLayer>Item</altitudeLayer>
    <stackLimit>10</stackLimit>
    <tickerType>Rare</tickerType>
    <description>"Meal lacks desc."</description>
    <socialPropernessMatters>true</socialPropernessMatters>
    <thingCategories>
      <li>FoodMeals</li>
    </thingCategories>
    <alwaysHaulable>true</alwaysHaulable>
    <comps>
      <li>
        <compClass>CompForbiddable</compClass>
      </li>
    </comps>
    <pathCost>15</pathCost>
    <resourceReadoutPriority>Last</resourceReadoutPriority>
    <drawGUIOverlay>true</drawGUIOverlay>
    <ingestible>
      <maxNumToIngestAtOnce>1</maxNumToIngestAtOnce>
    </ingestible>
  </ThingDef>

I haven't tested it but it should work. Remember to keep the parents on each on your xml files, they are necessary to make it work :P

milon

LOL, whoops, not sure how I lost that part.  ;D
There were a couple other bugs, but it's functional now!  Thanks!