Page MenuHomeFeedback Tracker

[Feature Request] Add a parameter in CfgPatches to skip to load if an addon from requiredAddons is missing
New, NormalPublic

Description

Title. Main reason is to get rid of __has_include that is bulky and could be slow due to unbinarized config.

class CfgPatches
{
	class AddonB
	{
		requiredAddons[] = {"AddonA"};
		requiredVersion = 0.1;
		units[] = {};
		weapons[] = {};
		skipWhenMissing = 1;
	};
};
AddonB = 1;	// this won't load into the game when AddonA is missing
// same for rest of the config than CfgPatches

If this is a feasible idea, nice to have IMO.

Details

Severity
Tweak
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Config

Event Timeline

POLPOX created this task.May 6 2023, 1:51 AM
SaMatra added a subscriber: SaMatra.May 6 2023, 3:49 AM
Vespade added a subscriber: Vespade.May 6 2023, 9:55 AM
dedmen added a subscriber: dedmen.May 22 2023, 9:48 AM

Imagine A-B-C 3 addons as a dependency chain

If mod A is not present, B will throw error, C will not throw error because B is there.

Now with this change, if A is not present, B will disappear, and C should throw error.
That requires quite deep change in the way we check for dependencies.

dedmen set Ref Ticket to AIII-55689.May 22 2023, 9:48 AM

Pretty understandable concern for a two decades old system. Apparently this is just a (better) workaround of an existed solution so I don't think this should be prioritized. Good to have, actually, though.

dedmen added a comment.EditedMay 22 2023, 12:03 PM

We can skip the config merge, but we cannot unload already loaded PBO's
So all the files of the addon, will still be present even if we skip its load. So like __has_include kind of checking may cause false results

// same for rest of the config than CfgPatches

Do you mean "other than" ? CfgPatches is in the same addon config blob as everything else. Either we merge all or nothing, so CfgPatches entry will then also be gone.

If you write a big warning in your CfgPatches that noone should depend on this addon, then we won't run into that A B C problem i described above.
In that situation this would be quite safe to do.

We can skip the config merge, but we cannot unload already loaded PBO's
So all the files of the addon, will still be present even if we skip its load. So like __has_include kind of checking may cause false results

I think it is fine if the files are loaded still.

Do you mean "other than" ?

Correct, though I might misremembered something, I think all or nothing depends on an addon is missing or not is good for me.

dedmen added a comment.EditedMay 22 2023, 12:50 PM

Throws RPT message

12:14:59 Skipped loading of addon 'Dedmen_F_Test' as required addon 'ace_attach' is not present

Config entry is named skipWhenMissingDependencies to be a bit clearer

next dev brunch and kinda somewhat on profiling branch

Ref https://feedback.bistudio.com/T180805
Chains of skippable addons are not supported