边缘世界 RimWorld

边缘世界 RimWorld

SeedsPlease: Lite
 此主题已被置顶,因此可能具有重要性
Owlchemist  [开发者] 2021 年 9 月 5 日 下午 2:05
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>
最后由 Owlchemist 编辑于; 2021 年 9 月 8 日 下午 2:43
< >
正在显示第 1 - 5 条,共 5 条留言
brightsideguy 2023 年 3 月 8 日 下午 9:39 
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 2023 年 3 月 10 日 下午 12:08 
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>
最后由 brightsideguy 编辑于; 2023 年 4 月 7 日 上午 1:59
brightsideguy 2023 年 3 月 10 日 下午 12:18 
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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2446834016
Owlchemist  [开发者] 2023 年 3 月 10 日 下午 1:35 
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 2023 年 4 月 7 日 上午 1:49 
TYVM for the code @Owlchemist and @brightsideguy !
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50