Teutch 3 Posted August 9, 2023 Hello, I'd like to add "soft dependencies" to my mod, i.e. dependencies that are not needed to launch the mods (so that don't put error messages at launch) but allow to view new vehicle retextures when they are added or even replace a weapon of a soldier(/uniform) by an other one from this soft dependency. I know it's possible because some modders follow this very ingenious technique, but I really don't know how to set it up in a config. Does anyone have any ideas ? Thanks in advance ! Share this post Link to post Share on other sites
Jackal326 1181 Posted August 10, 2023 13 hours ago, Teutch said: I know it's possible ...is it? I'm no config expert but I'm not entirely sure it is. Either the mod is dependant upon another one or it isn't. If you reference an external class from a mod you don't have installed your game wont load - likewise if you set the dependency to a mod you don't have installed you'll get errors on startup saying the mod isn't there. I'm not sure how you could make it a "soft dependency". What mods have you seen that do this? 1 Share this post Link to post Share on other sites
Teutch 3 Posted August 10, 2023 Thank you for your answer, here is the best example in my opinion : https://steamcommunity.com/sharedfiles/filedetails/?id=2937070516 This same author has made others on the same logic I think. But it doesn't matter if you don't know I'll try to dissect its config to understand the mechanism Share this post Link to post Share on other sites
Teutch 3 Posted August 10, 2023 I figured out how it works So for those like me who want to put dependencies that are not mandatory but functional : You need to put first the line #if __has_include("\...") before your class CfgVehicles/patches/... related to this optional mod. (The # is important to make a priority) Between the quotes you must put the path of a file of this mod (no matter what) which will prove that the mod is present when the game is launched. To go further I was looking to ensure that some equipment is replaced when an additional mod is present. It is therefore enough to use this same line of PreProcessor Commands but then adding "#else" to provide an option without the replacement. I'm not getting too far ahead, I'll try it quietly and I'll come and confirm later if everything works well. 1 Share this post Link to post Share on other sites
Jackal326 1181 Posted August 10, 2023 7 hours ago, Teutch said: I figured out how it works So for those like me who want to put dependencies that are not mandatory but functional : You need to put first the line #if __has_include("\...") before your class CfgVehicles/patches/... related to this optional mod. (The # is important to make a priority) Between the quotes you must put the path of a file of this mod (no matter what) which will prove that the mod is present when the game is launched. To go further I was looking to ensure that some equipment is replaced when an additional mod is present. It is therefore enough to use this same line of PreProcessor Commands but then adding "#else" to provide an option without the replacement. I'm not getting too far ahead, I'll try it quietly and I'll come and confirm later if everything works well. Having read the link you provided I had noticed the author has posted about '#if __has_include()' and was about to suggest that is where you start looking into, but you're already on that track so there we go... 1 Share this post Link to post Share on other sites
Teutch 3 Posted September 11, 2023 A small detail I'd like to add : remember to add an #endif at the end of the command. Share this post Link to post Share on other sites
pierremgi 4850 Posted September 14, 2023 I'm not familiar with these preprocessor commands. I never succeeded in making them work (but #include as basic in .cpp or .hpp) Do you have any full example? I always use a workaround with sqf commands like:if ("SPE" in configSourceModList (configfile >> "CfgPatches")) then {...}; See also: configSourceAddonList Share this post Link to post Share on other sites
POLPOX 778 Posted September 14, 2023 https://community.bistudio.com/wiki/CfgPatches // Optional. If this is 1, if any of requiredAddons[] entry is missing in your game the entire config will be ignored and return no error (but in rpt) so useful to make a compat Mod (Since Arma 3 2.14) skipWhenMissingDependencies = 1; 2 Share this post Link to post Share on other sites