Jump to content

I'm afraid I don't properly understand MODMERGEATTRIBUTE


Max_Caine

Recommended Posts

I don't really understand how MODMERGEATTRIBUTE is used, and I was wondering if someone would be willing to help walk me through it.

As I understand it, if I want to add a new item in a standard XML file, I use MODMERGEATTRIBUTE to identify the elements which will be added to the main XML file and I enter the name of the element in the name field. So, if I want to say, add a new weapon, I do it like this:

<Weapon MODMERGEATTRIBUTE="weapon" MODMERGE="insert"

Is that right?

Link to comment
Share on other sites

When the merging code needs to merge an XML element from a mod's file in to the game's file, it needs to know what XML element in the game's file to merge it with. As the docs say, by default the matching is done using using the tag name, so in this case the code searches for key "Weapon" and finds a number of them, because the game's file has a number of <Weapon> elements, so it doesn't know with what, if any, to do the merge. MODMERGEATTRIBUTE adds the given attribute's content to the key used for matching, so in that case the code will search for an XML element which will give e.g. "Weaponak.47" and there should be at most one to match.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...