With the introduction of modlets and the ability to mix and match mods together, it's been discussed that there may be conflicts that will arise if proper care is not taken. These guidelines are based around the modlet concept, where the code is distributable and can be re-used in many different mods.
With the id system for items and blocks dropped, uniqueness is now based on the block and item name. The system may not throw an error when a duplicate name occurs, but it appears that the last item and block loaded with the shared name, will take priority over earlier references.
This post will outline some best practices to help modders avoid possible mod conflicts.
Here are some of the guidelines to help you come up with a unique naming convention for your mods. Some mods may be able to use one method, while others would use another.
1) Use the mod name as a unique identifer. This identifier should carry forward through your folder name, and a prefix to items, recipes, windows, and asset bundles
Example:
Mods/ScrapMetalTools/
<item name="scrapMetalTools_Axe">
<item name="scrapMetalTools_Pickaxe">
<item name="scrapMetalTools_Shovel">
This goes for adding new XUI elements as well.
Mods/ScrapMetalTools/
<window name="ScrapMetalTools_windowJournalList" />
<window name="ScrapMetalTools_windowTrader" />
Asset Bundles and item icons as well
Mods/ScrapMetalTools/Resources/scrapMetalTools_Axe.unity3d
Mods/ScrapMetalTools/ItemIcons/scrapMetalTools_Axe.png
Folder name examples:
Mods/SphereII_WinterProject/
Mods/RyanJames_WinterProject/
Mods/SMXmainMenu/
Mods/SMXhud/
2) Avoid using excessive abbreviations
Some mods will be expected to be used a lot in other mods, with some tweaks done each time. It's best to be clear on your named values to make these changes easier. The less questions you have to deal with, with regards to your naming convention, the easier your support efforts will be.
3) Avoid removing nodes, or changing them drastically, unless its critical to your mod design
Avoid making assumptions that make changes beyond the expectations of the mod. For example, if you are adding scrap tools, don't make the assumption that stone tools need to be removed, or that iron and steel tools need to be radically adjusted to allow them to fit. Nor would we expect food values change in a scrap tool modlet.
If you are designing a UI, avoid making an assumption that your UI may be the only one installed. Some may want the menu system to look different than your design. In this case, make two mods: One for the UI, and one for the menu.
4) Avoid prefacing the mod name by using numbers
The load order of the mods is currently alphabetical, with the bottom of the list taking priority over any previous changes. A player or modder applying a modlet would be responsible for adding any kind of numeric number or changing the mod's folder to change the load order they so desire.
Example:
Mods/AnotherFakeClub/ - Changes stone axe to be a club
Mods/FakeClub/ - Changes stone axe to be a torch
Result: The stone axe will be a torch.
Another Example:
Mods/0_FakeClub/ - Changes stone axe to be a torch
Mods/1_AnotherFakeClub/ - Changes stone axe to be a club
Result: The stone axe will be a club.
With the id system for items and blocks dropped, uniqueness is now based on the block and item name. The system may not throw an error when a duplicate name occurs, but it appears that the last item and block loaded with the shared name, will take priority over earlier references.
This post will outline some best practices to help modders avoid possible mod conflicts.
Here are some of the guidelines to help you come up with a unique naming convention for your mods. Some mods may be able to use one method, while others would use another.
1) Use the mod name as a unique identifer. This identifier should carry forward through your folder name, and a prefix to items, recipes, windows, and asset bundles
Example:
Mods/ScrapMetalTools/
<item name="scrapMetalTools_Axe">
<item name="scrapMetalTools_Pickaxe">
<item name="scrapMetalTools_Shovel">
This goes for adding new XUI elements as well.
Mods/ScrapMetalTools/
<window name="ScrapMetalTools_windowJournalList" />
<window name="ScrapMetalTools_windowTrader" />
Asset Bundles and item icons as well
Mods/ScrapMetalTools/Resources/scrapMetalTools_Axe.unity3d
Mods/ScrapMetalTools/ItemIcons/scrapMetalTools_Axe.png
Folder name examples:
Mods/SphereII_WinterProject/
Mods/RyanJames_WinterProject/
Mods/SMXmainMenu/
Mods/SMXhud/
2) Avoid using excessive abbreviations
Some mods will be expected to be used a lot in other mods, with some tweaks done each time. It's best to be clear on your named values to make these changes easier. The less questions you have to deal with, with regards to your naming convention, the easier your support efforts will be.
3) Avoid removing nodes, or changing them drastically, unless its critical to your mod design
Avoid making assumptions that make changes beyond the expectations of the mod. For example, if you are adding scrap tools, don't make the assumption that stone tools need to be removed, or that iron and steel tools need to be radically adjusted to allow them to fit. Nor would we expect food values change in a scrap tool modlet.
If you are designing a UI, avoid making an assumption that your UI may be the only one installed. Some may want the menu system to look different than your design. In this case, make two mods: One for the UI, and one for the menu.
4) Avoid prefacing the mod name by using numbers
The load order of the mods is currently alphabetical, with the bottom of the list taking priority over any previous changes. A player or modder applying a modlet would be responsible for adding any kind of numeric number or changing the mod's folder to change the load order they so desire.
Example:
Mods/AnotherFakeClub/ - Changes stone axe to be a club
Mods/FakeClub/ - Changes stone axe to be a torch
Result: The stone axe will be a torch.
Another Example:
Mods/0_FakeClub/ - Changes stone axe to be a torch
Mods/1_AnotherFakeClub/ - Changes stone axe to be a club
Result: The stone axe will be a club.