Max_Caine Posted September 18, 2014 Share Posted September 18, 2014 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? Quote Link to comment Share on other sites More sharing options...
llunak Posted September 18, 2014 Share Posted September 18, 2014 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. Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted September 18, 2014 Author Share Posted September 18, 2014 If I have understood you correctly, I can give MODMERGEATTRITUBUTE's value any name, provided it's unique to uniquely identify it. Thank-you! Quote Link to comment Share on other sites More sharing options...
llunak Posted September 18, 2014 Share Posted September 18, 2014 (edited) Not any name, name of an attribute that uniquely identifies it. In 95% of cases it's going to be MODMERGEATTRIBUTE="name" (literally). Edited September 18, 2014 by llunak Quote Link to comment Share on other sites More sharing options...
Max_Caine Posted September 18, 2014 Author Share Posted September 18, 2014 Right, so I didn't understand you correctly. My apologies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.