Adding Recipies?

Started by Adam561, March 09, 2014, 12:06:52 AM

Previous topic - Next topic

Adam561

I am trying to add a recipe to a custom workbench that I added, How do I setup the Materials required and count? Note: I need to use 20 metal and 2 Uranium for the recipe

Help!
==Adam561==
==Mod Author and Designer==
==RimWorld==
www.adam561mods.webs.com

Nasikabatrachus

I'm not sure exactly what you need, so here's an example of a workshop and the recipes it uses.

This would go in the ThingDefs folder:


<?xml version="1.0" encoding="utf-8" ?>
<Buildings>
<ThingDef ParentName="BuildingBase">
<DefName>ElecWorkshop</DefName>
<EType>Building_WorkTable</EType>
<Label>Electronics Workshop</Label>
<ThingClass>Building_WorkTable</ThingClass>
<Description>A work table equipped to turn metals into electrical equipent.</Description>
<TexturePath>Things/Building/TableElectronics</TexturePath>
<CostList>
<ResourceCost>
<thingDef>Metal</thingDef>
<count>80</count>
</ResourceCost>
</CostList>
<AltitudeLayer>Waist</AltitudeLayer>
<WorkToBuild>300</WorkToBuild>
<UseStandardHealth>True</UseStandardHealth>
<maxHealth>180</maxHealth>
<Size>(3,1)</Size>
<Overdraw>False</Overdraw>
<DesignationCategory>Furniture</DesignationCategory>
<Passability>Impassable</Passability>
<hasInteractionSquare>True</hasInteractionSquare>
<interactionSquareOffset>(0,0,-1)</interactionSquareOffset>
<itemSurface>True</itemSurface>
<recipes>
<li>MakePowerConduit</li>
<li>MakeSmallLight</li>
<li>MakeBigLight</li>
</recipes>
<inspectorTabs>
<li>UI.ITab_Bills</li>
</inspectorTabs>
</ThingDef>
</Buildings>


And this would go in the RecipeDefs folder:


<?xml version="1.0" encoding="utf-8" ?>
<RecipeDefs>

<RecipeDef>
<defName>MakePowerConduit</defName>
<label>Make power conduit segments</label>
<description>Turns metal into power conduits segments.</description>
<jobString>Making power conduits.</jobString>
<workAmount>50</workAmount>
<workTimeSkillNeed>ElectronicsTime</workTimeSkillNeed>
<efficiencySkillNeed>ElectronicsEfficiency</efficiencySkillNeed>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<products>
<li>
<thingDef>PowerConduitResource</thingDef>
<count>5</count>
</li>
</products>
<parentIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</parentIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</defaultIngredientFilter>
</RecipeDef>

<RecipeDef>
<defName>MakeSmallLight</defName>
<label>Make Small Light</label>
<description>Makes a small light element.</description>
<jobString>Making Small Light.</jobString>
<workAmount>75</workAmount>
<workTimeSkillNeed>ElectronicsTime</workTimeSkillNeed>
<efficiencySkillNeed>ElectronicsEfficiency</efficiencySkillNeed>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</filter>
<count>5</count>
</li>
</ingredients>
<products>
<li>
<thingDef>StandingLampResource</thingDef>
<count>1</count>
</li>
</products>
<parentIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</parentIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</defaultIngredientFilter>
</RecipeDef>

<RecipeDef>
<defName>MakeBigLight</defName>
<label>Make Large Light</label>
<description>Makes a large light element.</description>
<jobString>Making Large Light.</jobString>
<workAmount>150</workAmount>
<workTimeSkillNeed>ElectronicsTime</workTimeSkillNeed>
<efficiencySkillNeed>ElectronicsEfficiency</efficiencySkillNeed>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</filter>
<count>20</count>
</li>
</ingredients>
<products>
<li>
<thingDef>SunLampResource</thingDef>
<count>1</count>
</li>
</products>
<parentIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</parentIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Metal</li>
</thingDefs>
</defaultIngredientFilter>
</RecipeDef>



</RecipeDefs>

SlimeCrusher

Ummm not sure if i should be asking here, but just a small question, is there a way to make something require 2 resources to BUILD? Not a recipe, but i want something to require 2 resources to build

Tynan

Yes, just make two separate entries in the costList. Should work.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

SlimeCrusher

Oh that explains everything, i wasn't copying the <ResourceCost>, i was just extending it lol.
Thanks again

Adam561

==Adam561==
==Mod Author and Designer==
==RimWorld==
www.adam561mods.webs.com

Adam561

For some reason my colonists are not crafting the items. I cannot prioritize my colonists to make the items using the workbench. 
==Adam561==
==Mod Author and Designer==
==RimWorld==
www.adam561mods.webs.com

Tynan

Quote from: Adam561 on March 09, 2014, 01:56:35 PM
For some reason my colonists are not crafting the items. I cannot prioritize my colonists to make the items using the workbench.

Do they have a WorkGiver which will use the bench?
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Adam561

Yeah, Thanks. I found the WorkGiverDefs Folder and added it... Thanks again!
==Adam561==
==Mod Author and Designer==
==RimWorld==
www.adam561mods.webs.com

Azuchisamurai

im trying to add a new recipe to the cooking stove i have everything right but from the ast few posts i have a workgiver problem and im not sure what to do

Azuchisamurai

just to give a bit more info, i have the things def done, the recipedef done, workgiver shouldnt need to be done since its a cooking stove recipe. i have added the work giver file as well to my mod but my colonists still ignore it, and i cant set them to prioratise the job and i cant figure out what the problem is

Rikiki

If the recipe is added to an existing workbench (cooking stove, butchet table, ...) then you don't need a new workgiver, the one from the core will do the job for you.

Have you put this in your recipe?
<recipeUsers>
   <li>CookStove</li>
</recipeUsers>


If it does still not work, please post your xml code in a new thread so we can have more details.

Azuchisamurai

tried adding it but im not sure exactly where im supposed to put it xD

<RecipeDef>
      <defName>CookMedicine</defName>
      <label>cook Medicine</label>
      <description>Cook a somewhat complex combination of Xerigium and cloth to create Medicine.</description>
      <jobString>cooking Medicine.</jobString>
      <workSpeedStat>CookSpeed</workSpeedStat>
      <effectWorking>Cook</effectWorking>
    <soundWorking>Recipe_CookMeal</soundWorking>
    <allowMixingIngredients>true</allowMixingIngredients>
    <ingredients>
         <li>
            <filter>
               <thingdefs>
                  <li>HerbalMedicine</li>
               </thingdefs>
            </filter>
            <count>5</count>
         </li>
         <li>
            <filter>
               <thingdefs>
                  <li>Cloth</li>
               </thingdefs>
            </filter>
            <count>10</count>
         </li>
      </ingredients>
      <products>
      <Medicine>1</Medicine>
    </products>
      <skillGains>
      <Cooking>60</Cooking>
      </skillGains>
      <recipeUsers>
        <li>CookStove</li>
      </recipeUsers>
   </RecipeDef>

Rikiki

You are lacking a <fixedIngredientFilter> and <defaultIngredientFilter>.
Please look at this thread.

The recipeUsers is well placed. :)

Azuchisamurai

when i had fixed and default in it just casued errors becasue they were identicle to the whole xml