I would like to start this post with saying big thanks to Nils for his donation!

Hi KillzoneKid! Thanks a lot for your great tutorials in support for the community. Love your work, learned a lot! Personally hoping for one on mini-map rotation that you have been teasing us with ๐Ÿ™‚ Or some some way to turn off the pesky black GPS location lines on a map control element when in a helicopter. Thanks & Best Regards, Gundy (on BI-Forums)

Well, thank you, Nils, and I think I have something really awesome and equally valuable to share this time. I have discovered this recently by accident and as far as I can tell this discovery provides a solid method for overriding LMB (Left Mouse Button). Actually, more precisely, it overrides default fire control, which usually associated with LMB.

Fire is associated with input action “DefaultAction”. If you create an addAction and bind it to “DefaultAction” (see BIKI page for addAction for more info) ย it would override default firing. Try it yourself:

player addAction ["", { player sideChat ([ "Nope", "Forget it", "BANG, I guess..." ] select floor random 3); }, "", 0, false, true, "DefaultAction"];

What’s more, it would override fire action regardless of input device used, be it keyboard, mouse or joystick. I doubt this could be done in any other way, like with UI event handlers for example. I have been playing with it and made a quick weapon jamming mock up just to see if it works:

Unfortunately there is no way of distinguishing one weapon from another, as some kind of weapon id is not available to mission makers, so I’m putting this attempt on hold for now. This is the script I used in the video if anyone wants to play around with:

allowFire = true; player addAction ["", { playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0]; }, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"]; KK_fnc_playerWeaponMulfunction = { _frame = diag_frameno; _wep = currentWeapon _this; _ammo = _this ammo _wep; if (_ammo > 0) then { allowFire = nil; _this setAmmo [_wep, 0]; waitUntil {_frame < diag_frameno}; _this setAmmo [_wep, _ammo]; hint "Jammed!"; }; }; player addEventHandler ["Fired", { if (random 1 < 0.05) then { player spawn KK_fnc_playerWeaponMulfunction }; }]; player addEventHandler ["Take", { if (_this select 0 == _this select 1) then { hint "Un-Jammed!"; allowFire = true; }; }];

Enjoy,
KK

EDIT: There have been some changes on DEV branch, and “Take” event handler does not return player object as weapon holder anymore, but “Supply40”, “Supply140”, etc weaponholder, I presume depending on container used, uniform vest etc. Here is quick workaround to Un-jam routine. I wish there was dedicated “reload” EH for this:

player addEventHandler ["Take", { if (typeOf (_this select 1) select [0,6] == "Supply") then { hint "Un-Jammed!"; allowFire = true; }; }];