Ludeon Forums

RimWorld => Mods => Help => Topic started by: Austintrollinski on September 20, 2017, 10:35:23 PM

Title: how to you make animals produce the items you want
Post by: Austintrollinski on September 20, 2017, 10:35:23 PM
i need help to make animals produce an item i want them to dose someone know to do that and can to tell me how
Title: Re: how to you make animals produce the items you want
Post by: mattyboof on September 21, 2017, 04:03:11 AM
What sort of item? food, horn etc

You could make it Milkable (see the cow or muffalo for a template)

Then make a custom "milk" which is the item you want?

Or add a bodypart to it which you get on butchering (see thrumbo for a template) You will need to make the ThingDef also unless it is a vanilla item you are wanting.
Title: Re: how to you make animals produce the items you want
Post by: Austintrollinski on September 21, 2017, 09:39:25 AM
i want the animal to produce gold and am still new to modding
Title: Re: how to you make animals produce the items you want
Post by: CannibarRechter on September 21, 2017, 09:59:38 AM
Open up Races_Animal_Arid. Look at the ThingDef for Muffalo. Under the comps section, you'll see:


      <li Class="CompProperties_Shearable">
        <woolDef>WoolMuffalo</woolDef>
        <shearIntervalDays>25</shearIntervalDays>
        <woolAmount>100</woolAmount>
      </li>


Copy this to your animal. And then change it as follows:


      <li Class="CompProperties_Shearable">
        <woolDef>Gold</woolDef>
        <shearIntervalDays>25</shearIntervalDays>
        <woolAmount>100</woolAmount>
      </li>


The trick is understanding that this comp doesn't actually require a "WoolDef". It can produce just about any Thing. This is exactly how I made my Thrumbo mod allow periodic harvesting of horns (I assume this still works; haven't tested lately).

p.s., the "zen" of modding is to looking for examples, and just try it. That's how I learned this was possible in the first place. Modding is a great deal of trial and error.
Title: Re: how to you make animals produce the items you want
Post by: Albion on September 21, 2017, 10:51:19 AM
If you want to make something more complex than just using the sheering component (which then also means that the thrumbo horn is sheered off) look at the Chemicals extraction & Neutroamine crafting (https://ludeon.com/forums/index.php?topic=26108.0) mod by ShadowTani. He even has the source code published so you can inspect it directly.

Alternativly you can check out the wool production component in the c# assemly of the core game and reverse engineer it to create your own production code.

All in all you'll need to do the following things:

... or just use the solution given by CannibarRechter