RimWorld

RimWorld

SeedsPlease: Lite
 This topic has been pinned, so it's probably important
Owlchemist  [developer] 5 Sep, 2021 @ 2:05pm
Documentation for modders
Most compatibility patches are handled on this end. But if you'd like to do the patching on your side instead or maintain control over the specifics, here's how to write your own patches:

This is a basic def with the bare minimum needed.
<ThingDef ParentName="SeedBase"> <defName>Seed_Ambrosia</defName> <label>ambrosia seeds</label> <modExtensions> <li Class="SeedsPleaseLite.Seed"> <sources> <li>VG_PlantAmbrosia</li> </sources> </li> </modExtensions> </ThingDef>

Below are the optional arguments you can use. The values given are the defaults used if you do not specify.
baseChance = 0.95f; //% chance of getting a seed returned on harvest extraChance = 0.15f; //% chance of getting a bonus seed extractionValue = 4; //How many seeds are extracted per recipe batch harvestOverride = null; //Make the plant drop something else instead of its normal product harvestFactor = 1f; //Multiply the usual yield, usually used with harvestOverride priority = 10; //If multiple plants drop the same food (like different species of mushroom dropping Raw Fungus), higher priority will win regarding which seeds to use if the food is processed for seeds. extractable = Normal; //Can be Normal, True, or False. Normal means the normal rules are used on determining if a plant's harvested thing should be extractable for seeds. For example, normally non-ingestible harvested things like wood logs do not have seeds, but if set to true, you can override this rule.

You can of course also specify your own textures for the seeds, as usual, but if you opt not to, the generic seed textures from the parent def are used. Tradeability is another vanilla node worth considering specifying.

Finally, SeedsPlease will force the need of seeds for plants that have harvested things and are sowable. If you'd like to overrule this and force that no seeds are needed, add this to the plant itself:
<modExtensions> <li MayRequire="owlchemist.seedspleaselite" Class="SeedsPleaseLite.Seedless" /> </modExtensions>
Last edited by Owlchemist; 8 Sep, 2021 @ 2:43pm
< >
Showing 1-5 of 5 comments
brightsideguy 8 Mar, 2023 @ 9:39pm 
Is there a way for us to have the recipe require less units?

I want to make my plant use one unit to make two seeds, since its a survivalist plant (aka sometimes you just have a unit or two to start an entire farm)
brightsideguy 10 Mar, 2023 @ 12:08pm 
For anyone who having trouble making a patch based on the info above, here's mine. I have a custom recipe in this because I want 1 raw fruit to make 2 seeds, but I didn't figure out how to turn my plant off in the regular batch recipe .

Edit on 3/13/23: Updated so that recipe could also do the "Do until you have X amount" part of a recipe (though that seems to break in my heavily modded game).


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

<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>SeedsPlease: Lite</li>
</mods>
<match Class="PatchOperationSequence">
<operations>




<li Class="PatchOperationAdd">
<xpath>Defs</xpath>
<value>
<ThingDef ParentName="SeedBase">
<defName>Seed_Grungo</defName>
<label>grungo seeds</label>
<modExtensions>
<li Class="SeedsPleaseLite.Seed">
<sources>
<li>Grungo_GerzeeFrozenPlant</li>
</sources>
<baseChance>0.05</baseChance>
<extractionValue>2</extractionValue>
</li>

</modExtensions>
<graphicData>
<texPath>Things/Item/Seeds/Grungo/Grungo</texPath>
</graphicData>
</ThingDef>
</value>
</li>



<li Class="PatchOperationAdd">
<xpath>Defs</xpath>
<value>
<RecipeDef>
<defName>ExtractGrungoSeeds</defName>
<label>extract grungo seeds</label>
<description>Extract seeds from grungo plant</description>
<jobString>Extracting seeds.</jobString>
<workSpeedStat>CookSpeed</workSpeedStat>
<effectWorking>Cook</effectWorking>
<workSkill>Cooking</workSkill>
<workAmount>500</workAmount>
<recipeUsers>
<li>SeedExtractionSpot</li>
</recipeUsers>
<ingredients>
<li>
<filter>
<thingDefs>
<li>RawGrungo</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<fixedIngredientFilter>
<thingDefs>
<li>RawGrungo</li>
</thingDefs>
</fixedIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>RawGrungo</li>
</thingDefs>
</defaultIngredientFilter>
<specialProducts>
<li>Butchery</li>
</specialProducts>
<workerCounterClass>SeedsPleaseLite.RecipeWorkerCounter_ExtractSeeds</workerCounterClass>
</RecipeDef>

</value>
</li>



</operations>
</match>
</Operation>

</Patch>
Last edited by brightsideguy; 7 Apr, 2023 @ 1:59am
brightsideguy 10 Mar, 2023 @ 12:18pm 
And I guess here's my full custom plant + patch interface to see how it all fits together. If you're still lost, copy paste things.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2446834016
Owlchemist  [developer] 10 Mar, 2023 @ 1:35pm 
Yeah iirc by default the input value always the same but the output value is dynamic. Looks like you found a workaround though :steamthumbsup:
Lailani01 7 Apr, 2023 @ 1:49am 
TYVM for the code @Owlchemist and @brightsideguy !
< >
Showing 1-5 of 5 comments
Per page: 1530 50