[1.1.110] Projectile with piercing damage won't pierce if hit entity is not killed

Bugs that are actually features.
k2aj
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jul 11, 2024 2:10 pm
Contact:

[1.1.110] Projectile with piercing damage won't pierce if hit entity is not killed

Post by k2aj »

I've created a custom projectile for a mod, which inflicts very low damage (5), but has very high piercing_damage (9999). The purpose was to apply slowing stickers on multiple targets without actually killing them. Unfortunately, it looks like piercing_damage doesn't work like expected - as mentioned in the title, if entity hit by the projectile is not killed, the projectile will fail to pierce the target and simply disappear instead.

Note that piercing targets, even if they are not killed, should be the correct behavior according to ProjectilePrototype documentation:
piercing_damage

Whenever an entity is hit by the projectile, this number gets reduced by the health of the entity. If the number is then below 0, the final_action is applied and the projectile destroyed. Otherwise, the projectile simply continues to its destination.
Steps to reproduce
  • Install the attached mod (piercing-damage-bug-report_0.1.0.zip)
  • Load the attached save file (piercing-damage-bug-report-save.zip)
  • Shoot the gun equipped by the player at any entity with health (trees, biters, etc.). Note that the ammo equipped by the player is not vanilla shotgun ammo, but the special ammo added by the mod.
Expected behaviour: the fired projectile pierces through multiple targets and inflicts damage on each one, regardless of whether any of the targets were killed by the projectile.

Observed behavior: if the projectile doesn't kill the hit entity, the projectile instantly disappears (projectiles which kill the hit entity continue flying as expected).
Attachments
factorio-current.log
(5.15 KiB) Downloaded 21 times
piercing-damage-bug-report-save.zip
(1.28 MiB) Downloaded 28 times
piercing-damage-bug-report_0.1.0.zip
(1.08 KiB) Downloaded 31 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15013
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.110] Projectile with piercing damage won't pierce if hit entity is not killed

Post by Rseding91 »

Thanks for the report however that is how piecing damage was written to work 10 years ago.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”