Jump to content
  • 0

CustomPunch BasicArmorBonus Issue?


DiR

Question

I was making a weapon that has a custom punch in it, but it always throws a minor error when loading it because since it doesn't steal armor I put nothing in the "BasicArmorBonus" argument of the code. It runs as intended, but I want to avoid having a bunch of these errors when I make weapons in the future. Does anyone know what argument to use in this scenario to prevent this yellow text from appearing again?

 

I've tried, null, 0, false, "", and many others, all with the same result.

A_CustomPunch(1, FALSE, CPF_NOTURN, "BulletPuff", 64, 0, 0, "THIS VALUE HERE GIVES THE ERROR", "Weapon/MeleeHit")

image.png.e751f2a08d85c57c67b8c103e238d0ac.png

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

One important thing to note is that all arguments beyond damage for the A_CustomPunch function are optional. They don't need to be specified if they're not needed. But for future reference, if you are going to specify armorbonustype, it needs something at the very least so the errors don't pop up - it can't be null. Doing something as simple as passing "ArmorBonus" as an argument will probably do the trick.

 

One thing I am wondering about now is if arguments can be "ignored" in DECORATE in the same way they can in ZScript. I know that in the latter, it's possible to skip arguments and jump ahead by prefixing an argument with its name and a colon. I've taken the snippet of your code and done it with the seemingly non-default arguments to explain what I mean - see below:

 

A_CustomPunch(1, flags:CPF_NOTURN, meleesound:"Weapon/MeleeHit")

 

I'm not sure if the same can be done with DECORATE or if all wanted arguments need to be defined explicitly.

Edited by MFG38

Share this post


Link to post
  • 0

Yeah, I needed the custom hit sound but didn't need everything before it since the argument for the hit sound is at the very end of the function.

 

Quote

Doing something as simple as passing "ArmorBonus" as an argument will probably do the trick.

Replacing it with "ArmorBonus" by itself did the trick though! Thank you so much!

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