Limiting custom created ammo

Silver100

Member
Hi,

Just been trying to add ammo limit to my custom bullet weapon spawn. I seem to have got a script working well for counting down, disabling bullets, but I can't reset the counter or script. I have even tried player prefs too. My other idea is simply to attach my bullet counter script to each pick up and destroy the script after bullet depletion. Assuming this will work. Failing that, Is there anything in Opsive that will help a custom bullet ammo limitation. i.e. after 50 shots of rifle, the firing stops and then resumes only upon next rifle pickup? Is there a recommended add-on that may help with my current custom set up.
 
Last edited:
This is not built into the inventory - for that you'd need the Ultimate Inventory System which has an integration with the controller.
 
Thanks. I have managed to create my own ammo system that overrides weapons from being able to fire when the counter reaches a limit and resets before next pick up. Making progress at this stage but a lot involved. The thing I like with Opsive UCC is there's usually a lot of features you can integrate with your own ideas and coding methods. With Ultimate Inventory System there seems a lot of features I could really do with too. Would there be a fair amount of independent methods here as well, that I could simply incorporate into my own weapon handling, bullet code system, health & score system to help build and improve what I am doing?
 
Last edited:
The Ultimate Inventory System integration completely replaces the Inventory component with its own. So anything layered on top of that can be used as is. With your own systems make sure you are referencing InventoryBase instead of Inventory.
 
Thanks that's a good point. Will the integration initially prevent some scripts linked to inventory running until updating name spaces etc or should existing methods still work immediately as normal?
 
Last edited:
You should be using the InventoryBase component, which is the same thing that the integration uses. If you are using this class then you won't need to make any changes.
 
Top