Event Handlers/Reloaded – Arma 3
In short, Reloaded Event Handler (EH) triggers every time a new magazine is added to a weapon.
The EH can be assigned to both person and transport.
Return FormatThe EH returns array in _this variable of the following format [entity, weapon, muzzle, newMagazine, (oldMagazine)], where:
|
Example Return[ B Alpha 1-1:1 (KK), "arifle_MXC_Holo_pointer_F", "arifle_MXC_Holo_pointer_F", [ "30Rnd_65x39_caseless_mag", 30, 1e+007, 0 ], [ "30Rnd_65x39_caseless_mag", 12, 1e+007, 0 ] ] |
Magazine ID
The magazine ID number is normally > 10,000,000, so due to the number to string conversion limitation it would always show as 1e+007 in hint. In order to be able to see the changing ID number, subtract this amount from the returned ID.
Example
Here is a little demo to play with:
Some explanation about "Throw" and "Put" weapons
The "Throw" weapon has multiple muzzles for different types of currentThrowables. Normally the muzzles are already loaded. However, if you have "Reloaded" EH attached and a spare hand grenade in inventory, when you throw 1st grenade the EH will trigger immediately. This might be a little bit confusing at first, but it is the correct behaviour. As 1st grenade leaves its muzzle, spare grenade is auto reloaded immediately, which explains the EH firing. Also picking up a throwable or putting it in inventory will trigger the "Reloaded" EH if the muzzle for it was empty, as this will reload the muzzle.
The "Put" weapon also has multiple muzzles for different type of mines, but unlike "Throw" weapon, it seems to have its muzzles empty, so it loads and fires them pretty much at the same time. This behaviour could also raise eyebrow at first. But if you assign both "Reloaded" and "Fired" EH to player, when he puts down a mine, both EH fire almost immediately, with "Reloaded" always firing first. This means that "Put" muzzles are reloaded and fired immediately only when requested and this is why old mag information will be non-existent.