Since there are a lot of different mods for things like maps or other extra functionality, many mods implement extra plugins to be compatible with most of the other mods, but there is one big Problem I have never been able to fully get to work:
Adding mods only as Softdepenndencies instead of Required Dependencies.
We have the #ifdef MOD_DEFINE thing, which also has been greatly reworked with one of the last updates to automatically add a define with the name of the CfgMods Class in the config.cpp, which is really good to have, but that still does not ensure, that these mods are loaded first.
I am currently using something like this, but I noticed, that it doesn't even work, since it seems like the ifdef is never set to that time:
class CfgPatches { class MyModName { requiredAddons[] = { "DZ_Data" #ifdef BASEBUILDINGPLUS ,"BasebuildingPlus" #endif }; }; };
So basically we have to hope, that the scripts of Basebuilding plus are loaded before my mod tries to use anything of the scripts.
The problem is, that loading different mods with different required addons affect this loadorder in a way, that this may work for some people, but not for everyone, which can be really annoying
my suggestion would be so simply add annother option to the same place as the requiredAddon, which could be named preloadedAddons, where one could add other mod names without having to add them to the requiredAddons and getting an error when this mod is not loaded. It would basically just try to load it first if it's found, or just ignore it when it's not found.
so the example from above would become:
class CfgPatches { class MyModName { requiredAddons[] = { "DZ_Data" }; preloadedAddons[] = { "BasebuildingPlus" }; }; };
That would make it finally possible to do some proper plugins for other mods without having to create multiple PBOs only loading the code when needed to use their functions