Quick question: Adding custom recipe without DLL modding?

Started by Somz, July 22, 2014, 07:24:13 PM

Previous topic - Next topic

Somz

I've been trying to extend a recipe.xml, adding another to it which would create a weapon.
Long story short: xml/texture of the weapon placed in the correct folders of another mod with the recipe
then the copy/pasted recipe I changed accordingly refused to show up in-game.
Is it possible that I simply made a mistake somewhere, or does it have to do anything with
my lack of .DLL modding?

Long version with specifics will come if it's possible to begin with. :)

Thanks for the help!
To beer or not to beer.
That is a laughable question.

mrofa

Didnt seen any mod doing anything to recipes in dll yet :)
But if you did take xml of a object then yes it might be needing dll.
You can check that by checking the thingclass of that object or in weapons case also its parent.
Most of us use namespaces for classes, this means our custom classes got two names comapre to single named vanillia classes.
So in my mod case you could see for xml tables <thingclass>Clutter.Tables</thingclass>, vanilia use single name so its <thingClass>Building</thingClass> for vanilia tables.
So sipmly said if thing class got two names separated by dot its a custom class from dll :p
But in some cases moders dont use namespaces so you would need to compare core xml thingclasses from that category to the one you got from that mod.
All i do is clutter all around.

Somz

Quote from: mrofa on July 22, 2014, 08:57:33 PM
Didnt seen any mod doing anything to recipes in dll yet :)
But if you did take xml of a object then yes it might be needing dll.
You can check that by checking the thingclass of that object or in weapons case also its parent.
Most of us use namespaces for classes, this means our custom classes got two names comapre to single named vanillia classes.
So in my mod case you could see for xml tables <thingclass>Clutter.Tables</thingclass>, vanilia use single name so its <thingClass>Building</thingClass> for vanilia tables.
So sipmly said if thing class got two names separated by dot its a custom class from dll :p
But in some cases moders dont use namespaces so you would need to compare core xml thingclasses from that category to the one you got from that mod.

Hmmm, clutter mod, couldn't live without it... ;)
Anyway, seems it isn't connected to DLL then.
So here's the long version - as promised^^ -, the mod is betterpower+ or something like that, the custom item is power cell, it's recipe:

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


   <RecipeDef>
      <defName>MakePowerCell</defName>
      <label>Make power cell</label>
      <description>Creates a power cell which can be charged.</description>
      <jobString>Creating power cell.</jobString>
      <workAmount>800</workAmount>
      <workTimeSkillNeed>TinkeringTime</workTimeSkillNeed>
      <efficiencySkillNeed>TinkeringEfficiency</efficiencySkillNeed>
      <workEffect>ExtractMetalFromSlag</workEffect>
      <ingredients>
         <li>
            <filter>
               <thingDefs>
                  <li>Metal</li>
               </thingDefs>
            </filter>
            <count>25</count>
         </li>
      </ingredients>
      <products>
         <li>
            <thingDef>PowerCell_Empty</thingDef>
            <count>1</count>
         </li>
      </products>
      <fixedIngredientFilter>
         <thingDefs>
            <li>Metal</li>
         </thingDefs>
      </fixedIngredientFilter>
      <skillGains>
         <li>
            <skill>Crafting</skill>
            <xp>100</xp>
         </li>
      </skillGains>
   </RecipeDef>

And the custom weapon I named 'M4YA' I try to add:

   <RecipeDef>
      <defName>MakeM4YA</defName>
      <label>Make M4YA</label>
      <description>Constructs a M4YA firearm.</description>
      <jobString>Constructing Firearm.</jobString>
      <workAmount>800</workAmount>
      <workTimeSkillNeed>TinkeringTime</workTimeSkillNeed>
      <efficiencySkillNeed>TinkeringEfficiency</efficiencySkillNeed>
      <workEffect>ExtractMetalFromSlag</workEffect>
      <ingredients>
         <li>
            <filter>
               <thingDefs>
                  <li>Metal</li>
               </thingDefs>
            </filter>
            <count>50</count>
         </li>
         <li>
            <filter>
               <thingDefs>
                  <li>Silver</li>
               </thingDefs>
            </filter>
            <count>100</count>
         </li>
      </ingredients>
      <products>
         <li>
            <thingDef>M4YA</thingDef>
            <count>1</count>
         </li>
      </products>
      <fixedIngredientFilter>
         <thingDefs>
            <li>ResourcesRaw</li>
          </thingDefs>
      </fixedIngredientFilter>
      <skillGains>
         <li>
            <skill>Crafting</skill>
            <xp>150</xp>
         </li>
      </skillGains>
   </RecipeDef>

   
</RecipeDefs>

Kinda did not work out. o_o
The only thing I do not exactly understand what it stands for is the
<defName>MakePowerCell</defName> line
which I ignorantly changed to
<defName>MakeM4YA</defName> anyway, hoping for the best.
By the wayI don't know s*** about modding, I just find it fun playing around, it's like playing Lego. :)
To beer or not to beer.
That is a laughable question.

Haplo

I think what you're missing is that you didn't add the recipe to any worktable?
The defName is the part that let's the worktable know which recipe to use. Therefor take the defName and add it to the recipe list of an available workbench. As long as you use an already available bench, you normally don't have to do more than that :)

Somz

Quote from: Haplo on July 23, 2014, 01:01:34 AM
I think what you're missing is that you didn't add the recipe to any worktable?
The defName is the part that let's the worktable know which recipe to use. Therefor take the defName and add it to the recipe list of an available workbench. As long as you use an already available bench, you normally don't have to do more than that :)

God damnit, yeah, I totally forgot about adding the recipe to the bench...
Even though I've already found a def with the said bench's definition in it, it never occurred to me... ಠ_ಠ
Thanks, it's working now! ◕‿↼
To beer or not to beer.
That is a laughable question.