Page 1 of 1

How to make projectiles & hitscans bounce off when…

Posted: Fri Nov 10, 2017 8:52 pm
by argv
I'm trying to ZScriptify part of a mod. It has a weapon that, while active, is supposed to reflect all missiles and block all hitscans that hit the user's front side. It does this by spraying tons of invisible actors in front of the user, which block incoming fire. This mostly works, but it's extremely complex, and only some projectiles get reflected (as opposed to exploding).

Is there a better way? Some way for a PlayerPawn or Weapon to make projectiles within a certain angle bounce off instead of hitting, and make hitscans within said angle puff harmlessly instead of generating blood?

I had initially thought to use a modified Disc of Repulsion effect, but this won't work on hitscans, nor on projectiles fast enough to get through the effect's range in one tic.

Any ideas?

Re: How to make projectiles & hitscans bounce off when…

Posted: Thu Nov 16, 2017 12:02 pm
by Amuscaria
Why not just spawn a number of small invisible actors in front of the weapon user, that does the reflecting and blocking, every tic?

Re: How to make projectiles & hitscans bounce off when…

Posted: Thu Nov 16, 2017 2:32 pm
by argv
Then the user's own attacks hit them, too.

The mod currently handles that with THRUSPECIES/MTHRUSPECIES, but then players using that weapon are not protected from each other's attacks.