Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Sign in to follow this  
DynamiteKaitorn

Custom Projectile Weapon Ammo problem

Question

So I know how to produce a custom projectile as well as how to handle normal ammo usage but for some reason I can't seem to combine the two so that I have a set amount of ammo used when firing the weapon (rather than per projectile). I mostly want it so that if for example you have 100 cell ammo, you can fire the plasma rifle. Having 99 or less cell ammo, it wont fire, having 101 - 199 means you can fire it once but not twice. Is there a way around this?

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

You can use A_JumpIfInventory in your Fire States to check the amount of ammo the player has, and make you weapon go to desired states depending on how much ammo they have.

 

For example:

 

Fire:

TNT1 A 0 A_JumpIfInventory("AmmoType", 50, "FireType2)

.

.

.

.

.

FireType2:

TNT1 A 0 A_JumpIfInventory("AmmoType", 100, "FireType3)

.

.

......etc

Share this post


Link to post
  • 0

As for using specific amount of ammo for each fire type, you just use A_TakeInventory instead of letting the weapon decide how much ammo to consume.

Share this post


Link to post
  • 0

If you are firing multiple projectiles at a time, you can set the ammo usage to the amount you want to entire shot to use, and have only the first projectile use ammo.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×