Target masks for active-defense-equipment, artillery turret and spidertron

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1274
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Target masks for active-defense-equipment, artillery turret and spidertron

Post by Pi-C »

Most entities have a trigger_target_mask. Most turrets have attack_target_mask and ignore_target_mask (the artillery turrets apparently don't). This way, it's easy to make new turrets that will attack only specific entities, or make entities that won't be attacked at all.

Unfortunately, excluding entities from being attacked only works for automated killing (it won't if you use artillery turrets). But that leaves out the human factor! Players may equip some Personal Laser Defense which will automatically shoot at every enemy entity in its range. From this perspective, PLD actually are a kind of mobile turret you carry in your backpack.

I would like to be able to assign attack_target_mask and ignore_target_mask to PLDs (or rather: entities based on the active-defense-equipment prototype) as well. Currently, PLD breaks my mod because it attacks things it isn't meant to attack as it can't damage them anyway. If I could add these entities to the PLD's ignore_target_mask, this would be a quick solution to half of my problems.

The other half is that artillery turrets also shoot at entities they shouldn't shoot at. I've just noticed that artillery turrets attacking my dummies is the expected behavior because my dummies are based on entity-with-force, which is considered a military structure according to this. In this light, adding attack_target_mask and ignore_target_mask to artillery turrets as well does make sense because mods may use simple-entity-with-force for doing their magic.

So, if it's possible in any way, please add attack_target_mask and ignore_target_mask to the properties of the active-defense-equipment and the active-defense-equipment prototypes! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Pi-C
Smart Inserter
Smart Inserter
Posts: 1274
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Target masks for active-defense-equipment, artillery turret and spidertron

Post by Pi-C »

An addition: Spidertrons don't have ignore_target_mask and attack_target_mask either, so they attack dummies from Water Turret as well although they can't hurt them. So it would be great if they could get target masks as well. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

JonnyOnSeSocks
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Nov 17, 2020 10:11 pm
Contact:

Re: Target masks for active-defense-equipment, artillery turret and spidertron

Post by JonnyOnSeSocks »

+1

I just found this request as I had the same issue with the artillery turret attacking enemy "dummy target entities" of the simple-entity-with-force prototype. I could also use the combat-robot or land-mine prototype workaround to keep the artillery from firing at the dummy entities but just realized the laser defense and spidertron issue due to this post.
After a little more investigation I also found the same issue with combat-robots and the automatic player targeting (pistol, SMG) shooting at the dummy entities but there is no option to set the ignore_target_mask or attack_target_mask and the unit type prototype workaround does not work in this case like for the artillery.

I think it would be great to add ignore_target_mask and attack_target_mask to the gun prototype as it would solve the player, artillery and spidertron issue (all use gun prototypes to shoot) as well as to the combat-robot and active-defense-equipment.
This would enable mods to use the simple-entity-with-force prototype as targetable military enemy structure (to do their magic :) ) and would complete the target_mask integration for the rest of the automatically attacking prototypes (hope I did not miss any). I also think this would open up interesting options for PvP mods.

so in summary:
please add ignore_target_mask and attack_target_mask to prototypes
> gun
> active-defense-equipment
> combat-robot

TY!

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

Re: Target masks for active-defense-equipment, artillery turret and spidertron

Post by Deadlock989 »

+1 for ignore_target_mask at least on ADEs. It is currently impossible to get them to ignore entities that a turret entity equivalent ignores.
"If Stalin had a good writeup on programming, would linking that be dangerous?"

sh4dow
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun May 26, 2019 8:50 pm
Contact:

Re: Target masks for active-defense-equipment, artillery turret and spidertron

Post by sh4dow »

+1

Post Reply

Return to “Modding interface requests”