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

how do i add a property to an existing item.

nioton6

New member
so im working with xappending and im trying to add a pickup property to the shamway box without editing the xml directly

can someone send me the code or an example

 
Find the node you want to add it after, then use append for the can pick is true bit.

Is that what you're looking for?

 
so im working with xappending and im trying to add a pickup property to the shamway box without editing the xml directly can someone send me the code or an example
You can use this to have a shamway box go into your inventory upon destroying it:

<append xpath="/blocks/block[@name=cntLootCrateShamway]">,<drop event="Destroy" name="cntLootCrateShamway" count="1" /> </append>

Since it is a child to a parent block, you'll also get the resources the parent block gives upon being destroyed which is paper in this case. If you don't want the paper and only the box itself then you can add this to only get the box:

<append xpath="/blocks/block[@name=cntLootCrateShamway]">,<drop event="Destroy" name="resourcePaper" count="0" /> </append>

If there is a way to combine those into 1 entry then I'm not sure how to do it. I'm still trying to get the hang of xpath. I did test the code above to make sure it would put the shamway box in your inventory upon destroying it. You can then place it again wherever you want it.

Hope this helps.

 
Back
Top