How can I make an item with infinite ammo?

DavidC

Active member
UCC 4.2.8
UIS 1.2.8
Some games have the default pistol (or whatever) that has infinite ammo. I tried leaving the consumable blank and it gives an error about not being able to find it. I looked around in UIS and the inspector, and I'm not really seeing any way to do this. Can someone point me in the right direction?
Thank you!
 
Setting the consumable Item to null should have worked, so this might be a bug.
You must set it to null in both the Prefab Shootable and the UIS AmmoData Attribute of the weapon.

(I've tried it out and I do get multiple errors, I'll try to fix it asap)
 
Here are the two changes I made:

line 124 WeaponAmmoItemViewModule
Code:
var ammoItem = ammoData.ItemDefinition?.DefaultItem;

line 196 PersistenItemMonitor
Code:
if (itemIdentifier == null || itemIdentifier.GetItemDefinition() != m_ItemDefinition) {

This allows you to not use any ammo. That's ok if you want to fire without any restrictions. But unfortunatly we do not have a clip size when no ammo is defined so you cannot set infinite ammo + a limited clip size.

Those are the sort of issues we plan to adress when working on UCC V3.

I hope that helps
 
Top