Recipes precise cost

Started by mrofa, January 02, 2015, 06:55:48 PM

Previous topic - Next topic

mrofa

So i kinda was wondering if there is a way to set precise cost in recipes to resources like silver or uranium,so when i enter a cost of 10 silver in recipe, it will cost 10 silver and not my entire retierment fund.
All i do is clutter all around.

Shinzy

hear hear!
this was bit of a bummer to my "Silverthread cloth" when I wanted balanced cost for it =P
1 silver equals 20
which is okay as the resource is really plentiful but it's still bit annoying not being able to set the precise cost you want

unifex

Afaik there's the "old" way and the "new" way (or what I call). The old way of using a RecipeDef still works i.e.

<ingredients>
         <li>
            <filter>
               <thingDefs>
                  <li>RawPotatoes</li>
               </thingDefs>
            </filter>
            <count>5</count>
         </li>
            <li>
                <filter>
                    <thingDefs>
                        <li>RawLeeks</li>
                    </thingDefs>
                </filter>
                <count>5</count>
            </li>
      </ingredients>

but I think with the new way of having the material defined in the Thing with stuffCategories and costStuffCount you can only specify the broad types and numbers. I prefer being able to specify it like the former too, but I see where its going with the latter. Kind of want both of those merged into one.


Asero

#3
Agreed. It can become very confusing and give the appearance that mods based on precise numbers aren't working correctly. I downloaded a mod that asked for 5 gold for a recipe until I finally managed to figure out it actually needed 800 gold :o

Dumb question: Will the use of increased numbers (for example above > 10) in recipes possibly make any difference to counter this?

mrofa

Im not sure what is a point of this system, but its damn annoying thrugh, hopfully tynan will have some fallow up for it.
All i do is clutter all around.

unifex

There's a volume calculation in there somewhere I think, so I suspect the volume of those goods is causing that.

Igabod

Ok I'm making a recipe for a cooked meal right now and just wanted to be sure I am understanding this correct. If I want to use 10 berries and 5 sugar and 1 olive oil I'd just have to make the ingredients portion look like this?


<ingredients>
         <li>
            <filter>
               <thingDefs>
                  <li>RawBerries</li>
               </thingDefs>
            </filter>
            <count>10</count>
         </li>
            <li>
                <filter>
                    <thingDefs>
                        <li>RawSugarCane</li>
                    </thingDefs>
                </filter>
                <count>5</count>
            </li>
            <li>
                <filter>
                    <thingDefs>
                        <li>OliveOil</li>
                    </thingDefs>
                </filter>
                <count>1</count>
            </li>
      </ingredients>


And if that's correct, what would I put in the fixedIngredientFilter and defaultIngredientFilter portions? Or do I even need those parts with the specified ingredients? There is a lot of confusing stuff in the recipes...

mrofa

fixedIngredientFilter i needed, pawn then knows what list of resources they can use.
As for default ones im not sure they are not needed in the recipe def
All i do is clutter all around.

Igabod

#8
Quote from: mrofa on January 13, 2015, 02:23:08 AM
fixedIngredientFilter i needed, pawn then knows what list of resources they can use.
As for default ones im not sure they are not needed in the recipe def

Ok, so would I just need to make those sections identical to the first part minus the count?

[edit to add] Ok I got it working now. For anybody in the future that is interested, here is what the full XML for a Cherry Pie using multiple ingredients with specific amounts looks like.


<RecipeDef>
<defName>CookPieCherry</defName>
<label>Cook Cherry Pie</label>
<description>Cooks a delicious cherry pie.</description>
<jobString>Cooking Cherry Pie.</jobString>
<workSpeedStat>CookSpeed</workSpeedStat>
<effectWorking>Cook</effectWorking>
    <soundWorking>Recipe_CookMeal</soundWorking>
    <allowMixingIngredients>true</allowMixingIngredients>
    <ingredients>
<li>
<filter>
<thingDefs>
<li>CherryFruit</li>
</thingDefs>
</filter>
<count>10</count>
</li>
<li>
<filter>
<thingDefs>
<li>RawSugarCane</li>
</thingDefs>
</filter>
<count>5</count>
</li>
<li>
<filter>
<thingDefs>
<li>OliveOil</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<products>
  <PieCherry>1</PieCherry>
</products>
<fixedIngredientFilter>
<thingDefs>
<li>CherryFruit</li>
<li>RawSugarCane</li>
<li>OliveOil</li>
</thingDefs>
</fixedIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>CherryFruit</li>
<li>RawSugarCane</li>
<li>OliveOil</li>
</thingDefs>
</defaultIngredientFilter>
<skillGains>
          <Cooking>100</Cooking>
</skillGains>
<recipeUsers>
  <li>CookStove</li>
</recipeUsers>
</RecipeDef>

Rikiki

There are 3 parts in the recipe:

  • <ingredients>: fixes the needed ingredients (it can include specific ThingDef like "RawPotatoes" or categories like "RawMeat")
  • <fixedIngredientFilter>: indicates the list of things the cook can take its ingredients from (usually the same as in <ingredients>)
  • <defaultIngredientFilter>: filter used to automatically select or deselect some ingredients from the <fixedIngredientFilter> (is for example used to remove human meat from meal by default! ;))
I hope it is clearer. :)

unifex

Quote from: Rikiki on January 13, 2015, 04:09:30 AM
There are 3 parts in the recipe:

  • <ingredients>: fixes the needed ingredients (it can include specific ThingDef like "RawPotatoes" or categories like "RawMeat")
  • <fixedIngredientFilter>: indicates the list of things the cook can take its ingredients from (usually the same as in <ingredients>)
  • <defaultIngredientFilter>: filter used to automatically select or deselect some ingredients from the <fixedIngredientFilter> (is for example used to remove human meat from meal by default! ;))
I hope it is clearer. :)

Its a good summary, but I wonder when you'd need a different 'fixedIngredientFilter' to the actual 'ingredients' ie if my recipes needs A, B and C, why would I have a fixedIngredientFilter of D, E and F?