I tried this:
Code: Select all
local enemies = turret.surface.find_entities_filtered{
type = targets,
position = turret.position,
radius = turret.prototype.attack_parameters.range,
direction = turret.direction,
}
For my next attempt, I removed direction:
Code: Select all
local enemies = turret.surface.find_entities_filtered{
type = targets,
position = turret.position,
radius = turret.prototype.attack_parameters.range,
}
I thought I could cover such cases by eliminating enemies where "turret.can_shoot(enemy, enemy.position) == false" from the list. Of course, that didn't work because can_shoot is for characters only.
So, what options do I have to find enemies within the area covered by a fluid turret?