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

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

Iceburg71

Refugee
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

 
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:

Code:
<configs>

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

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

 
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.

 
Last edited by a moderator:
Back
Top