1.4 recipe ingredients aren't listed in preview

Started by Ralle1998, September 19, 2023, 04:46:00 PM

Previous topic - Next topic

Ralle1998

Hello everyone. I have a problem with the Rimworld 1.4 recipe preview. You know the little window that pops up if you hover over a crafting recipe in the workbench or tailoring bench etc. that shows you the ingredients and skill requirements.

The thing is that I have a recipe here that need a certain amount of jade, silver, gold and a certain amount of stone blocks of any kind.

<RecipeDef Name="TestItem" >
    <ingredients>
      <li>
        <filter><thingDefs><li>WoodLog</li></thingDefs></filter>
        <count>20</count>
      </li>
      <li>
        <filter><thingDefs><li>Jade</li></thingDefs></filter>
        <count>50</count>
      </li>
      <li>
        <filter><thingDefs><li>Gold</li></thingDefs></filter>
        <count>5</count>
      </li>
      <li>
        <filter><thingDefs><li>Silver</li></thingDefs></filter>
        <count>10</count>
      </li>
      <li>
        <filter>
            <categories><li>StoneBlocks</li></categories>
        </filter>
        <count>25</count>
      </li>
    </ingredients>
</RecipeDef>

I want that the player can deside which blocks can be used for the recipe. So I add the category into fixedIngredientFilter.

<RecipeDef Name="TestItem" >
    <ingredients>
      <li>
        <filter><thingDefs><li>WoodLog</li></thingDefs></filter>
        <count>20</count>
      </li>
      <li>
        <filter><thingDefs><li>Jade</li></thingDefs></filter>
        <count>50</count>
      </li>
      <li>
        <filter><thingDefs><li>Gold</li></thingDefs></filter>
        <count>5</count>
      </li>
      <li>
        <filter><thingDefs><li>Silver</li></thingDefs></filter>
        <count>10</count>
      </li>
      <li>
        <filter>
            <categories><li>StoneBlocks</li></categories>
        </filter>
        <count>25</count>
      </li>
    </ingredients>

    <fixedIngredientFilter>
      <categories>
        <li>StoneBlocks</li>
      </categories>
    </fixedIngredientFilter>

</RecipeDef>
   

This works, but now I have the problem, that only the blocks will be shown in the preview. Jade, gold and silver are still part of the recipe, but aren't shown in the preview, which is misleading. A way to fix that is to add silver, gold and jade into the fixedIngredientFilter.

    <fixedIngredientFilter>
      <categories>
        <li>StoneBlocks</li>
      </categories>
      <thingDefs>
        <li>Silver</li>
        <li>Gold</li>
        <li>Jade</li>
      </thingDefs>
    </fixedIngredientFilter>

Now it's shown in the preview, but now the player has the option to deselect gold, silver and jade, which I don't want them to do.

Is there a way to add gold, silver and jade into the preview without adding them into fixedIngredientFilter?