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

Help me fix this code

<remove xpath="items/item[@name='gunRifleT2LeverActionRifle' or @name='gunMGT1AK47' or @name='gunMGT2TacticalAR' or @name='gunMGT0PipeMachineGun']/@value">

ammo762mmBulletBall,ammo762mmBulletHP,ammo762mmBulletAP

</remove> 

i want to remove all 762mm ammo from the lists of these guns but it doesnt work

adding ammo with <append> works fine

 
Last edited by a moderator:
<remove xpath="items/item[@name='gunRifleT2LeverActionRifle' or @name='gunMGT1AK47' or @name='gunMGT2TacticalAR' or @name='gunMGT0PipeMachineGun']/@value">

ammo762mmBulletBall,ammo762mmBulletHP,ammo762mmBulletAP

</remove> 

i want to remove all 762mm ammo from the lists of these guns but it doesnt work

adding ammo with <append> works fine


Hi Richard

I think you are missing a / before the word items, it sure works for you.
Regards

 
nope that wasnt it, the game actually reads the code without an error but instead gives me a warning that it didnt apply it to the xml but it doesnt tell me why

WRN XML patch for "items.xml" from mod "Richards weapon overhaul" did not apply

 
The Wrn Xml is just a minimal warning, not a error.

Because you better not modify the xml file directly from the Overhaul Richard and remove the ammunition that you do not want for the weapon, it would be easier.
Regards

 
i know i allways edited the vanilla xmls in the past but then my mod is incompatible with most other mods


If your mod is incompatible with other mods, it is because they apply something the same as yours (items, loot, blocks, etc), but it is easy to correct them.
You say that adding "append" works for you, then apply it that way.
Regards

Apply using "set xpath" instead of "remove" and see if it works for you.

But change the type of ammunition, the one you want to serve only in those weapons.

 
I think you don't have the full path for it.  Try this instead

<remove xpath="/items/item[@name='gunRifleT2LeverActionRifle' or @name='gunMGT1AK47' or @name='gunMGT2TacticalAR' or @name='gunMGT0PipeMachineGun']/property[@class='Action0']/property[@name='Magazine_items']">
</remove> 




However, that removes the ammo value completely.  If you are changing the ammo, you should just do set xpath as recommended by Gouki or append

 
Last edited by a moderator:
If you are trying to remove just part of the attribute, you would need to use removeattribute

The code for that would be

Code:
[COLOR=#e8bd89]<removeattribute[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]xpath[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"/items/item[@name='gunRifleT2LeverActionRifle' or @name='gunMGT1AK47' or @name='gunMGT2TacticalAR' or @name='gunMGT0PipeMachineGun']/property[@class='Action0']/property[@name='Magazine_items']/@value"[/COLOR][COLOR=#e8bd89]>
[/COLOR]</removeattribute[COLOR=#ebe7e3] [/COLOR]>[COLOR=#ebe7e3] [/COLOR]
 
Back
Top