[0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks

Bugs that are actually features.
smcpeak
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Dec 05, 2017 7:50 am
Contact:

[0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks

Post by smcpeak »

I created modded versions of the stock cannon shells that do not do
friendly fire damage:

https://mods.factorio.com/mod/SmartCannonShells

They work by setting force_condition="not-friend" on the projectile.

This attribute is documented at:

https://wiki.factorio.com/Prototype/Pro ... _condition

Based on the name, I presume that "not-friend" should hit any entity not
considered a "friend". I presume that "friend" means entities of the same
or an allied force. Since trees and rocks are not allies, I expect them
to be hit by a projectile with force_condition="not-friend", but they are
not; the shells pass straight through.

To reproduce this, load SmartCannonShells into a game, place some
Smart cannon shell items into a tank (I use the Creative Items mod to get
them quickly), and use them to shoot trees and rocks by pressing the "C"
key. The trees and rocks will remain undamaged, while I expect them to be
damaged or destroyed. The attached smart_cannon_shell_rock_test.zip
save file has everything set up.

In contrast, force_condition="not-same" does hit trees and rocks, but I
expect such shells also hit allied forces. Ordinary cannon shells also
hit trees and rocks, of course.
Attachments
smart_cannon_shell_rock_test.zip
Demonstration saved map file.
(1.18 MiB) Downloaded 69 times
factorio-current.log
Log file.
(4.95 KiB) Downloaded 74 times
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks

Post by Klonan »

Trees and rocks are on the neutral force, which is hardcoded to always to be a friend to all forces.
Post Reply

Return to “Not a bug”