Jump to content

Help me fix this code


Recommended Posts

<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

Edited by DerRadikaleRichard (see edit history)
Link to comment
Share on other sites

39 minutes ago, DerRadikaleRichard said:

<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

Link to comment
Share on other sites

5 minutes ago, DerRadikaleRichard said:

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.

Link to comment
Share on other sites

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

Edited by BFT2020 (see edit history)
Link to comment
Share on other sites

If you are trying to remove just part of the attribute, you would need to use removeattribute

 

The code for that would be

 

 

<removeattribute xpath="/items/item[@name='gunRifleT2LeverActionRifle' or @name='gunMGT1AK47' or @name='gunMGT2TacticalAR' or @name='gunMGT0PipeMachineGun']/property[@class='Action0']/property[@name='Magazine_items']/@value">
</removeattribute > 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...