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

Losing my mind with xpath, help needed

Abrogator

New member
Ok, so in the base game, you get a loot probability bonus to crafting magazines when you spend points in their respective skills. When you max out the crafting skill, the bonus is removed but you still find those magazines in loot, just at the base chance.

I want to remove those magazines from loot all together once the crafting skill is maxed out.

As far as I can tell, this is handled by progression.xml, specifically this bit (using deadeye perk as an example)

<!-- Once rifle crafting skill reaches 100, set the probability bonus of finding rifle crafting skill magazines to 0 -->
<passive_effect name="LootProb" operation="base_set" level="1,5" value="1,1" tags="riflesCSM">
<requirement name="ProgressionLevel" progression_name="craftingRifles" operation="Equals" value="100"/>
</passive_effect>




Armored up magazines are a little different in that they are controlled by attributes instead of perks. I've set up the following xpath code in an effort to remove the magazines from the loot table once the crafting skill is maxed:

<configs>

<set xpath="progression/attributes/attribute/effect_group/passive_effect[@name='LootProb' and @operation='base_set']/@value">0,0</set>
<set xpath="progression/perks/perk/effect_group/passive_effect[@name='LootProb' and @operation='base_set']/@value">0,0</set>

</configs>




Maddeningly, this seems to work for Armored Up magazines and Rifle World magazines, but NOTHING ELSE. I was under the impression that this should apply the same effect to every single <passive_effect> with the name "LootProb" which is also using the operation "base_set". The only thing I can think of is that it is instead only applying to the first instance of that (which for perks would be the Dead Eye perk, hence this working for rifle world). But that doesn't explain why its working for Armored up, as every single attribute affects the loot probability for that one (or at least I think that's how it works). After resetting player data, it now no longer works for rifle world. Just armored up. WHAT IS GOING ON?!

I'm testing this by opening crafting magazine bundles in creative and despite the fact that I have set vehicles, farming, robotics, and spears to max crafting level, I'm still getting the magazines for those.

 
Last edited by a moderator:
your are testing your work incorrectly.

<item name="questRewardLegendaryMotorToolsCraftingBundle">
<property name="Extends" value="questRewardBundleMaster"/>
<property name="CreativeMode" value="Player"/>
<property name="CustomIcon" value="bundleTools"/>
<property name="CustomIconTint" value="D580FF"/>
<property name="ItemTypeIcon" value="bundle"/>
<property name="DescriptionKey" value="questRewardLegendaryMeleeWeaponCraftingBundleDesc"/>
<property class="Action0">
<property name="Create_item" value="resourceLegendaryParts,meleeToolAxeT3ChainsawParts,ammoGasCan,harvestingToolsSkillMagazine"/>
<property name="Create_item_count" value="1,6,1000,3"/>
</property>
</item>




You can see here, that when you open a crafting bundle, the game is creating items, some of which will be those magazines.

These bundles are not affected by loot probability. You will need to test your work in another fasion. You may need to create a prefab with 100 loot boxes in a row, or fly through the world and locate the corresponding block to loot.

 
Ah OK. That's a shame, those are the primary things I was wanting to affect. Looks like the mod is going to need to be a bit more involved than I initially planned.

 
Crap, I did my own tests with your code and didn't see them, but forgot to come back to this post and let you know what I saw.

I didn't use the crafting bundles like backdownhipi stated, but instead used loot crates.  I think I ended up using Shotgun Messiah and Crack a Books.  Inserted your code in a test module on my end, loading up a test world, and maxed out agility perks and crafting trees.  I wasn't seeing magazines for knives, guns, armor, or bows after they maxed out their levels...but that was also a short test so probabilities were not 100% confirmed.

 
Back
Top