diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 0a13ed9afb..f26e39f222 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -44,6 +44,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment [_onAttachText, 2] call EFUNC(common,displayTextStructured); }; _unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true]; + [QGVAR(attached), [_attachedItem, _itemClassname]] call CBA_fnc_localEvent; } else { GVAR(placeAction) = PLACE_WAITING; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 7c68831f36..0d315fb9b8 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -50,6 +50,8 @@ if (!([_unit, _itemName] call CBA_fnc_canAddItem) && {!_isChemlight}) exitWith { [LELSTRING(common,Inventory_Full)] call EFUNC(common,displayTextStructured); }; +[QGVAR(detaching), [_attachedObject, _itemName]] call CBA_fnc_localEvent; + // Add item to inventory (unless it's a chemlight) if (!_isChemlight) then { _unit addItem _itemName; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 2ae6f84b74..f0c051d168 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -4,7 +4,7 @@ * Approves placement of the lightObject, scans for an appropriate location and attaches * A player can release the attachObject with it floating in mid-air. * This will use lineIntersectsSurfaces to scan towards the center of the vehicle to find a collision - * ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) + * Arma's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) * So it does multiple scans at slighly different angles * This is VERY computationaly intensive, but doesn't happen that often. * @@ -100,5 +100,6 @@ _unit removeItem _itemClassname; private _attachList = _attachToVehicle getVariable [QGVAR(attached), []]; _attachList pushBack [_attachedObject, _itemClassname]; _attachToVehicle setVariable [QGVAR(attached), _attachList, true]; +[QGVAR(attached), [_attachedObject, _itemClassname]] call CBA_fnc_localEvent; [_onAttachText, 2] call EFUNC(common,displayTextStructured); diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index d1cc6d01d0..3fd2e797ce 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -106,6 +106,14 @@ MenuType: 0 = Interaction, 1 = Self Interaction |`ace_cookoff_cookOffBox` | _box | Global | Listen | Ammo box cook off has started |`ace_cookoff_engineFire` | _vehicle | Global | Listen | Engine fire has started + +### 2.11 Attach (`ace_attach`) + +| Event Key | Parameters | Locality | Type | Description | +|----------|---------|---------|---------|---------|---------| +|`ace_attach_attached` | [_attachedObject, _itemClassname] | Local | Listen | After an item was attached to a unit/vehicle +|`ace_attach_detaching` | [_attachedObject, _itemName] | Local | Listen | Just before an item gets detached/removed from a unit/vehicle + ## 3. Usage Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation.