Jump to content

I want to "add" not "replace"


Izayo

Recommended Posts

I want to add my own guns in the  "item_modifiers" without  replace the original one in  data/config

especially reflexsight and smallscope (2xscope) , 

 

FU4lPG.png

 

it's alway replace the original one I don't know what to do.

Link to comment
Share on other sites

As xmls are read top down, if you have items named the same that come later, it will just replace what was before. You'd need to rename them to something different for them to be separate item modifiers than the vanilla ones. Otherwise, when the xml is read, since your names are exactly the same, it will just keep whichever was read last (since you're using append, it will always be yours as append puts code at the end of the xml, just before the last closing tag)

Also, just to help you when you run into errors later, I see you have spaces in your weapon names. You'll one day encounter some issues if you do that. Some xmls do weird things when there is a space in an item name. You can use localization to add spaces and hyphens and what not. Just a tip for ya

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

5 minutes ago, Telric said:

As xmls are read top down, if you have items named the same that come later, it will just replace what was before. You'd need to rename them to something different for them to be separate item modifiers than the vanilla ones. Otherwise, when the xml is read, since your names are exactly the same, it will just keep whichever was read last (since you're using append, it will always be yours as append puts code at the end of the xml, just before the last closing tag)

Also, just to help you when you run into errors later, I see you have spaces in your weapon names. You'll one day encounter some issues if you do that. Some xmls do weird things when there is a space in an item name. You can use localization to add spaces and hyphens and what not. Just a tip for ya

will this work? 

FhuiLX.png

I try copying from Vanilla firearms extended a19 mod 

 

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