ItemPickup gets picked up twice, even though maximum ammo is already reached

Hi,

We have a weapon in our game that has a maximum of 360 bullets which is assigned in the ItemTypes. Each ItemPickup has 1 weapon ItemIdentifier and 360 bullets.

Pic02.JPG

The issue is that when the player first picks up a weapon, he gets 48 bullets in his magazine and 312 bullets left over, so 48 + 312 = 360, which is the maximum. So in theory, the player shouldn't be able to pick up another ItemPickup unless he fire a few bullets.

Pic03.JPG

But when he enters another weapon pickup, he still pickups up more bullets, so now he gets 48 + 360 = 408, which exceeds the maximum of 360.

Pic04.JPG

After the second, the player is unable to pickup any more ItemPickups. Is this by design? Is there a way to make it so that the player picks up the ItemPickup once, and then doesn't have to pick it up again? It's a little odd that the player needs to pick up an ItemPickup twice in order to have the maximum. Shouldn't the magazine also contribute to the total number of bullets the player has? Any suggestions would be helpful. Thanks.
 
How many bullets are in the pickup? With shootable weapons there is a difference between the amounts that are loaded versus unloaded, and that's what you are seeing now. We've reworked this in version 3 so it should be more consistent (especially when sharing ammo between items).
 
How many bullets are in the pickup? With shootable weapons there is a difference between the amounts that are loaded versus unloaded, and that's what you are seeing now. We've reworked this in version 3 so it should be more consistent (especially when sharing ammo between items).
So there are 360 bullets in the pickup as per the first screenshot. The bullet has a maximum of 360 in the ItemTypeManager. So will version 3 consider the loaded amount as part of the total bullets the player has?
 
The maximum amount defined in the ItemTypeManager only limits the amount of items added to the Inventory.

When reloading the bullets are removed from the Inventory and added inside the weapon clip. And from that point the Inventory does not keep track of the bullets that are loaded in clips.

In UCC V3 we do the same by default. But with our new modular design we could potentially make another Ammo Module that keeps the Ammo in the Inventory until actually fired.
The Amount displayed in the UI is also defined by a module. So you would need another custom one that instead of displaying ClipRemaining and AmountInInventory.
It could display ClipRemaining and (AmountInInventory-ClipRemaining).

This is exactly what the new modular system is all about, changing certain aspects of your weapon functionality without having to rewrite the entire weapon script.
I can add your use case in the list of feature request. I'm not sure if we'll have it by release but perhaps soon after. And of course there's always the possibility of you writing your own custom modules.
 
The maximum amount defined in the ItemTypeManager only limits the amount of items added to the Inventory.

When reloading the bullets are removed from the Inventory and added inside the weapon clip. And from that point the Inventory does not keep track of the bullets that are loaded in clips.

In UCC V3 we do the same by default. But with our new modular design we could potentially make another Ammo Module that keeps the Ammo in the Inventory until actually fired.
The Amount displayed in the UI is also defined by a module. So you would need another custom one that instead of displaying ClipRemaining and AmountInInventory.
It could display ClipRemaining and (AmountInInventory-ClipRemaining).

This is exactly what the new modular system is all about, changing certain aspects of your weapon functionality without having to rewrite the entire weapon script.
I can add your use case in the list of feature request. I'm not sure if we'll have it by release but perhaps soon after. And of course there's always the possibility of you writing your own custom modules.
I see, I thought that this might have been the case, whereby the magazine deducts ammo from the inventory. It is a little annoying having the player pick up 2 weapon pickups each time. Maybe it would have been better to consider the ammo in the magazine as part of the inventory until the bullets actually get fired, just like you mentioned. It would be much appreciated if this could be a feature request, given that this sort of functionality is common in most FPS games :)
 
Top