Skip to content

Dependencies and Load Ordering

AlexejheroYTB edited this page Aug 15, 2020 · 3 revisions

Knowing you can add dependencies and load order preferences to your mod.json manifest, you may want to know more about how QModManager will sort all this.

Without going into detail about the inner workings of how mod load order is handled, here are a few rules that QModManager follows when preparing the final, ordered list of mods to initialized.

Mods with no dependencies or order preferences will load first

So simple mods that don't need external libraries will be loaded first.
And if you happen to forget to list a common dependency, then it is more likely that it will be loaded before the dependency anyways.

Dependencies will be loaded after mods that depend on them

This makes anything in the "Dependencies" or "VersionDepencencies" lists effective a mandatory "LoadBefore".
It also means that if you include a Dependency, then you don't also need to include a "LoadBefore" entry.

Mods only in LoadBefore and LoadAfter are considered optional

Use this if you have optional cross-mod functionality that requires that one mod be loaded before or after another.

Let's see an example

{
  "Id": "BestMod",
  "DisplayName": "Best Mod",
  "Author": "Awesome Guy",
  "Version": "1.0.0",
  "Dependencies": [ "DependencyModID" ],
  "VersionDependencies": { 
    "SMLHelper": "2.0", 
    "AnotherVeryImportantMod": "1.2.3" 
  },
  "LoadBefore": [ "AModID", "SomeOtherModID" ],
  "LoadAfter": [ "AnotherModID" ],
  "Enable": true,
  "Game": "Subnautica",
  "AssemblyName": "BestMod.dll"
}

From our example mod.json, this is how this would be validated and sorted:

  1. BestMod will not load at all unless
    • DependencyModID mod is present
    • SMLHelper is present and is at least at version 2.0 or higher
    • AnotherVeryImportantMod is present and is at least version 1.2.3 or higher
  2. If AModID and/or SomeOtherModID are present then BestMod will be loaded before those
    • If neither are present then BestMod will continue loading as normal
  3. If AnotherModID is present then BestMod will be loaded after it
    • If it is not present then BestMod will continue loading as normal
  翻译: