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

Clarification please on Trader xml file

BFT2020

Hunter
First, my apologies if this was already asked and I missed the topic.  I search in this sub-forum for trader and secret; none of the posts popped up to answer my question.

I am making some small modifications to the trader.xml file, which is basically limiting what the traders offer based on their specialty.  For example, in Jen's section, the only items in the first part are this

    <trader_info id="2" full_reset="true" min_inventory="30" max_inventory="70" min_items_swapped="20" max_items_swapped="20"
        reset_interval="7" open_time="4:05" close_time="23:50">
        <trader_items count="all">
            <item group="rareMedicine" count="2" prob="1"/>
            <item group="medicine" count="2,5" prob="1"/>
            <item group="traderAlways"/>
            <item group="traderGeneral" count="4,8"/>
            <item group="generalResources" count="9,14"/>
            <item group="modAllT1SecretStash" count="1,2"/>
        </trader_items>

I am still going through all the groups so I want to see what traderAlways, traderGeneral, and traderResouces have in those groups.  My goal is to make it medical supplies for her and basic resources (for the others, I will doing the same thing but based on their specialties).

What I don't 100% understand are the next groups:

<tier_items level="1,499" count="all"> <!-- requires Perk 0 -->
<tier_items level="3000,3999" count="all"> <!-- requires Perk 3 -->

My assumption is those are the ones tied to the secret stash?  My end goal is that if I want specialty items like solar cells and banks, I would have to travel to Bob and see if he has them in stock, no-one else would.

Thanks,

Amateur modder

 
Last edited by a moderator:
Yeah, Perk 0 is what a new character starts at. Goes up each level of Better Barter from there.

The first group is what they will always stock, so anything that is in that group for a trader that you don't want will need to be removed.

 
Yeah, Perk 0 is what a new character starts at. Goes up each level of Better Barter from there.

The first group is what they will always stock, so anything that is in that group for a trader that you don't want will need to be removed.
Thanks, nice to have confirmation before I went too far.

Another quick question:

I understand the symbols needed for comments.  If I want to organize my groups by item types (inside the group), but don't want to comment those, does a space in-between cause any issues or will it run fine?  I am assuming no issues as long as I don't insert any hidden characters into that line

            <item name="meleeWpnKnucklesT3SteelKnucklesSchematic"/>

            <item name="thrownAmmoPipeBombSchematic"/>
            <item name="thrownGrenadeSchematic"/>
            <item name="thrownAmmoPipeBombSchematic"/>
            <item name="thrownDynamiteSchematic"/>
            <item name="thrownGrenadeContactSchematic"/>

            <item name="resourceMilitaryFiberSchematic"/>
            <item name="armorMilitarySetSchematic"/>
            <item name="armorSteelSetSchematic"/>

        </trader_item_group>

 
Okay I jumped into this modding fully, I am now converting my modified data file into a modlet so I can have it patch whatever version I play or see if it works with other mods without breaking them.

I got set xpath to work on some areas, but can't figure out what I am doing wrong on a specific piece of the code

    <set xpath="/traders/@buy_markup">5</set>
    <set xpath="/traders/@sell_markdown">0.2</set>
    <set xpath="/traders/trader_info/id=4/@reset_interval">30</set>
    <!--<set xpath="/traders/trader_info/id=4/@min_inventory">15</set>
    <set xpath="/traders/trader_info/id=4/@max_inventory">30</set>-->


In my file, I put these 5 lines first to change specific values in the traders.xml file and then later make changes (overwrite them) to various trader_item_groups and the NPC traders in the world.  I don't make any overwrites to the vending machines trader_info.  This is the error I am getting

2021-09-05T07:55:56 27.916 ERR XML loader: Patching 'traders.xml' from mod 'Z-JeremyMod' failed:
2021-09-05T07:55:56 27.916 EXC Expression must evaluate to a node-set.


I know it is tied to the pathing of the node set, but I am not sure what exactly I am doing wrong.  The first two work fine, but I get this error when I try to change values for the vending machines in the world.  I am probably missing something simple or got my coding wrong

    <!-- Vending Machines found in the world. -->
    <trader_info id="4" full_reset="true" reset_interval="1" override_buy_markup="1.0" allow_sell="false" min_inventory="6" max_inventory="13" min_items_swapped="6" max_items_swapped="13">
        <trader_items count="10">


Here is my traders file

https://pastebin.com/RmuPaKq1

Thanks

 
Nevermind, I am a schmuck

I went back to the tutorial and read through it again, I had to change ID=4 in my code to [@id='4']

 
Back
Top