Ludeon Forums

RimWorld => Mods => Help => Topic started by: Aristocat on June 07, 2016, 02:06:19 PM

Title: Non-random Craftable neurotrainer
Post by: Aristocat on June 07, 2016, 02:06:19 PM

   <RecipeDef>
      <defName>CreateNT</defName>
      <label>Craft NT</label>
      <description>Use heat and strong electromagnets to combine gold, steel and plasteel.</description>
      <jobString>Crafting NT.</jobString>
      <workAmount>15000</workAmount>
      <recipeUsers>
         <li>TableMachining</li>
      </recipeUsers>
      <workSpeedStat>SmeltingSpeed</workSpeedStat>
      <effectWorking>Smelt</effectWorking>
      <soundWorking>Recipe_Smelt</soundWorking>
      <ingredients>
         <li>
            <filter>
               <thingDefs>
                  <li>Gold</li>
               </thingDefs>
            </filter>
            <count>3</count>
         </li>
         <li>
            <filter>
               <thingDefs>
                  <li>Steel</li>
               </thingDefs>
            </filter>
            <count>25</count>
         </li>
         <li>
            <filter>
               <thingDefs>
                  <li>Plasteel</li>
               </thingDefs>
            </filter>
            <count>50</count>
         </li>
      </ingredients>
      <products>
        <Neurotrainer>1</Neurotrainer>
      </products>
      <fixedIngredientFilter>
         <thingDefs>
            <li>Gold</li>
            <li>Steel</li>
            <li>Plasteel</li>
         </thingDefs>
      </fixedIngredientFilter>
      <skillRequirements>
         <li>
            <skill>Crafting</skill>
            <minLevel>8</minLevel>
         </li>
      </skillRequirements>
      <workSkill>Crafting</workSkill>
      <researchPrerequisite>MultiAnalyzer</researchPrerequisite>
   </RecipeDef>


Completely random neurotrainers crafted with this code, what's defname of individual neurotrainer?
Title: Re: Non-random Craftable neurotrainer
Post by: 1000101 on June 07, 2016, 04:41:09 PM
Since you obviously know where to find the defs and xml, why not look in the core ThingDefs?
Title: Re: Non-random Craftable neurotrainer
Post by: Aristocat on June 08, 2016, 12:21:47 AM
Quote from: 1000101 on June 07, 2016, 04:41:09 PM
Since you obviously know where to find the defs and xml, why not look in the core ThingDefs?


  <ThingDef ParentName="ResourceBase">
    <defName>Neurotrainer</defName>
    <thingClass>Neurotrainer</thingClass>
    <label>neurotrainer</label>
    <description>A one-use nanotech trainer device. The neurotrainer is inserted through the orbit of the eye and releases nanomachines into the subject's brain, quickly improving their skills in a specific area.</description>
    <graphicData>
      <texPath>Things/Item/Special/Neurotrainer</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <stackLimit>1</stackLimit>
    <tradeNeverStack>true</tradeNeverStack>
    <useHitPoints>true</useHitPoints>
    <statBases>
      <MarketValue>2000</MarketValue>
      <MaxHitPoints>80</MaxHitPoints>
    </statBases>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
    <drawGUIOverlay>false</drawGUIOverlay>
    <tradeTags>
      <li>Exotic</li>
    </tradeTags>
  </ThingDef>
 


Sorry I might be stupid, but I really can't find other than this.
Title: Re: Non-random Craftable neurotrainer
Post by: 1000101 on June 08, 2016, 01:39:54 AM
That's the one.  ;)

They are randomly assigned a skill on creation in code.

    public override void PostMake()
    {
      base.PostMake();
      this.skill = DefDatabase<SkillDef>.GetRandom();
    }