Skip to content

Explosives - Improve EOD unit equipment handling - #11435

Merged
PabstMirror merged 1 commit into
acemod:masterfrom
Dystopian:explosives_support_mod_eod_units
Jul 26, 2026
Merged

Explosives - Improve EOD unit equipment handling#11435
PabstMirror merged 1 commit into
acemod:masterfrom
Dystopian:explosives_support_mod_eod_units

Conversation

@Dystopian

Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • add support for mod EOD units;
  • fix some Engineer+EOD units missing ToolKit (e.g. B_Patrol_Engineer_F).

The config-based implementation is replaced with a scripted one. This allows ACE to support EOD units from other mods (e.g. CUP) without compat configs.

The script:

  • checks whether the unit is EOD;
  • removes ToolKit only if the unit is not an Engineer;
  • adds ACE EOD tools (ACE_Clacker and ACE_DefusalKit).

Can also do:

  1. Check the EOD trait with getUnitTrait instead of the unit config to support mission-maker-defined EOD units. There is also ace_common_fnc_isEOD, but if unit already has ACE_isEOD variable, maybe we should not handle its equipment.
  2. Support custom EOD items instead of the default ones (e.g. GVAR(EODItems) in the unit config).
  3. Support custom toolkits (inheriting from ToolKit).
  4. Use toLower when checking item class names to handle possible case mistakes in configs.

params ["_unit"];

private _config = configOf _unit;
if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would using the trait be any better?

Suggested change
if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {};
if (!(_unit getUnitTrait "explosiveSpecialist")) exitWith {};

I'm not sure, but it might be more flexible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really decide what is better. getUnitTraitwould:

  • handle non-EOD unit if defined as EOD - looks better, more support;
  • ignore EOD unit if defined as non-EOD - looks worse?

Can handle both config and mission-defined:

Suggested change
if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {};
if (
getNumber (_config >> "canDeactivateMines") == 0
&& {
private _isEOD = _unit getUnitTrait "explosiveSpecialist";
isNil "_isEOD" || {!_isEOD}
}
) exitWith {};

Anyway nil return handling is required in this case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old way effectively just used config,
so I think we can just merge this as is and maybe change in the future if needed

@PabstMirror PabstMirror added this to the 3.21.1 milestone Jul 20, 2026
@PabstMirror PabstMirror added kind/change Release Notes: **CHANGED:** kind/enhancement Release Notes: **IMPROVED:** and removed kind/change Release Notes: **CHANGED:** labels Jul 20, 2026
@PabstMirror
PabstMirror merged commit b85e9db into acemod:master Jul 26, 2026
3 checks passed
@Dystopian
Dystopian deleted the explosives_support_mod_eod_units branch July 29, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Release Notes: **IMPROVED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants