I've noticed that there's no way to make projectiles be able to hit and deal damage to whoever fired them.
True, it is possible to use SpecialMissileHit to make them stop when hitting, but this completely skips everything that a projectile would do on hit, such as dealing direct damage.
An example use case for this would be bouncing projectiles that can hurt the shooter if they bounce back at them.
Flag for allowing projectiles to hit their own target
Moderator: GZDoom Developers
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49072
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Flag for allowing projectiles to hit their own target
The reason for this is that normally projectiles get spawned within the shooter, so if this was disabled they'd explode right away because they could not move.
Re: Flag for allowing projectiles to hit their own target
That can be fixed by having two flags - initially have the standard behavior even with the definition flag, but as soon as the projectile detects that it has left the shooter's boundaries, it can flag itself internally (with a flag not accessible in the definition code) as colliding with its shooter.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: Flag for allowing projectiles to hit their own target
I've decided to revive this, with one PR.
This adds a user-settable flag called HITOWNER. The point of it would be to let modders flip it on in a bounce state, for example. Obviously setting it in the default block would allow projectiles to hit the player instantly.
Also the behavior Rachael describes could just be implemented on the ZScript side with this.
This adds a user-settable flag called HITOWNER. The point of it would be to let modders flip it on in a bounce state, for example. Obviously setting it in the default block would allow projectiles to hit the player instantly.
Also the behavior Rachael describes could just be implemented on the ZScript side with this.
Re: Flag for allowing projectiles to hit their own target
Can I suggest "HITSOWNER" instead? "HITOWNER" might seem to imply that whatever the missile hits becomes it's owner as with "HITTRACER".
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: Flag for allowing projectiles to hit their own target
Would "CANHITOWNER" be a better option?
Re: Flag for allowing projectiles to hit their own target
"Hits Owner" is more grammatically precise.