Making a new meal, nutrition plus another item

Started by WraithCadmus, February 11, 2017, 08:05:18 AM

Previous topic - Next topic

WraithCadmus

Hello, first-time modder trying to make a meal which needs nutrition plus another non-food item.

The problem I'm having (as I mostly just copy-pasted Simple Meal) is that the non-food ingredient is in some sort of filter, and I guess it's this line

<ingredientValueGetterClass>IngredientValueGetter_Nutrition</ingredientValueGetterClass>

So this makes all ingredients need a nutrition value, right? How do I 'break out' of this filter or reset it so I can have my non-food ingredient be a normal item?

Full RecipeDef below

  <RecipeDef>
    <defName>CanFood</defName>
    <label>can food</label>
    <description>Heat and preserve food in a can. Time-consuming and uses more ingredients to compensate for losses in the process.</description>
    <jobString>Canning food.</jobString>
    <workSpeedStat>CookSpeed</workSpeedStat>
    <requiredGiverWorkType>Cooking</requiredGiverWorkType>
    <effectWorking>Cook</effectWorking>
    <soundWorking>Recipe_CookMeal</soundWorking>
    <recipeUsers>
        <li>ElectricStove</li>
        <li>FueledStove</li>
    </recipeUsers>
    <workAmount>1000</workAmount>
    <allowMixingIngredients>true</allowMixingIngredients>
    <ingredientValueGetterClass>IngredientValueGetter_Nutrition</ingredientValueGetterClass>
    <ingredients>
      <li>
        <filter>
          <categories>
            <li>FoodRaw</li>
          </categories>
        </filter>
        <count>0.6</count>
      </li>
      <li>
        <filter>
          <thingDefs>
            <li>FreshCan</li>
          </thingDefs>
        </filter>
        <count>1</count>
      </li>
    </ingredients>
    <fixedIngredientFilter>
      <categories>
        <li>FoodRaw</li>
      </categories>
      <disallowedSpecialFilters>
        <li>AllowPlantFood</li>
      </disallowedSpecialFilters>
    </fixedIngredientFilter>
    <defaultIngredientFilter>
      <categories>
        <li>FoodRaw</li>
      </categories>
      <exceptedCategories>
        <li>EggsFertilized</li>
      </exceptedCategories>
      <exceptedThingDefs>
        <li>Human_Meat</li>
        <li>Megaspider_Meat</li>
      </exceptedThingDefs>
    </defaultIngredientFilter>
<products>
<FilledCan>1</FilledCan>
</products>
    <workSkill>Cooking</workSkill>
  </RecipeDef>


</RecipeDefs>

Fishbrains

Check the item cost for a gun they should specifically require components. I'd just post the code but I'm at work it's something like

<itemCost>
<Component>3 </Component>
</itemCost>


WraithCadmus

A good idea, but it doesn't seem to make a difference, I guess either the costList tag isn't appropriate for meals, or having the recipe defined twice (sort of?) is causing one of them to be ignored.

Fishbrains

Weird it should all be the same recipieDefs. Maybe try removing one of the recipies to make sure it's working? Also try making it only cost the specific item to make sure that's working.

Besides that you might be able to download the advanced cooking mod to see if they managed it.