Add can_shoot(target,position) to turrets
Posted: Fri Mar 06, 2020 3:50 pm
Usually, turrets automatically look for a target they can reach. I've described a case here where turrets get targets assigned by script. This will always work for turrets of the "ammo-turret" protptype ("electric-turret" as well, I guess), but not for turrets of the prototype "fluid-turret", because fluid turrets can only cover a segment of a circle instead of a whole circle.
Currently, it is not possible without potentially expensive trickery (intersecting results from find_entities_filtered{area=…, …} and find_entities_filtered{position=…, radius=…, …}, trigonometry etc.) to determine whether a given turret can actually reach a certain enemy unit. Players have the property "can_shoot(target, position). Making this property available to fluid turrets would be extremely helpful. Would you consider adding it, please?
Currently, it is not possible without potentially expensive trickery (intersecting results from find_entities_filtered{area=…, …} and find_entities_filtered{position=…, radius=…, …}, trigonometry etc.) to determine whether a given turret can actually reach a certain enemy unit. Players have the property "can_shoot(target, position). Making this property available to fluid turrets would be extremely helpful. Would you consider adding it, please?