Gun Recipes

Started by themightysushicat, June 04, 2015, 10:38:33 PM

Previous topic - Next topic

themightysushicat

I have recently tried to combine a few mods, but I really don't know what I'm doing. So I wanted to make recipes for some gun mods I got but I don't know how to MAKE them. If any one could help that would be really nice.

Adamiks

Just look at the recipeDefs in the Core. You will just need select defs for ingrediens, products etc.

Example:
  <RecipeDef>
    <defName>SmeltWeapon</defName>
    <label>smelt metal from weapon</label>
    <description>Use heat and strong electromagnets to separate useful metal from weapons.</description>
    <jobString>Smelting metal from weapon.</jobString>
    <workAmount>1600</workAmount>
    <workSpeedStat>SmeltingSpeed</workSpeedStat>
    <effectWorking>Smelt</effectWorking>
    <soundWorking>Recipe_Smelt</soundWorking>
    <ingredients>
      <li>
        <filter>
          <categories>
            <li>Weapons</li>
          </categories>
        </filter>
        <count>1</count>
      </li>
    </ingredients>
    <fixedIngredientFilter>
      <categories>
        <li>Weapons</li>
      </categories>
    </fixedIngredientFilter>
  </RecipeDef>


Look at the ingredients. You can choose whole category (type <categories>) or just single thing def, like this:
          <thingDefs>
            <li>Steel</li>
          </thingDefs>


Tip: Always begin "Defs" (or Def) from big letter. For example - <thingDefs>

themightysushicat

Oh. This makes so much sense it's so easy. Just need like 200 of these.

Adamiks

Quote from: themightysushicat on June 05, 2015, 07:55:40 AM
Oh. This makes so much sense it's so easy. Just need like 200 of these.

You can also create "MakeableBase", cost list, recipe users etc.

Here is example:


<ThingDef Name="ApparelBase" Abstract="True">
<thingClass>Apparel</thingClass>
<category>Item</category>
<selectable>True</selectable>
<pathCost>10</pathCost>
<useHitPoints>True</useHitPoints>
<graphicOnGroundRandomRotateAngle>35</graphicOnGroundRandomRotateAngle>
<drawGUIOverlay>true</drawGUIOverlay>
<statBases>
<MaxHitPoints>100</MaxHitPoints>
<Flammability>1.0</Flammability>
<DeteriorationRate>1</DeteriorationRate>
<SellPriceFactor>0.5</SellPriceFactor>
</statBases>
<altitudeLayer>Item</altitudeLayer>
<alwaysHaulable>True</alwaysHaulable>
<tickerType>Never</tickerType>
<thingCategories>
<li>Headgear</li>
</thingCategories>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
<li>
<compClass>CompColorable</compClass>
</li>
<li>
<compClass>CompQuality</compClass>
</li>
</comps>
</ThingDef>

<ThingDef Name="ApparelMakeableBase" ParentName="ApparelBase" Abstract="True">
<recipeMaker>
<workSpeedStat>TailoringSpeed</workSpeedStat>
<workSkill>Crafting</workSkill>
<effectWorking>Tailor</effectWorking>
<soundWorking>Recipe_Tailor</soundWorking>
<recipeUsers>
<li>TableTailor</li>
</recipeUsers>
<unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
</recipeMaker>
</ThingDef>

<ThingDef ParentName="ApparelBase">
<defName>Apparel_MilitaryHelmet</defName>
<label>military helmet</label>
<description>Old-looking and heavy, but effective. Protects against low-velocity projectiles, shrapnel, falling debris, and cuts to the head.</description>
<graphicPath>Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet</graphicPath>
<graphicClass>Graphic_Single</graphicClass>
<costStuffCount>40</costStuffCount>
<stuffCategories>
<li>Metallic</li>
</stuffCategories>
<statBases>
<MaxHitPoints>100</MaxHitPoints>
<WorkToMake>1200</WorkToMake>
<ArmorRating_Blunt>0.1</ArmorRating_Blunt>
<ArmorRating_Sharp>0.25</ArmorRating_Sharp>
</statBases>
<recipeMaker>
<workSpeedStat>SmithingSpeed</workSpeedStat>
<workSkill>Crafting</workSkill>
<effectWorking>Smith</effectWorking>
<soundWorking>Recipe_Smith</soundWorking>
<recipeUsers>
<li>TableSmithing</li>
</recipeUsers>
<unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
</recipeMaker>
<equippedStatOffsets>
<MoveSpeed>-0.04</MoveSpeed>
<PsychicSensitivity>-0.10</PsychicSensitivity>
</equippedStatOffsets>
<apparel>
<bodyPartGroups>
<li>UpperHead</li>
</bodyPartGroups>
<worngraphicPath>Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet</worngraphicPath>
<layers>
<li>Overhead</li>
</layers>
<commonality>1</commonality>
<tags>
<li>Military</li>
</tags>
<defaultOutfitTags>
<li>Soldier</li>
</defaultOutfitTags>
</apparel>
</ThingDef>


Using recipe users you can choose unfinished thing def for item. Unfinished thing is good when you need like 10000 work time to make it (so colonists will don't need to make item in one run).


themightysushicat

Oh. Thanks this is so helpful