Jump to content

Changing seed drop chance by LotL perk level


Curuedhel

Recommended Posts

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.

 

Link to comment
Share on other sites

2 hours ago, Curuedhel said:

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.

Edited by ThunderSn1per (see edit history)
Link to comment
Share on other sites

This is the important piece of code you'd want to append in progression.xml
 

		<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>

 

Link to comment
Share on other sites

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.

 

<passive_effect name="DestroyProb" operation="base_add" level="2,3" value="0.1,0.2" tags="bonusSeedChance"/>
Edited by BFT2020 (see edit history)
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...