Jump to content
  • 0

Custom Projectile Weapon Ammo problem


DynamiteKaitorn

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...