[Klonan] [2.0.28] Target leading interferes with range bonuses in turrets
Posted: Sun Dec 22, 2024 10:30 pm
When an ammo turret uses target leading functionality AND its ammo is both non-homing and has a range bonus, projectiles will detonate prematurely when reaching base maximum range of the turret. If I remove "lead_target_for_projectile_speed = 1" from the turret prototype, projectiles correctly reach the target in the extended range. This issue was introduced in Factorio version 2.0.24 where turrets can now receive ammo range bonuses (modifier did nothing for them before that point).
Attached savefile (Test.zip) and a mod for the testing. Load the cannon ammo from the character inventory into the turrets to recreate the problem. Then open the turret prototype (its "w93-lcannon-turret"), remove "lead_target_for_projectile_speed = 1" and try the save again, shells shoud reach the nest now.
Mod modifies cannon ammo to play nice with its turrets by doing the following changes:
Screenshot showing the issue:
Attached savefile (Test.zip) and a mod for the testing. Load the cannon ammo from the character inventory into the turrets to recreate the problem. Then open the turret prototype (its "w93-lcannon-turret"), remove "lead_target_for_projectile_speed = 1" and try the save again, shells shoud reach the nest now.
Mod modifies cannon ammo to play nice with its turrets by doing the following changes:
Code: Select all
data.raw["ammo"]["cannon-shell"].ammo_type.target_type = "position"
data.raw["ammo"]["cannon-shell"].ammo_type.action.action_delivery.max_range = nil
data.raw["ammo"]["cannon-shell"].ammo_type.action.action_delivery.direction_deviation = nil
data.raw["ammo"]["cannon-shell"].ammo_type.action.action_delivery.range_deviation = nil
data.raw["projectile"]["cannon-projectile"].force_condition = "not-same"
data.raw["projectile"]["cannon-projectile"].direction_only = false
data.raw["projectile"]["cannon-projectile"].hit_collision_mask = {layers={object=true, player=true, train=true, trigger_target=true}}