Implementing a melee attack that uses ammo

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
The T_W_C
Posts: 14
Joined: Tue Dec 01, 2020 9:24 am

Implementing a melee attack that uses ammo

Post by The T_W_C »

I have a melee weapon that does lifesteal, but to keep it breaking the balance completely, I decided to give it ammo in order to limit how often you can use it.

I got the ammo working fine, I can pick up ammo and the melee weapon uses the proper ammo type, but now it no longer does lifesteal and the only thing I changed was to add "CPF_USEAMMO"

Do I need to define a lifesteal ability in the ammo type now or is there an easier way I could go about all of this?
Capture.PNG
Capture.PNG (7.35 KiB) Viewed 334 times
Capture.PNG
Capture.PNG (7.35 KiB) Viewed 334 times
Attachments
Capture1.PNG
Capture1.PNG (4.57 KiB) Viewed 334 times
User avatar
Player701
 
 
Posts: 1707
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Implementing a melee attack that uses ammo

Post by Player701 »

Flags is a single argument separated by "|", not a comma. This is how your call should look like:

Code: Select all

A_CustomPunch(3, false, CPF_USEAMMO|CPF_PULLIN, "GauntletPuff2", 0, 3, 0)
The T_W_C
Posts: 14
Joined: Tue Dec 01, 2020 9:24 am

Re: Implementing a melee attack that uses ammo

Post by The T_W_C »

omg thank you it works perfectly now! I was wayyy overthinking it.
Post Reply

Return to “Scripting”