My apologies. It really works. I placed turrets directly in the editor and it turns out that in this case the energy buffer is already charged.
But there is one small bug. After placing ammunition in the turret, the electricity icon disappears. But when working with the code https://mods.factorio.com/mod/ElectricPoweredBelts the icons do not disappear, so it makes sense to poke around with this mod... I even suspect that through control.lua you can solve the problem with the fluid turret and artillery turret. But my own knowledge is not enough for this
I also have two mods that have an ammo turret
Can you add the code below to your mod:
if mods["My_add_pack_updated"] and true then
-- Турель дробовик
data.raw["ammo-turret"]["shotgun-turret"].energy_source = {
type = "electric", -- Тип потребления энергии
buffer_capacity = "800kJ", -- Объем
input_flow_limit = "100kW", -- Максимальное потребление
usage_priority = "primary-input", -- Приоритет потребления
drain = "10kW" -- Минимальное потребление
}
data.raw["ammo-turret"]["shotgun-turret"].energy_per_shot = "8kJ" -- Расход на выстрел
-- Снайперская турель
data.raw["ammo-turret"]["sniper-turret"].energy_source = {
type = "electric", -- Тип потребления энергии
buffer_capacity = "1000kJ", -- Объем
input_flow_limit = "150kW", -- Максимальное потребление
usage_priority = "primary-input", -- Приоритет потребления
drain = "10kW" -- Минимальное потребление
}
data.raw["ammo-turret"]["sniper-turret"].energy_per_shot = "10kJ" -- Расход на выстрел
-- пушечная турель
data.raw["ammo-turret"]["cannon-turret"].energy_source = {
type = "electric", -- Тип потребления энергии
buffer_capacity = "1000kJ", -- Объем
input_flow_limit = "200kW", -- Максимальное потребление
usage_priority = "primary-input", -- Приоритет потребления
drain = "10kW" -- Минимальное потребление
}
data.raw["ammo-turret"]["cannon-turret"].energy_per_shot = "18kJ" -- Расход на выстрел
end
if mods["ironclad-gunboat-and-mortar-turret-fork"] and true then
-- Миномет
data.raw["ammo-turret"]["mortar-turret"].energy_source = {
type = "electric", -- Тип потребления энергии
buffer_capacity = "1000kJ", -- Объем
input_flow_limit = "200kW", -- Максимальное потребление
usage_priority = "primary-input", -- Приоритет потребления
drain = "20kW"
}
data.raw["ammo-turret"]["mortar-turret"].energy_per_shot = "50kJ" -- Расход на выстрел
end