Jump to content

Help wanted for adjusting loot.xml for A19 to A20 update


Recommended Posts

Hi ya'll, thanks for looking 😊

I've got a mod where the loot.xml broke upon the A20 update; and now, I can't get it to work again. 

I have a lot of food/drink items in my mod that I'd like scattered around the different loot options such as fridges, cupboards, trash, grills, ovens, etc.

As an example, I'd like some of my caffeine drinks I've made to be lootable from the Coffee makers, but no matter how I set it up, I can't get it to work. It feels like I'm missing something obvious, but for the life of me, I can't figure out what 😅

 

Would anyone be able to post an example of how it should be set up using the new lootgroups/probability templates to help me out, applying the item "Latte" to the Coffee makers, and/or help me figure out where I went wrong? 

 

Hopefully someone can help me. Thanks in advance ☺️

Link to comment
Share on other sites

3 hours ago, BFT2020 said:

Did your mod use IDs for loot containers?  That was probably the biggest change to loot.xml and number one reason Alpha 19 mods don’t work.  Loot containers are now referenced by name (ignore the ID variable)

Hi! 

 

Yes, they did, which is indeed why it doesn't work anymore. I'd love it set up better this time, using groups instead of individual locations with items if that makes sense? 

 

But despite my attempt at simply changing my old layout to the new container names instead of IDs, I'm still not having any luck 😕

 

Any chance you could help me by throwing out a quick example on how it should be set up now? 

Link to comment
Share on other sites

6 minutes ago, BFT2020 said:

Copy some of your code here and I will look it over.  It's better if I see what you are trying to do and I can make adjustments to get it working correctly.

Thanks a lot - that'll help me more, too; will help me figure out where I went wrong to I can avoid it in the future :)

I'll post some of it shortly

Link to comment
Share on other sites

This is what the A19 coding looked like; I grabbed a snippet of the "Oven/stove" section and removed a lot of items except 2 as I don't imagine the examples need to be super long.

<!-- Oven -->
    <append xpath="/lootcontainers/lootcontainer[@id='11']">    
        <item group="Meatloaf" count="1" prob="0.1"/>    
        <item group="Cheese Pizza" count="1" prob="0.02"/>
    </append>

For A20, I changed it to the following;

<!-- Oven -->
    <append xpath="/lootcontainers/lootcontainer[@name='groupOven01']">    
        <item group="Meatloaf" count="1" prob="0.1"/>    
        <item group="Cheese Pizza" count="1" prob="0.02"/>
    </append>

For this, I get a yellow error labeled: WRN XML Patch for "loot.xml" from mod "FoodStuff" did not apply: <append xpath="//lootcontainers/lootcontainer[@name='groupOven01']"  

Link to comment
Share on other sites

Try this instead

 

<!-- Oven -->
    <append xpath="/lootcontainers/lootgroup[@name='groupOven01']">    
        <item group="Meatloaf" count="1" prob="0.1"/>    
        <item group="Cheese Pizza" count="1" prob="0.02"/>
    </append>

 

Change lootcontainer to lootgroup.   The oven container looks for item group groupOven which groupOven01 is part of.

 

The yellow warning was telling you that while your syntax was correct, the game could not find the location you would calling for the change.

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

11 minutes ago, BFT2020 said:

Sorry, I missed that.  Meatloaf and Cheese pizza should be name not group (I am assuming that you defined Meatload and Cheese Pizza in the items.xml file.

 

so 

        <item name="Meatloaf" count="1" prob="0.1"/>  

 

That did it; it works now! Thank you so much for your help; I can't believe I couldn't figure that out on my own, so I really appreciate your assistance 🤗 Now I know what I did wrong, so setting up the rest of the items/categories/locations should be fairly easy 😄

Link to comment
Share on other sites

No worries.  I wish I could say I never make that kind of mistake, but I just spent the past half hour trying to figure out why some coding I was working on for work was not doing anything only to realize I was checking a variable to itself so it always came back true  🤪

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