Jump to content

Help with appending perk recipe unlocks?


JAMOY1993

Recommended Posts

Hello, i am struggling to get appendage of perk recipe unlocks for a mod i am making. I dont understand why i cant append the perks in the same way that you can append and overwrite weapons by simply copying the code into your modlets hirearchy. I have looked up a couple threads on Xpath, im using an example from a user called stompbox108 here: https://community.7daystodie.com/topic/11088-does-anyone-have-a-good-example-of-actually-adding-a-new-perk-or-skill-level/

 

Basically what i am trying to do is add recipes to be unlocked to the Master Chef perk. It keeps on returning the following error:

 

"2021-01-16T23:20:07 1029.551 WRN XML patch for "progression.xml" from mod "Jamoy's Ammunition Emporium" did not apply: <append xpath="/progression/perks[@name=perkMasterChef]/effect_group" "

 

It does not give me any useful information as to why this is happened. This is the code that i am trying to append:

 

<configs>
<append xpath="/progression/perks[@name=perkMasterChef]/effect_group">
		<passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,5" value="1" tags="foodBreadLoaf"/>
</append>
</configs>

 

This is the most simple form i have tried, with a single recipe to be unlocked, yet it still "Did not apply because reasons"

 

Any idea what i am doing wrong?

Link to comment
Share on other sites

You need another perk node. This is looking for a perks node named perkmasterchef that's a child of the progression node.. the perkmasterchef is a perk that's a child of the perks node....

/progression/perks/perk[@name='perkMasterChef']/effect_group

As a tip, I always use alt0 in notepad++ to collapse all nodes, then write them in the xpath as i uncollapse them.

Link to comment
Share on other sites

Hey, thanks for the reply.

 

I got this error

 

"2021-01-17T13:10:30 252.654 WRN XML patch for "progression.xml" from mod "Jamoy's Ammunition Emporium" did not apply: <append xpath="/progression/perks/perk[@name=perkMasterChef]/effect_group""

 

Could other appends not being applied cause a fall over of future appends?

 

Edit:

I have tried a different approach and now it complains that there is already a perk in the table with the same name. This was the approach i spoke about that works with items and other objects. I am not trying to create a new item, i am trying to append. Why does it not let you append a whole perk like this?

 

<configs>
<append xpath="/progression/perks">
	<perk name="perkMasterChef" parent="skillStrengthGeneral" name_key="perkMasterChefName" desc_key="perkMasterChefDesc" icon="ui_game_symbol_spatula">
		<level_requirements level="1"><requirement name="ProgressionLevel" progression_name="attStrength" operation="GTE" value="1" desc_key="reqStrengthLevel01"/></level_requirements>
		<level_requirements level="2"><requirement name="ProgressionLevel" progression_name="attStrength" operation="GTE" value="3" desc_key="reqStrengthLevel03"/></level_requirements>
		<level_requirements level="3"><requirement name="ProgressionLevel" progression_name="attStrength" operation="GTE" value="5" desc_key="reqStrengthLevel05"/></level_requirements>
		<level_requirements level="4"><requirement name="ProgressionLevel" progression_name="attStrength" operation="GTE" value="7" desc_key="reqStrengthLevel07"/></level_requirements>
		<level_requirements level="5"><requirement name="ProgressionLevel" progression_name="attStrength" operation="GTE" value="10" desc_key="reqStrengthLevel10"/></level_requirements>

		<effect_group>
			<passive_effect name="CraftingTier" operation="base_set" level="0,5" value="0,5" tags="perkMasterChef"/><!-- fake crafting perk that is used to scale resources -->
			<passive_effect name="CraftingTime" operation="perc_add" level="1,5" value="-.1,-.5" tags="perkMasterChef"/>

			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,5" value="1"
				tags="foodBaconAndEggs,foodBoiledMeat,foodGrilledMeat,foodBakedPotato,foodCornBread,foodCornOnTheCob,drinkJarRedTea,drinkJarCoffee,drinkJarGoldenRodTea,foodBreadLoaf"/>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="2,5" value="1"
				tags="foodSteakAndPotato,foodBlueberryPie,foodMeatStew,foodVegetableStew,foodPumpkinPie,foodPumpkinCheesecake,foodPumpkinBread"/>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="3,5" value="1"
				tags="foodShamChowder,foodHoboStew,foodFishTacos,drinkYuccaJuiceSmoothie,foodChiliDog,drinkJarBeer"/>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="4,5" value="1"
				tags="foodGumboStew,foodShepardsPie,foodSpaghetti,foodTunaFishGravyToast"/>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="5,5" value="1"
				tags="drinkJarGrandpasMoonshine,drinkJarGrandpasAwesomeSauce,drinkJarGrandpasLearningElixir"/>

			<effect_description level="1" desc_key="perkMasterChefRank1Desc" long_desc_key="perkMasterChefRank1LongDesc"/>
			<effect_description level="2" desc_key="perkMasterChefRank2Desc" long_desc_key="perkMasterChefRank2LongDesc"/>
			<effect_description level="3" desc_key="perkMasterChefRank3Desc" long_desc_key="perkMasterChefRank3LongDesc"/>
			<effect_description level="4" desc_key="perkMasterChefRank4Desc" long_desc_key="perkMasterChefRank4LongDesc"/>
			<effect_description level="5" desc_key="perkMasterChefRank5Desc" long_desc_key="perkMasterChefRank5LongDesc"/>
		</effect_group>
	</perk>
</append>
</configs>

 

"ArgumentException: An item with the same key has already been added. Key: perkmasterchef"

 

This is what i dont get, im not "Adding" im "Appending".

 

I tried this approach also, which got it to shut up about not applying. But it does jack. Ive tried multiple permutations of the append part and none of them seem to add the recipe to the existing entry.

 

<configs>
<append xpath="/progression/perks/perk[@name='perkMasterChef']/effect_group/passive_effect[@level='1,5']/@tags">foodBreadLoaf</append>
</configs>

 

 

 

Link to comment
Share on other sites

Finally i managed to do what i set out to do using the following code:

 

<configs>
<append xpath="/progression/perks/perk[@name='perkMasterChef']/effect_group/passive_effect[@level='1,5']/@tags">,foodBreadLoaf</append>
</configs>

 

I found the Wiki page for XML Xpath for 7 days to die.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...