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.
[0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks
[0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks
- Attachments
-
- smart_cannon_shell_rock_test.zip
- Demonstration saved map file.
- (1.18 MiB) Downloaded 64 times
-
- factorio-current.log
- Log file.
- (4.95 KiB) Downloaded 69 times
Re: [0.17.32] Modded projectile with force_condition="not-friend" does not hit trees or rocks
Trees and rocks are on the neutral force, which is hardcoded to always to be a friend to all forces.