Jump to content

Custom Buried Treasure


Recommended Posts

Hi all, I have a problem with custom loot regarding Buried Treasure.

I am not really a modder by any means, but I wanted to buff what you could find inside the Buried Treasure (from the maps that randomly drop) due to them feeling lackluster compared to just.. farming quests or farming the mats for bullets (since these boxes basically just drop bullets and money)

 


here is the loot.xml modlet I made:

 

 

<append xpath="/lootcontainers/lootgroup[@name='groupBuriedTreasure']" >


        <!--SKILL BOOKS-->
        <item group="skillMagazines" count="2,4" prob="0.60" />
        <!--RARE FOOD/DRINK-->        
        <item group="groupDrinksRare" count="2,5" prob="0.75" />
        <item group="rareFoodDrink" count="2,5" prob="0.75" />    
        <!--IRON/STEEL AND FIBER-->
        <item group="groupCraftingRare" count="1,4" prob="0.85" />    
        <!--WEAPON MOD BUNDLES BOOKS-->
        <item name="questRewardT1MeleeModsBundle" count="1" prob="0.75" />
        <item name="questRewardT2MeleeModsBundle" count="1" prob="0.45" />
        <item name="questRewardT3MeleeModsBundle" count="1" prob="0.15" />
        <item name="questRewardT1RangedModsBundle" count="1" prob="0.75" />
        <item name="questRewardT2RangedModsBundle" count="1" prob="0.45" />
        <item name="questRewardT3RangedModsBundle" count="1" prob="0.15" />        
        <!--RARE TOOLS-->        
        <item name="meleeToolPickT3Auger" count="1" prob="0.02" />
        <item name="meleeToolAxeT3Chainsaw" count="1" prob="0.02" />
        <!--RARE APPAREL-->
        <item name="apparelCoatJacketLetterZU" count="1" prob="0.3" />
        <item name="apparelRunningShoesHP" count="1" prob="0.3" />


none of these percentages are finalized, I just wanted to see the functionality/see if I could get it working, and the items do spawn in these Treasure Chests, but they seem to spawn with 100% certainty, which I do not want. for example, I wanted the auger/chainsaw to have a very low drop chance (between 1-2% or static 2%) but after opening a few boxes, it seems to always drop everything. I think maybe I misread the function of the "prob" parameter as I thought that would limit the chance of it appearing in the chest.

 

Link to comment
Share on other sites

8 hours ago, ZuluBtw said:

Hi all, I have a problem with custom loot regarding Buried Treasure.

I am not really a modder by any means, but I wanted to buff what you could find inside the Buried Treasure (from the maps that randomly drop) due to them feeling lackluster compared to just.. farming quests or farming the mats for bullets (since these boxes basically just drop bullets and money)

 


here is the loot.xml modlet I made:

 

 

<append xpath="/lootcontainers/lootgroup[@name='groupBuriedTreasure']" >


        <!--SKILL BOOKS-->
        <item group="skillMagazines" count="2,4" prob="0.60" />
        <!--RARE FOOD/DRINK-->        
        <item group="groupDrinksRare" count="2,5" prob="0.75" />
        <item group="rareFoodDrink" count="2,5" prob="0.75" />    
        <!--IRON/STEEL AND FIBER-->
        <item group="groupCraftingRare" count="1,4" prob="0.85" />    
        <!--WEAPON MOD BUNDLES BOOKS-->
        <item name="questRewardT1MeleeModsBundle" count="1" prob="0.75" />
        <item name="questRewardT2MeleeModsBundle" count="1" prob="0.45" />
        <item name="questRewardT3MeleeModsBundle" count="1" prob="0.15" />
        <item name="questRewardT1RangedModsBundle" count="1" prob="0.75" />
        <item name="questRewardT2RangedModsBundle" count="1" prob="0.45" />
        <item name="questRewardT3RangedModsBundle" count="1" prob="0.15" />        
        <!--RARE TOOLS-->        
     
        <item name="meleeToolAxeT3Chainsaw" count="1" prob="0.02" />
        <!--RARE APPAREL-->
        <item name="apparelCoatJacketLetterZU" count="1" prob="0.3" />
        <item name="apparelRunningShoesHP" count="1" prob="0.3" />


none of these percentages are finalized, I just wanted to see the functionality/see if I could get it working, and the items do spawn in these Treasure Chests, but they seem to spawn with 100% certainty, which I do not want. for example, I wanted the auger/chainsaw to have a very low drop chance (between 1-2% or static 2%) but after opening a few boxes, it seems to always drop everything. I think maybe I misread the function of the "prob" parameter as I thought that would limit the chance of it appearing in the chest.

 

 

The reason that it is doing this is based on lootgroup for that container.  if you look at it, it states count="all".  Since it states all for count, that means when the game is trying to determine what goes into that container, it is going to pull at least once for each group (unless the individual group as a varied count). With the way you have it structured in your code, everything you added to the chest is a separate group...so even though you have lower percentages,  it has to pull at least once item from each group.

 

There are two ways of addressing that.  One is putting all these items into a new group with a percentage of pulling from it.  For example,

 

<lootgroup name="groupCustomRareItems">
    <item name="meleeToolPickT3Auger" count="1" prob="0.02"/>
    <item name="meleeToolAxeT3Chainsaw" count="1" prob="0.02"/>
    <item name="apparelCoatJacketLetterZU" count="1" prob="0.3"/>
    <item name="apparelRunningShoesHP" count="1" prob="0.3"/>
    <item name="casinoCoin" count="50,100" prob="0.6"/>
</lootgroup>

 

If this group was added to the lootcontainer group, then when it pulls one item from it, it will be based on the probability chances for each item (so rarely getting the Auger or Chainsaw, likely to get the jacket or shoes, and best chance of just getting coins).

 

A simpler way is to force the game to use the probability.  Add this to each item you added to the loot group and it should not be a guaranteed pick:

 

force_prob="true"

 

So now this is what you should have

 

  <item name="meleeToolPickT3Auger" count="1" prob="0.02" force_prob="true"/>

 

 

Link to comment
Share on other sites

thank you for the help! I tried to reply a little earlier but the post didnt seem to go through. this is the second time you've replied to my thread, so I just want to say thank you for helping out, as I appreciate it, and im sure many others do too. I will be editing the loot / containers stuff later tonight, if I cant get it to work I will repost in here, but I believe I understand how it works now, so thanks!

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