Skip to content

Port ACE's Status Effects to CBA#1809

Open
DartRuffian wants to merge 14 commits intoCBATeam:masterfrom
DartRuffian:status-effects
Open

Port ACE's Status Effects to CBA#1809
DartRuffian wants to merge 14 commits intoCBATeam:masterfrom
DartRuffian:status-effects

Conversation

@DartRuffian
Copy link
Copy Markdown
Contributor

@DartRuffian DartRuffian commented Jan 18, 2026

When merged this pull request will:

  • Port ACE isModLoaded, endRadioTransmission, toBitMask, binarizeNumber functions to CBA.
  • Port runAtSettingsInitialized to CBA.
  • Port ACE's Status Effect system to CBA.
  • Respect the Submitting Content Guidelines.

@DartRuffian
Copy link
Copy Markdown
Contributor Author

I left the pre-seeded reasons from ACE in the offchance ACE switches to using the CBA functions instead. I think all the cases should be covered now but will need some testing

@DartRuffian DartRuffian marked this pull request as ready for review January 25, 2026 17:55
@DartRuffian
Copy link
Copy Markdown
Contributor Author

Tested the status effects that I could (stuff like blockSpeaking/blockRadio I couldn't really test in SP to verify). All seem to be working, though blockThrow doesn't block vanilla throwing. Seems like either an oversight or something that wasn't worth implementing at the time

@PabstMirror
Copy link
Copy Markdown
Contributor

as far as I know it's just for ace_adv_throw

I've seen code that should work in theory but doesn't

    // prevent players from throwing grenades (does not work)
    // [_unit, "Throw", {true}, {systemChat "block";}] call EFUNC(common,addActionEventhandler);

so should it be "ace_blockthrow"? but doing that will cause backward compatibly issues

@DartRuffian
Copy link
Copy Markdown
Contributor Author

I mean technically this runs separately from ace's so it'd be fine there. If we have a known way of block vanilla throwing I wouldn't be opposed to adding it. ACE sets the current throwable ammo to 0 iirc, which works but idk if there's something better

@DartRuffian
Copy link
Copy Markdown
Contributor Author

Statuses for disableNVEquipment/disableTIEquipment would be nice

@PabstMirror
Copy link
Copy Markdown
Contributor

We'll need compats for ACE
ideally something like this, so we can merge into and release ace regardless of cba version

if (CBA version > x) then {
  // port call to CBA
} else {
  // old behaviour
};

Comment on lines +133 to +134
// TODO: disableNVG/TIEquipment only work on vehicles, but we could make the status effects work for units as well
// One possible solution would be hooking into VisionModeChanged and using `player action ["NvGogglesOff", player]`
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've got too many projects currently, but if someone wants to try to implement this, that'd be nice

@DartRuffian
Copy link
Copy Markdown
Contributor Author

DartRuffian commented Feb 1, 2026

We'll need compats for ACE ideally something like this, so we can merge into and release ace regardless of cba version

if (CBA version > x) then {
  // port call to CBA
} else {
  // old behaviour
};

I mean you could just:

if (isNil "CBA_fnc_addStatusEffectType") then {
    [...] call ace_common_fnc_statusEffects_addType; // or whatever its called
} else {
    [...] call CBA_fnc_addStatusEffectType;
};

["_sendJIP", false, [false]],
["_eventName", "", [""]]
];

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.

Instead of modifying ace to call new CBA, maybe it's best to just have CBA use ace if it exists

Suggested change
if ("ace_common" call CBA_fnc_isModLoaded) exitWith ace_common_fnc_statusEffect_addType;

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.

But then someone using CBA stuff would have it break with ace loaded, unless every status effect function called ace if loaded and that just seems meh

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.

we can't have two different status effect systems that aren't compatible
so we have to do something like this in either ace or cba
I think it's safest to just leave ace alone and have CBA use ace if it exists in all relevant funcs

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.

But why not just update the ace ones to call the CBA functions? The only public ones are get/set, and addType should be kept BWC even though its not public. And if someone is manually checking the internal variables / calling stuff like sendEffects, respawnEH, etc. then they're just asking for something to break at some point.

IMO ACE should conform to CBA, not the other way around because its the more widely used mod with more than 2x the users (yes not every one of those people are using CBA stuff directly). If CBA calls ACE if its loaded then you risk incompatibilities / different behavior if the ACE functions are updated and someone doesn't make the same changes to CBA as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants