• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Changing seed drop chance by LotL perk level

Curuedhel

New member
I'm trying to adjust the A20 farming system to be somewhere in between the old versions - one of the things I'd like to do is change the seed drop chance from being a flat 50% to being dependent on your Living Off The Land perk level - but I've never made a mod that uses perk levels to achieve something like this (I've really only ever changed fixed values).  Is there anyone who can give me a quick rundown of how to structure that kind of change?  Thanks.

 
I'm trying to adjust the A20 farming system to be somewhere in between the old versions - one of the things I'd like to do is change the seed drop chance from being a flat 50% to being dependent on your Living Off The Land perk level - but I've never made a mod that uses perk levels to achieve something like this (I've really only ever changed fixed values).  Is there anyone who can give me a quick rundown of how to structure that kind of change?  Thanks.


You can find most of the data on harvesting for LotL inside progression.xml - You might need to look here for what you're doing?

As for seed drops, a brief look through the XML files doesn't really show much so my assumption there would be it is handled elsewhere.

 
Last edited by a moderator:
This is the important piece of code you'd want to append in progression.xml
 

Code:
		<effect_group>
			<passive_effect name="CraftingTier" operation="base_set" level="0,5" value="0,5" tags="perkLivingOffTheLandCrafting"/><!-- fake crafting perk that is used to scale resources -->

			<passive_effect name="HarvestCount" operation="perc_add" level="1,2,3" value="1,1,2" tags="cropHarvest,wildCropsHarvest"/>
			<passive_effect name="HarvestCount" operation="base_set" level="2,3" value="1,1" tags="bonusCropHarvest"/>
			
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,3" value="1" tags="plantedAloe1,plantedChrysanthemum1,plantedGoldenrod1,plantedYucca1"/>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="2,3" value="1" tags="plantedBlueberry1,plantedCoffee1,plantedCorn1,plantedCotton1,plantedMushroom1,plantedPotato1,plantedHop1,plantedPumpkin1,plantedGraceCorn1"/>

			<effect_description level="1" desc_key="perkLivingOffTheLandRank1Desc" long_desc_key="perkLivingOffTheLandRank1LongDesc"/>
			<effect_description level="2" desc_key="perkLivingOffTheLandRank2Desc" long_desc_key="perkLivingOffTheLandRank2LongDesc"/>
			<effect_description level="3" desc_key="perkLivingOffTheLandRank3Desc" long_desc_key="perkLivingOffTheLandRank3LongDesc"/>
			<effect_description level="4" desc_key="perkLivingOffTheLandRank4Desc" long_desc_key="perkLivingOffTheLandRank4LongDesc"/>
			<effect_description level="5" desc_key="perkLivingOffTheLandRank5Desc" long_desc_key="perkLivingOffTheLandRank5LongDesc"/>
		</effect_group>
 
The seed chance is actually in the blocks file

<block name="plantedPotato3HarvestPlayer">
    <property name="Extends" value="plantedPotato3Harvest"/>
    <property name="DescriptionKey" value="plantedPotato3HarvestDesc"/>
    <property name="CustomIcon" value="plantedPotato1"/>
    <property name="CreativeMode" value="None"/>
    <drop event="Harvest" name="foodCropPotato" count="2" tag="cropHarvest"/>
    <drop event="Harvest" name="foodCropPotato" prob="0.5" count="1" tag="bonusCropHarvest"/>
    <drop event="Destroy" name="plantedPotato1" count="1" prob="0.5"/>
    <!-- <property name="DowngradeBlock" value="plantedPotato1"/> -->
</block>




drop event Destroy is where you have a 50% probability of getting a seed back.  You might be able to append / add a line in the LoTL progression portion to add to the base of the probability but I never did that before.

Maybe by simply adding a tag to the drop event (like tag="bonusSeedChance")

Then in progression file have a line like (though I am not sure the name="DestroyProb" works, that might be a variable set in c# that you would have to define.

Code:
[COLOR=#e8bd89]<passive_effect[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]name[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"DestroyProb"[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]operation[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"base_add"[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]level[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"2,3"[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]value[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"0.1,0.2"[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]tags[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"[/COLOR]bonusSeedChance[COLOR=#7ea9c4]"[/COLOR][COLOR=#e8bd89]/>[/COLOR]
 
Last edited by a moderator:
This is basically how the perk Living of the Land decides what to give players, for bonus seed harvest see this line:

<passive_effect name="HarvestCount" operation="base_set" level="2,3" value="1,1" tags="bonusCropHarvest"/>



This essentially says if a player has Living of the Land level 2 or 3, you get a value of 1 as a bonus harvest - we can essentially interpret the "1,1" as meaning a 100% chance at level 2 and 3 respectively.
But 100% chance of what?

Following the bonusCropHarvest tag in blocks.xml:
 

<drop event="Harvest" name="foodCropCorn" prob="0.5" count="1" tag="bonusCropHarvest"/>



It basically gives you 100% chance of getting a 50% chance of getting 1 additional crop 🙃

You can change this using the setattribute command or adding something onto the end with an append command

 
Back
Top