Page MenuHomeFeedback Tracker

Allow setAmmo to set more than max for magazine
Reviewed, WishlistPublic

Description

Allow the setAmmo command (https://community.bistudio.com/wiki/setAmmo) to set the ammo count for a magazine to more than default capacity of the magazine.

Details

Legacy ID
2327735753
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Run the following:

player setAmmo [currentWeapon player, 2000];

Event Timeline

LordHeart edited Steps To Reproduce. (Show Details)Apr 3 2014, 4:16 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 2327735753.May 7 2016, 6:20 PM
Bohemia added a subscriber: AD2001.Apr 3 2014, 4:16 PM

What purpose do you need that for?

It would allow chambered rounds to be scripted in.

player setAmmo [currentWeapon player, (player ammo currentWeapon player)-1];
// do reload here
player setAmmo [currentWeapon player, (player ammo currentWeapon player)+1];

If the ammo count of the new magazine is 30/30 then you will simply be wasting a round.

Aaaah, clever :)

The only problem I see is that catching when a unit reloads is a bit hard, see this for more info: http://forums.bistudio.com/showthread.php?173330

I'll make another issue for a Reload EventHandler.

EDIT:
http://feedback.arma3.com/view.php?id=18265

LordHeart added a comment.EditedMay 5 2014, 6:54 PM

From what I discovered, it is possible to catch a reload action (in a simple sense of the word) via

player addEventHandler ["Take", {if ((_this select 0) == (_this select 1) and {isClass (configFile >> "CfgMagazines" >> (_this select 2))}) then {
hint "Reloaded";
}];

Hell, that's quite a clever one :)

brett added a subscriber: brett.Jun 28 2021, 9:56 PM

Could a 3rd param be added? Make it false by default, but when set to true it allows the magazine to be overfilled.

player setAmmo [currentWeapon player, 2000]; would just fill the magazine as it currently does
player setAmmo [currentWeapon player, 2000, true]; would set the magazine to 2000, regardless of the max