• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

How does the game handle multiple modlets that change the same xml config file?

pahbi

New member
Say for example an overhaul mod changes an item in items.xml but I also want to change the same item in items.xml

I would rather not change the items.xml from the overhaul mod, as I may need to re-download the overhaul mod if the author makes updates.

Ideally I would prefer the game apply the changes from the overhauls items.xml first, then apply the changes from my items.xml file second.

How would I do this?

Thanks

- P

 
Last edited by a moderator:
I believe it applies the modlets in alphabetical order, so if an earlier mod changes or removes something a later mod counted on, then there will likely be some kind of XSLT error or some undesired resulting XML.

The game does not currently have any awareness of modlet dependencies, anything that would attempt to load them in a dependent order, or anything that would tell you if a dependency was missing.

 
Yeah, mods are done in order.  If a mod just changes a value for something, another mod after it (later in alphabetical order) can change it to something else without any problem and that later mod will be the one that you'll see the effect of in the game.  The main problem, like ZZTong said, is if an earlier mod removes something and then the later mod tries to change that value.  It will not be able to because it was removed, so you can't change it.  However, if you know it was removed, you can make your mod add the thing back with the value you want instead of trying to change the value.  But this only works if you know for sure that the other mod is installed.  In other words, it works in your own game, or you can have your mod specifically tell people to only use it if the other mod is installed, but people can't just install it with or without the other mod installed.  You'd need different mod versions to cover having that other mod installed or not installed.

In short, if the other mod doesn't remove what you want to change, you can change it.  Just have your mod use a name that is later in alphabetical order.  If the other mod removes what you want to change, you'll need to add that back instead of trying to change it.

 
Sorry, I'm not really following the explanation.

The overhauls item.xml is in a folder called zzz_Core/config/items.xml

Are you saying I just need to put my file in a folder with a name like zzzz_Core/config/items.xml?

Thanks,

- P

 
It's complicated. And simple.

Yes if something is in that folder is changing something in xml file that another mod is changing.

Then it would have to go in a folder that in named so it is after the zzz_Core folder.

....but...

when a modder has to make a folder with that many zzz's it is because they think there is something in there that really, really needs to be loaded.

I have changed folder to be last myself but I am always prepared to live with the consequences that it may screw up my game.

And if it is something in the mod that doesn't kick in until later game then I may be "halfway" through a playthrough before anything conflicts.

 
It's complicated. And simple.

Yes if something is in that folder is changing something in xml file that another mod is changing.

Then it would have to go in a folder that in named so it is after the zzz_Core folder.

....but...

when a modder has to make a folder with that many zzz's it is because they think there is something in there that really, really needs to be loaded.

I have changed folder to be last myself but I am always prepared to live with the consequences that it may screw up my game.

And if it is something in the mod that doesn't kick in until later game then I may be "halfway" through a playthrough before anything conflicts.


I am kinda following.  :)

But I think I have enough information to try a few things and see what happens.

- P

 
In case this helps anyone in the future, this seems to be the answer.

Note:  I'm not treading any new ground here, all of this is probably documented somewhere else, but my search-FU is weak, and I couldn't find it.  Also there is a pretty good chance I'm getting something wrong here.  :)   You've been warned.

The short answer is the game merges multiple instances of the same xml config file.

For example, if there are multiple items.xml files, the game will read the files one at a time and apply them to the master index.xml file.

The order in which each items.xml file is applied depends on the name of the folder that houses the index.xml file in the mods directory.  

For example, imagine there are two folders that contain index.xml in the mods folder.

If one folder is called A and the other folder is called B, the index.xml in folder A will be applied first, and the index.xml in folder B will be applied second.  

And so on and so forth for every other index.xml in the mods folder.

Hope this helps,

- P

 
Last edited by a moderator:
Back
Top