Hi there!

Just trying to figure out the best way of holding different types of ammo for different weapons. E.g: 9mm for pistol, Shotgun shells for shotgun and so on...
Currently I have set up as so, Quite long winded but il keep it short!

Status Values: I have added MaxPistolAmmo set at 0 (Normal Type, Similar to MaxMP), and another PistolAmmo which is a consumable (again like MP),
I currently have one weapon (pistol with 12 round capacity) That has a custom bonus setting which add's 12 to the MaxPistolAmmo.
I then have a separate ability for Attack (named ShootPistol for now) which plays the attack event and consumes 1 PistolAmmo.
Lastly, I have an inventory item (Pistol clip) which just add's 12 to PistolAmmo, and plays a reload animation.
So it works just like mp system.

Everything works fine. My only issue is the Player Hud. It works fine for the one gun. But i cant seem to get my head round how to have multiple ammo's (or in my case, ideally what i need is "switching the MaxPistolAmmo over to say "ShotgunMaxAmmo" when i change weapons, rather than numerous stacking ammo status bar's.

Which makes me think, there may be an easier/correct way of doing it?

Currently I would have to have multiple Status Values holding different ammo types and so on (switch to shotgun > changes MaxShotgunAmmo from 0 to 6 from custom Bonus settings etc) which is all working apart from the stacking hud HP / MP / PistolAmmo / ShotgunAmmo etc.

I tried just having the attack just consume from items from inventory which worked fine too, thinking it may be easier to do that route and have some kind of variables which play animations every 12 shots (pistol reload), 6 shots(shotgun reload) and so on?

Any thoughts welcome! :D

Thanks!

  • In fact, i dont think I that is set up correctly with the status values...Easier option would be the inventory consume? With a variable of some sort counting the "shots left, then play reload animation?"
  • Abilities (e.g. the attack abilities used by the weapons) can consume items as use costs, you could e.g. separate ammo loaded in a weapon and remaining ammo into 2 different items.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I think I understand...I have just set it up like so...

    PistolShoot (Abilty > Deducts 1 value from Pistol Ammo(item) (Maximum 12 capacity from inventory item)

    Once the 12 shots have been fired. I then use another Item "Pistol Clip" which then "Adds Item to Inventory (Pistol Ammo)" eg: 12 Bullets back to the gun, Plays the animation/event fine and reloads into clip!

    Much easier! Thanks for that GiL! All seems working how i need it! :)
Sign In or Register to comment.