Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

OnProjectileHit event for deflected bullets

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
Danger Ross
Superfighter
Superfighter
Posts: 154
Joined: Thu Mar 31, 2016 12:56 am
Title: Dangerous
SFD Alias: Danger Ross
Started SFD: 14 june 2012 (launch day)
Location: California
Gender:
Age: 23

OnProjectileHit event for deflected bullets

Post by Danger Ross » Wed Apr 08, 2020 12:18 am

currently, if a player blocks a bullet with a melee weapon, there's no way to know that through script since it never triggers the OnProjectileHit event.
The bullet essentially disappears without ever hitting anything even though it technically hit the player's melee weapon (or to generalize, the player).
It would make sense to make deflecting or blocking a projectile count as a "hit".
0 x
sorry bucko, you can't punch with swords 8-)

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sat Apr 25, 2020 2:50 pm

Fixed after v.1.3.5:
ScriptAPI: Added ProjectileHitArgs.IsDeflection, ProjectileHitArgs.DeflectionNormal to be able to read if a projectile hit is a deflection during ProjectileHitCallback.
ScriptAPI: ProjectileHitArgs.RemoveFlag is now false during deflections.
ScriptAPI: ProjectileHitCallback is now fired on blocking players and on ProjectileDeflectZone.
ScriptAPI: Added IProjectile.PowerupTotalBounces to read projectile's maximum total bounces that can be performed. IProjectile.BounceCount can now be written to to change current amount of bounces.
A player deflecting a bullet now counts towards the projectile's total bounce count property as if it would hit a wall during the bounce powerup.
0 x
Gurt

Locked