[Solved] Adding a new implant - shows up as item but not as a selectable implant

Started by Phantasm, April 24, 2018, 07:44:35 PM

Previous topic - Next topic

Phantasm

I'm adding a new variety of eye implant into the game as a very basic mod. Here's what my file structure looks like:

- About
     - About.xml
     - preview.png
- Defs
     - HediffDefs
          - Hediffs_Local_AddedParts.xml
     -ThingDefs_Items
          - Items_BodyParts.xml

Here's what each of the XML files look like:

About.xml
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
   <name>TestEye</name>
   <author>Phantasm</author>
    <url></url>
   <targetVersion>0.18.1722</targetVersion>
   <description>TestEye</description>
</ModMetaData>

Hediffs_Local_AddedParts.xml
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
  <!-- Added body parts -->

  <HediffDef Name="AddedBodyPartBase" Abstract="True">
    <hediffClass>Hediff_AddedPart</hediffClass>
    <defaultLabelColor>(0.5, 0.5, 0.9)</defaultLabelColor>
    <isBad>false</isBad>
  </HediffDef>

  <HediffDef ParentName="AddedBodyPartBase">
    <defName>TestEye</defName>
    <label>test eye</label>
    <labelNoun>a test eye</labelNoun>
    <spawnThingOnRemoved>TestEye</spawnThingOnRemoved>
    <addedPartProps>
      <isBionic>true</isBionic>
      <isSolid>true</isSolid>
      <partEfficiency>1.4</partEfficiency>
    </addedPartProps>
  </HediffDef>

</Defs>

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

  <ThingDef Name="BodyPartBase" Abstract="True">
    <thingClass>ThingWithComps</thingClass>
    <category>Item</category>
    <useHitPoints>true</useHitPoints>
    <selectable>true</selectable>
    <statBases>
      <MaxHitPoints>50</MaxHitPoints>
      <Flammability>1.0</Flammability>
         <Beauty>-4</Beauty>
      </statBases>
    <altitudeLayer>Item</altitudeLayer>
    <tickerType>Never</tickerType>
    <alwaysHaulable>true</alwaysHaulable>
    <isBodyPartOrImplant>true</isBodyPartOrImplant>
    <tradeTags>
      <li>BodyPartOrImplant</li>
    </tradeTags>
    <comps>
      <li Class="CompProperties_Forbiddable"/>
    </comps>
    <pathCost>10</pathCost>
  </ThingDef>

  <ThingDef ParentName="BodyPartBase" Name="BodyPartNaturalBase" Abstract="True">
    <thingCategories>
      <li>BodyPartsNatural</li>
    </thingCategories>
      <statBases>
         <DeteriorationRate>4.0</DeteriorationRate>
      </statBases>
  </ThingDef>

  <ThingDef ParentName="BodyPartBase" Name="BodyPartArtificialBase" Abstract="True">
    <thingCategories>
      <li>BodyPartsArtificial</li>
    </thingCategories>
      <statBases>
         <DeteriorationRate>2.0</DeteriorationRate>
      </statBases>
  </ThingDef>

  <!-- artificial - bionics -->

  <ThingDef ParentName="BodyPartArtificialBase">
    <defName>TestEye</defName>
    <label>testeye</label>
    <description>Test Eye.</description>
    <graphicData>
      <texPath>Things/Item/BodyPart/ArtificialOrgan</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <statBases>
      <MarketValue>1500</MarketValue>
      <Mass>0.3</Mass>
    </statBases>
    <techHediffsTags>
      <li>Advanced</li>
    </techHediffsTags>
  </ThingDef>
 
</Defs>

When I use Prepare Carefully and go to Medical Items, I see Test Eye listed there. But if I try to install it on the character, it's not in the list like the vanilla Bionic Eye is. Are there some extra files I need that I'm missing? Thanks ahead of time.

Shinzy

I believe you're missing both the recipe def and the link to that recipe in the humanlike race
check RecipeDefs and ThingDefs_Races

Phantasm

Quote from: Shinzy on April 24, 2018, 09:51:11 PM
I believe you're missing both the recipe def and the link to that recipe in the humanlike race
check RecipeDefs and ThingDefs_Races

Thank you! Worked like a charm. I'm new, so I assumed I didn't need the recipe def if I didn't want it to be craft-able.