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

xpath help for Trader.xml change

Jolly

New member
I'd like to add an item group to this:

<!-- Vending Machines found in the world. -->

<trader_info id="4" 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">

<item group="foodAll" />

</trader_items>

</trader_info>

I'd like to add the ammo item group after the foodall item group but for the life of me every attempt to do this via an xpath command has failed. A direct edit to the traders xml works though. Can anyone assist ? While i wont publish what I'm working on as a modlet as it will be a collection of other peoples work i have amended i will post the code for the collection of trader changes in case people might want to see them.

 
Something like this:

Code:
<configs>
<!-- create the group -->
<append xpath="/traders/trader_item_groups">
  <trader_item_group name="somenewgroup">
		<item name="pufferCoat"/>
  </trader_item_group>
</append>
<!-- add the group to the vending machines found in the world -->
<append xpath="/traders/trader_info[@id='4']/trader_items">
   <item group="somenewgroup"/>
</append>
</configs>
 
Thanks

For anyone interested - I've amended some of Jaxtellers Trader changes to look like this:

<set xpath="/traders/trader_info/[@id=1]/@reset_interval">1</set>

<set xpath="/traders/trader_info/[@id=1]/@open_time">4:05</set>

<set xpath="/traders/trader_info/[@id=3]/@allow_sell">true</set>

<set xpath="/traders/trader_info/[@id=4]/@allow_sell">true</set>

<set xpath="/traders/trader_info/[@id=5]/@allow_sell">true</set>

 
Back
Top