Tutorial: How to Add a False Dependency for Load Orders
False dependencies are one method of managing load orders for Stardew Valley mods. Say that you have two mods that you would like to use together: Mod A, Incredible Items, changes every item sprite, while Mod B, New Apple Sprite, changes only a single item sprite. By default, SMAPI will load every mod in alphabetical order and so there will be no problems here since Incredible Items will replace everything and then New Apple Sprite will overwrite only Incredible Items' apple sprite. However, if the mod names are not conveniently in alphabetical order - for example, if you would like to use Mod C, Beautiful Apple, instead - then adding a false dependency will tell SMAPI to load one mod after another.
Instructions:[edit | edit source | hide | hide all]
1) Open the manifest.json file of the mod you want to load second, overwriting the first mod, and check if there is already a Dependencies section. If there is, go to Step 2B.
2A) If there isn't a Dependencies section, you'll need to add one. The manifest.json code should look similar to this:{
"Name": "Mod Name",
"Author": "Mod Author",
"Version": "1.0.0",
"Description": "Description of the mod.",
"UniqueID": "ModAuthor.SecondMod",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "ModDrop:1073357"],
"ContentPackFor": {
"UniqueID": "Pathoschild.ContentPatcher",
"MinimumVersion": "1.19.0"
},
}
"Dependencies": [
{
"UniqueID": "ModAuthor.ModName",
"IsRequired": false,
},
{
"UniqueID": "ModAuthor.ModName",
"IsRequired": false,
},
{
"Name": "Mod Name",
"Author": "Mod Author",
"Version": "1.0.0",
"Description": "Description of the mod.",
"UniqueID": "ModAuthor.SecondMod",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "ModDrop:1073357"],
"ContentPackFor": {
"UniqueID": "Pathoschild.ContentPatcher",
"MinimumVersion": "1.19.0"
},
"Dependencies": [
{
"UniqueID": "ModAuthor.FirstMod",
"IsRequired": false,
},
]
}
Additional Notes:[edit | edit source | hide]
- A false dependency is called so because of the ["IsRequired": false,] line of code. False tells SMAPI that the dependency is not mandatory and is only there for load order purposes, allowing Mod B to still work if Mod A is not installed. Setting this to true will tell SMAPI that the dependency is required and Mod B will not load if Mod A is not installed.
- Manifest dependencies will take priority over alphabetical load order. Another method of forcing a specific load order is to rename the mod folder so that it has "z_" at the front of the folder name, so that it will load later in the alphabet, but this is not always reliable due to SMAPI's loading preferences.
- If you try to use the altered mod and it creates red text in your SMAPI console, go back to Step 5 and validate your manifest.