Jump to content

Best way to change a single property in an item??


Recommended Posts

So on this item:

<item name="meleeToolClawHammer">
    <property name="RepairTools" value="resourceRepairKit"/>
</item>
 

what would be the best way to change the value of that property to somthing else?

 Would it be just:

<append xpath="/items">

<item name="meleeToolClawHammer">

<property name="RepairTools" value="NewValueYetToBeDetermined"/>
</item>
</append>

 

thanks

 

 

Link to comment
Share on other sites

11 minutes ago, mlburgoon said:

So on this item:

<item name="meleeToolClawHammer">
    <property name="RepairTools" value="resourceRepairKit"/>
</item>
 

what would be the best way to change the value of that property to somthing else?

 Would it be just:

<append xpath="/items">

<item name="meleeToolClawHammer">

<property name="RepairTools" value="NewValueYetToBeDetermined"/>
</item>
</append>

 

thanks

items.xml of your mod would look like this:

<configs>

  <set xpath="/items/item[@name='meleeToolClawHammer']/property[@name='RepairTools']/@value">NewValueYetToBeDetermined</set>

</configs>
Link to comment
Share on other sites

COOL!  So if I had a bunch of these to do, can I just do a the sets one after the other?  I am pretty sure I can, I just want to make sure before I create a huge xml and then have to scrap it.  LOL

 

Thanks for the info.

 

Link to comment
Share on other sites

21 minutes ago, mlburgoon said:

COOL!  So if I had a bunch of these to do, can I just do a the sets one after the other?  I am pretty sure I can, I just want to make sure before I create a huge xml and then have to scrap it.  LOL

 

Thanks for the info.

 

You're welcome. The best solution is the simplest one that works. I'm not sure what are you trying to achieve, but in general it's better to avoid writing a lot of code that could be simplified.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...