Ludeon Forums

RimWorld => Mods => Topic started by: Kain21 on September 11, 2015, 04:51:36 PM

Title: [Mod Request] Craftable Armor vest
Post by: Kain21 on September 11, 2015, 04:51:36 PM
Title says it all
Title: Re: [Mod Request] Craftable Armor vest
Post by: Stinkycat752 on September 11, 2015, 07:19:38 PM
I'm no professional, but the game didn't crash when I tried to load this up so you could try it ;-;

Requires a machining table and 95 steel to craft

[attachment deleted due to age]
Title: Re: [Mod Request] Craftable Armor vest
Post by: Kain21 on September 12, 2015, 03:20:09 AM
It didn't crash for me either but the option to make it wasn't showing up in the bills.
Title: Re: [Mod Request] Craftable Armor vest
Post by: Stinkycat752 on September 12, 2015, 05:54:36 PM
Hooray, I'm as crap as I thought I was!

Sorry  :(

I spelled Recipe incorrect.

If you don't want to redownload this just go into the Defs folder and change the folder name from Recipie to Recipe, or check the XML itself, I don't remember which was broken ;-;

[attachment deleted due to age]
Title: Re: [Mod Request] Craftable Armor vest
Post by: FMJ Penguin on September 13, 2015, 12:58:14 PM
Quote from: Stinkycat752 on September 12, 2015, 05:54:36 PM
Hooray, I'm as crap as I thought I was!

frantically reaches for the thumbs up button to mash it


+99999

ty Stinky for that one  ;D
Title: Re: [Mod Request] Craftable Armor vest
Post by: spiritus80 on September 15, 2015, 06:25:51 PM
There are easier ways to add recipes other than altering core files.

ie..

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

  <ThingDef Name="ApparelBase" Abstract="True">
    <thingClass>Apparel</thingClass>
    <category>Item</category>
    <selectable>True</selectable>
    <pathCost>10</pathCost>
    <useHitPoints>True</useHitPoints>
    <graphicData>
      <onGroundRandomRotateAngle>35</onGroundRandomRotateAngle>
    </graphicData>
    <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>Apparel</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>
<!-- <li>eXWorkBench</li> -->
    </recipeUsers>
      <unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
</recipeMaker>
<stuffCategories>
<li>Fabric</li>
<li>Leathery</li>
<!-- <li>Metallic</li> -->
</stuffCategories>
</ThingDef>
 


<!-- ARMOR MC VEST -->

<ThingDef ParentName="ApparelMakeableBase">
<defName>Apparel_McVest</defName>
<label>armor mcvest</label>
<description>The MC VEST</description>
<graphicData>
<texPath>Things/Pawn/Humanlike/Apparel/VestPlate/VestPlate</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<costList>
<Steel>30</Steel>
</costList>
<costStuffCount>60</costStuffCount>
<statBases>
<WorkToMake>2700</WorkToMake>
<MaxHitPoints>200</MaxHitPoints>
<MarketValue>777</MarketValue>
<ArmorRating_Blunt>0.20</ArmorRating_Blunt>
<ArmorRating_Sharp>0.60</ArmorRating_Sharp>
<Insulation_Cold>-1</Insulation_Cold>
<Insulation_Heat>1</Insulation_Heat>
</statBases>

<equippedStatOffsets>
<SocialImpact>0.15</SocialImpact>
<MoveSpeed>-0.10</MoveSpeed>
<WorkSpeedGlobal>-0.15</WorkSpeedGlobal>
<!-- Add more statBases Here -->
</equippedStatOffsets>
<apparel>
<bodyPartGroups>
<li>Torso</li>
</bodyPartGroups>
<worngraphicPath>Things/Pawn/Humanlike/Apparel/VestPlate/VestPlate</worngraphicPath>
<layers>
<li>Middle</li>
</layers>
<commonality>1</commonality>
<tags>
<li>Outlander</li>
<li>Military</li>
<li>Spacer</li>
</tags>
<defaultOutfitTags>
<li>Soldier</li>
<!-- <li>Worker</li> Turn off to make it common for wokers as well -->
</defaultOutfitTags>
</apparel>
  <colorGenerator Class="ColorGenerator_StandardApparel" />
</ThingDef>
</ThingDefs>



There is another way, ie refering to the table in the recipe xml file itself as well.

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

<RecipeDefs>

  <RecipeDef>
    <defName>CraftArmorPlate</defName>
    <label>craft armor plate</label>
    <description>Good against bullets, better against imaginary.</description>
    <jobString>Carving</jobString>
    <workAmount>3000</workAmount>
      <effectWorking>Tailor</effectWorking>
      <soundWorking>Recipe_Tailor</soundWorking>
    <ingredients>
<li>
<filter>
<categories>
<li>Leathers</li>
</categories>
</filter>
<count>10</count>
</li>
<li>
<filter>
<thingDefs>
<li>Plasteel</li>
</thingDefs>
</filter>
<count>15</count>
</li>
    </ingredients>
    <products>
      <Apparel_McVest>1</Apparel_McVest>
    </products>
<fixedIngredientFilter>
<categories>
<li>Leathers</li>
</categories>
<ThingDefs>
<li>Plasteel</li>
</ThingDefs>
</fixedIngredientFilter>
<defaultIngredientFilter>
<categories>
<li>Leathers</li>
</categories>
<ThingDefs>
<li>Plasteel</li>
</ThingDefs>
</defaultIngredientFilter>
<skillRequirements>
<li>
  <skill>Crafting</skill>
</li>
</skillRequirements>
<workSkill>Crafting</workSkill>
      <recipeUsers>
        <li>TableTailor</li>
      </recipeUsers>
  </RecipeDef>

</RecipeDefs>


by adding the recipeUser you can refer to an existing table or one made by another player without touching her/his files.

As a gest I added a small module you can have.


[attachment deleted due to age]
Title: Re: [Mod Request] Craftable Armor vest
Post by: Toggle on September 16, 2015, 09:06:37 PM
Dear god... Please, mark your code, that's long as hell... And what do you mean 'Easier way to make recipes then altering core files'? Isn't that what you're doing? And the previous downloads weren't altering core files, they were mods if I'm correct, didn't actually bother to download them. All you have to do is make the mod template, move the armoured vest over to it, copy whatever recipe stuff from the other tailor folder has and paste it onto the vest in the mod, change what's required and boom, you got yourself a craftable vest.
Title: Re: [Mod Request] Craftable Armor vest
Post by: spiritus80 on September 17, 2015, 02:02:40 AM
Quote from: Z0MBIE2 on September 16, 2015, 09:06:37 PM
Dear god... Please, mark your code, that's long as hell... And what do you mean 'Easier way to make recipes then altering core files'? Isn't that what you're doing? And the previous downloads weren't altering core files, they were mods if I'm correct, didn't actually bother to download them. All you have to do is make the mod template, move the armoured vest over to it, copy whatever recipe stuff from the other tailor folder has and paste it onto the vest in the mod, change what's required and boom, you got yourself a craftable vest.

First, how do I mark this code?
Second, if you had bothered to download the mod you would see it add more than just the making of his/her armor vest.
Third, those files I attached or code I pasted in here was totally my own, not a correction of his templet.
I answered the topic itself, for future search referance.

Definitions like the TableMachining, MakeStoneBlocks, ExtractMetalFromSlag, SmeltWeapon, MakeArtilleryShell, then on the bottom..
MakeVestPlate...

Is it not easier to add a file , rather than to have alot of duplicate code not needed.
Let me draw you a "picture",
Its like I copy the entire Core, add a dupicate Core2 then change name for duster to trenchcoat..

Instead I can make a new file for just that item, then add ;

   <recipeUsers>
        <li>TableTailor</li> <!-- Whatever pre excisting workbench you chose -->
      </recipeUsers>

either its a recipe for an excisting item in the form of a recipe in the RecipeDef or on the item itself in the ThingDef.

So instead of recreating an already excisting table and just add phrase in the table's ThingDef

<li>ButcherCorpseMechanoid</li>
<li>MakeArtilleryShell</li>
<li>MakeVestPlate</li>

In the long run it is better to add recipe's without altering the worktable itself,
except if that was your intension in the first place.

I beleve in this instance the topic spoke for itself, craftable Armor vest. not making  "MakeStoneBlocks" as well

Lets say I love a modpack I downloaded, instead of altering its code without their permission if none was handed out.
But I died to use one of its worktables , but I wanted to add a recipe of my own.

I could "Call" on that table instead of altering the table.





Title: Re: [Mod Request] Craftable Armor vest
Post by: skullywag on September 17, 2015, 02:07:31 AM
use the code tags in the wysiwyg editor to see the format. Hit reply not quick reply.

As for the mod its as simple as you have suggested.
Title: Re: [Mod Request] Craftable Armor vest
Post by: spiritus80 on September 17, 2015, 02:18:35 AM
Thank you, I learned something new.
Title: Re: [Mod Request] Craftable Armor vest
Post by: FridayBiology on September 17, 2015, 05:31:36 AM
Can i request lower tier armour vest using wood(plank) and cotton(rope)
the user would suffer movement debuffs as well as manipulate debuff but, should be available to help beef up late game tribeman raiders