Jump to content

Regenerative ammo?


Recommended Posts

for a good amount of time now Ive been working on a joke mod. One of the weapons (which is a cat that behaves like a chainsaw and has an alt fire that shoots a laser) I plan to have an ammo meter, which recharges when your not firing the weapon, But im very confused on how to code it. Im currently trying to base the code off of the laser pistol from space cats saga, yet my brain keeps getting jumbled up in the code. Help is appreciated!

Share this post


Link to post

It's actually pretty simple to do - all you need to do is add a call to the A_GiveInventory function in the weapon's Ready state and have the item it gives be the ammo that the weapon uses.

Share this post


Link to post
25 minutes ago, MFG38 said:

It's actually pretty simple to do - all you need to do is add a call to the A_GiveInventory function in the weapon's Ready state and have the item it gives be the ammo that the weapon uses.

I added it to my code, and it slightly worked.

the ammo counter did go up when the weapon was in its ready state but the weapon started out with 0 ammo (which I want it to start out with 100)

and when walking/running the weapon is static since its looping the A_GiveInventory line. I also wanted to code the weapon in a way to where the recharge can be interrupted (kinda like the laser pistol in space cats saga)

Share this post


Link to post
1 hour ago, MFG38 said:

It's actually pretty simple to do - all you need to do is add a call to the A_GiveInventory function in the weapon's Ready state and have the item it gives be the ammo that the weapon uses.

 

41 minutes ago, STOOPMAN said:

I added it to my code, and it slightly worked.

the ammo counter did go up when the weapon was in its ready state but the weapon started out with 0 ammo (which I want it to start out with 100)

and when walking/running the weapon is static since its looping the A_GiveInventory line. I also wanted to code the weapon in a way to where the recharge can be interrupted (kinda like the laser pistol in space cats saga)

I managed to fix the ammo counter starting at 0, but I still have a problem with the charge up not being able to be interrupted

(I also found out that the weapon can still fire with 0 ammo which needs to be fixed)

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
Reply to this topic...

×   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...