[r1934] Custom pain states and 0 damage projectiles
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
[r1934] Custom pain states and 0 damage projectiles
Before r1925 (at least), projectiles with 0 damage were able to cause monsters to enter their custom pain states if the painchance for that state was 255. This has stopped working at some point before r1925 (not sure when as I jumped to r1925 from quite a bit back, and confirmed this to be true for it and r1934)
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1934] Custom pain states and 0 damage projectiles
Fixed bugs won't get reintroduced.
Re: [r1934] Custom pain states and 0 damage projectiles
Use the FORCEPAIN flag.
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
Re: [r1934] Custom pain states and 0 damage projectiles
Tried FORCEPAIN (before I created this thread) and nothing happened.
(on a side note that means that along with 2 of my items, BGPA's sonic grenades are now broken, since they used the mechanic too iirc. It was a neat exploit for items that do special things to monsters but without damaging them like GvH creeper balls do)
(on a side note that means that along with 2 of my items, BGPA's sonic grenades are now broken, since they used the mechanic too iirc. It was a neat exploit for items that do special things to monsters but without damaging them like GvH creeper balls do)
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1934] Custom pain states and 0 damage projectiles
Sigh...
Why do people constantly have to abuse bugs instead of reporting them? How am I supposed to work in such an environment? One person reports the bug so it gets fixed and then 5 others come in and report the fix as a bug...
To make it short: No damage, no pain!
Why do people constantly have to abuse bugs instead of reporting them? How am I supposed to work in such an environment? One person reports the bug so it gets fixed and then 5 others come in and report the fix as a bug...
To make it short: No damage, no pain!
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
Re: [r1934] Custom pain states and 0 damage projectiles
I didn't know it was a bug. And I've no way of knowing unless it's reported as one before I exploit it.
(edit: maybe FORCEPAIN could be altered so it triggers the pain state even with 0 damage (like the wiki suggests), since there'd be no reason to use the flag on such a projectile otherwise)
(edit: maybe FORCEPAIN could be altered so it triggers the pain state even with 0 damage (like the wiki suggests), since there'd be no reason to use the flag on such a projectile otherwise)
Re: [r1934] Custom pain states and 0 damage projectiles
Heh, I just discovered this problem independently of this bug report.The Ultimate DooMer wrote:BGPA's sonic grenades are now broken
http://forum.zdoom.org/viewtopic.php?f= ... 2&p=465716
Re: [r1934] Custom pain states and 0 damage projectiles
Was 0 damage causing pain states reported as a bug before? I don't remember seeing it. Considering that the actor is still being struck by something, even though they aren't hurt by it, it seems perfectly reasonable for it to trigger pain frames.
And since we're talking about pain:
if random(0, 255) < painchance then enter pain state
And since we're talking about pain:
That leaves a 1 in 256 chance that it won't enter the pain state. The check is like this:The Ultimate DooMer wrote:if the painchance for that state was 255
if random(0, 255) < painchance then enter pain state
Re: [r1934] Custom pain states and 0 damage projectiles
Even then, they would need a painthreshold of -1, now.randy wrote:Considering that the actor is still being struck by something, even though they aren't hurt by it, it seems perfectly reasonable for it to trigger pain frames.
Also, if the FORCEPAIN flag does not force pain even for 0-damage projectiles, it's definitely a bug. There's code in there that's specifically to make sure that P_DamageMobj (which handles pain, among others) is called even when no damage is dealt if the inflictor has this flag.
Re: [r1934] Custom pain states and 0 damage projectiles
From memory, being struck by a 0 damage projectile did not cause pain states. However, being struck by a 0 damage ripping projectile did. That's one of the reasons that I used a ripping projectile for my sonic grenades. ie, when I asked how to get this kind of effect, I was advised that a ripping projectile would be the way to do it.randy wrote:Was 0 damage causing pain states reported as a bug before?
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r1934] Custom pain states and 0 damage projectiles
Grrrr. Why do some people have to do this...? Recommending hacks to solve a problem is really bad. Following that advice even worse! 
Re: [r1934] Custom pain states and 0 damage projectiles
Referencing the original id Source, it should. I probably introduced this bug myself when I made negative missile damage do healing.Enjay wrote:From memory, being struck by a 0 damage projectile did not cause pain states.