Page MenuHomeFeedback Tracker

Introduce a Reload EventHandler
Reviewed, WishlistPublic

Description

A reload event that fires just before a unit has actually started the reload process, so calling

unit setAmmo [currentWeapon unit, 10];

would set the ammo count on the old magazine and not the new magazine.

Details

Legacy ID
1675479292
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Additional Information

Parameters could be:
0:Object - unit that is reloading
1:String - Weapon that is being reloaded.
2:String - Muzzle of the weapon being reloaded.
3:String - Magazine class being removed from the weapon
4:String - Magazine class being reloaded into the weapon
5:Number - Ammo in magazine being removed from the weapon
6:Number - Ammo in magazine being reloaded into the weapon

To set the ammo in the old magazine to 10 on reload.
player addEventHandler ["Reload",{(_this select 0) setAmmo [(_this select 1), 10];}];

Event Timeline

LordHeart edited Steps To Reproduce. (Show Details)Apr 3 2014, 4:51 PM
LordHeart edited Additional Information. (Show Details)
LordHeart set Category to Scripting.
LordHeart set Reproducibility to Always.
LordHeart set Severity to None.
LordHeart set Resolution to Open.
LordHeart set Legacy ID to 1675479292.May 7 2016, 6:20 PM

3:String - Magazine class being removed from the weapon
4:String - Magazine class being reloaded into the weapon
5:Number - Ammo in magazine being removed from the weapon
6:Number - Ammo in magazine being reloaded into the weapon

7:Object - Container into which the magazine being removed from the weapon is going to be transferred (objNull if mag is null or empty)
8:Object - Container from which the magazine being reloaded into the weapon originates

Arctor added a subscriber: Arctor.May 7 2016, 6:20 PM
Arctor added a comment.Dec 6 2014, 6:36 PM

I'd actually prefer if it fired after reload is complete. Or maybe have the animation (or animation time) passed.

I see a reloaded eventhandler has been introduced that occurs after reloading has happened. Which I believe essentially solves this.