Overriding Native XML files using Submodules

Users who are viewing this thread

Hey, old time modder here, I been seeing some good mods come out (like party limits etc)

One issue i'm having with 90% of these mods is they're just shoving it into the main module, which in the long run is a bad idea. (IE: Dev's update said file, now that mod is gone and you have to reinstall it)

With Submodules it'll never get overridden unless you make it do that.


So my question is: How do I override a specific XML within a specific module of the native? The documentation states you can override native values, but does not state how

Thanks in advanced
 
This is exactly what I'm having issues with.
A mod I've tested is working (when amended in the Native folder), but I can't find a way to overwrite the file that I've modded from the Native module, in my own Module.
 
Upvote 0
Pretty sure you just match the folder structure of the xml file you're looking to override. For instance:
Native -> GUI -> Prefabs -> ButtonCancel.xml
MyMod -> GUI -> Prefabs -> ButtonCancel.xml

The changes made to ButtonCancel.xml within MyMod will override what's in Native. Not sure if this is what you were looking for or not. Let me know!
 
Upvote 0
Generally speaking if you're editing an element with the same id attribute as an existing element it will overwrite it. Now if that element has child elements it won't remove them.

So for instance, I was trying to make an adjustment to change the equipsets of the looters that are already in bandits.xml in SandBox with my submodule.

My element of <NPCCharacter id="looter" /> overrode the default element with the new name that I gave them.
The new child elements that I created for the alternate equipsets also became available for looters

However, the existing equipsets that were already defined were still there, and since these don't have ids, I can't specifically override them. I can just add more.

This would require some kind of code patch to do more.
 
Upvote 0
Generally speaking if you're editing an element with the same id attribute as an existing element it will overwrite it. Now if that element has child elements it won't remove them.

So for instance, I was trying to make an adjustment to change the equipsets of the looters that are already in bandits.xml in SandBox with my submodule.

My element of <NPCCharacter id="looter" /> overrode the default element with the new name that I gave them.
The new child elements that I created for the alternate equipsets also became available for looters

However, the existing equipsets that were already defined were still there, and since these don't have ids, I can't specifically override them. I can just add more.

This would require some kind of code patch to do more.


The best way around this is to create a new unit that is an exact copy of the other (eg. battania_peasant to battania_peasant1) and work it into the troop tree while removing upgrade paths to the old unit.

I do this in the personal mods I've made.
 
Upvote 0
im still confused here
Tried adding a mod to add crafting pieces
If i add the crafting pieces to the Native module they work
When i add a file called crafting_pieces to my mode and add my own pieces there , they don't work (the game loads normally)
I added the XMLs to submodule
Like this :


<XmlNode>
<XmlName id="CraftingPieces" path="crafting_pieces"/>
<IncludedGameTypes>
<GameType value = "Campaign"/>
<GameType value = "CampaignStoryMode"/>
<GameType value = "CustomGame"/>
</IncludedGameTypes>
</XmlNode>


and i added the method called in xml_attributes_to_be_identified.txt like this : Testing/ModuleData/crafting_pieces.xml: CraftingPieces.CraftingPiece.name

But the pieces do not appear in game

Any idea whats going on ?
Also , if i have the same file name (crafting_pieces.xml) in my mod , is it supposed to be merged with the orignal one from Native?
Or are they only looking for anything under <CraftingPieces> in any XML ?
Because it does not seem to overwrite the original so there is something more going on
 
Upvote 0
Back
Top Bottom