eugenekay wrote: Fri Apr 24, 2026 12:41 pm
You could post your Mod (or at least the Turret prototype code) so we can see the problem in action.
Are you using table.deepcopy to create a Gun Turret clone, or instantiating the entire prototype by hand? At a guess,
ProjectileAttackParameters has optional properties
lead_target_for_projectile_speed/delay, which default to 0. If these are not set then I believe that turrets will “dumbly” aim for where the enemy Is, rather than where it is Going. The asteroids move quite a bit, so they need to lead their shots.
Good Luck!
-Eugene
I will also post the properties of the projectile used in the turret.
{
name = "photon-torpedo",
type = "projectile",
flags = {"not-on-map"},
acceleration = 0,
direction_only = true,
hidden = true,
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
force_condition = "not-same",
height = 1,
hit_at_collision_position = true,
action = {
type = "direct",
action_delivery = {
target_effects = {
{
entity_name = "photon-hit",
type = "create-entity"
},
{
entity_name = "photon-shock",
type = "create-entity"
},
{
damage = {
amount = 180,
type = "explosion"
},
type = "damage"
},
{
check_buildability = true,
entity_name = "small-scorchmark",
type = "create-entity"
},
{
type = "invoke-tile-trigger",
repeat_count = 1
},
{
type = "destroy-decoratives",
from_render_layer = "decorative",
to_render_layer = "object",
include_soft_decoratives = true, -- soft decoratives are decoratives with grows_through_rail_path = true
include_decals = false,
invoke_decorative_trigger = true,
decoratives_with_trigger_only = false, -- if true, destroys only decoratives that have trigger_effect set
radius = 3.5 -- large radius for demostrative purposes
},
{
action = {
action_delivery = {
target_effects = {
{
damage = {
amount = 240,
type = "explosion"
},
type = "damage"
},
{
entity_name = "explosion",
type = "create-entity"
}
},
type = "instant"
},
radius = 4,
type = "area"
},
type = "nested-result"
}
},
type = "instant"
},
},
}