Flag for allowing projectiles to hit their own target

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Flag for allowing projectiles to hit their own target

Re: Flag for allowing projectiles to hit their own target

by Rachael » Fri Aug 17, 2018 5:26 pm

"Hits Owner" is more grammatically precise.

Re: Flag for allowing projectiles to hit their own target

by Marisa the Magician » Fri Aug 17, 2018 5:01 pm

Would "CANHITOWNER" be a better option?

Re: Flag for allowing projectiles to hit their own target

by kodi » Fri Aug 17, 2018 3:38 pm

Can I suggest "HITSOWNER" instead? "HITOWNER" might seem to imply that whatever the missile hits becomes it's owner as with "HITTRACER".

Re: Flag for allowing projectiles to hit their own target

by Marisa the Magician » Fri Aug 17, 2018 11:07 am

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.

Re: Flag for allowing projectiles to hit their own target

by Rachael » Wed May 23, 2018 5:40 am

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.

Re: Flag for allowing projectiles to hit their own target

by Graf Zahl » Wed May 23, 2018 5:29 am

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.

Flag for allowing projectiles to hit their own target

by Marisa the Magician » Wed May 23, 2018 4:03 am

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.

Top