User Tools

Site Tools


dependencies

Dependencies on DLCs and mods

Hard dependency

If your mod depends on features/content created in another mod or a DLC, you can declare this DLC or other mod as a hard dependency of yours. Doing so will warn players if they try to use your mod without its dependencies.

To declare mod dependencies for your mod, add a “Dependencies” table in your mod.json. Each entry in this table requires the name of the dependency mod (“Name”), and its ID (“Id”, you can find it in the dependency's generated_ids.lua file).

The same is done to declare DLC dependencies, by providing the DLC's codename.

mod.json
  1. {
  2. "Name": "Mod Name",
  3. "Author": "Author of the mod",
  4. "Description": "Description of the mod",
  5. "Version": "1.0.0",
  6.  
  7. "DlcDependencies": [ "guivre_garden", "agriculture" ],
  8.  
  9. "Dependencies": [
  10. {
  11. "Id": "81f7891c-d992-4b27-beff-617a276bab4c",
  12. "Name": "First dependency mod"
  13. },
  14. {
  15. "Id": "28eac88d-a14a-45fa-842f-710839386b77",
  16. "Name": "Second dependency mod"
  17. },
  18. ...
  19. ]
  20. }

Soft dependency

If your mod uses a DLC's or another mod's content but can still work without it, this DLC or other mod is considered as a soft dependency. In this case, you can test in your script if this DLC/mod is already loaded with foundation.isDlcEnabled and foundation.isModLoaded:

mod.json
  1. -- Test if the DLC I depend on is loaded
  2. if (foundation.isDlcEnabled("agriculture")) then
  3. ....
  4. else
  5. ....
  6. end
  7.  
  8. -- Test if the mod I depend on is loaded
  9. if (foundation.isModLoaded("5d2565f1-3083-4a53-8366-8f2a2e1c4690")) then
  10. ....
  11. else
  12. ....
  13. end
dependencies.txt · Last modified: 2026/10/05 16:38 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki