Context
Sometimes, when modding, I would like to depend on X mod to have factorio use that mod’s assets or libraries. However:1) Some mods are stuck in 1.1
2) Many mods normally come with code that I don’t want executed. Data stage stuff can be reverted (with great effort) while many things can’t be blocked (eg control stage).
Interface Request
Please add a field to info.json where mod A can require mod B's files without running its code and forcing its dependencies (allowing 1.1 mods). When a mod declares this dependency, such as ”mod-B = 69.420.0” in its info.json AND mod-B is disabled, then factorio makes its files accessible, without running code for mod B. For example, mod-A can run require(“__mod-B__.script.library.my-big-library”) or icon = “__mod-B__.graphics.big-black-square.png”The logic is:
1) If mod B is enabled, then run it like normal.
2) Else, if any mod has a file-dependency on mod-B, make the files available without executing its code (Ignore the dependencies in its info.json. Do not run migrations. Do not run data.lua/control.lua/etc).
3) Else, mod-B basically does not exist.
These “file-only dependencies” should be in a separate array in info.json, so the mod can independently use normal flags demarking dependency information for what happens if mod B IS enabled. eg:
“! mod-B”, … file_dependencies = [“mod-B 420.69.0”] means mod-A is incomaptible with mod B (it CANNOT be enabled), but it does require mod-B’s files be made available. Similarly, mod-A could declare an optional dependency etc on mod-B to affect load order… All the logic in this proposal is independent of normal dependency logic.
The Benefits
1) Easily recycle other mods, including abandoned 1.1 mods.2) Other mods can be included into bigger mods without the issue of “the graphics must come with the code.”
3) Better use of dependencies => fewer duplicates messing with Wube’s servers.