Optional power grid requirement for ammo-turret entities
Posted: Sat Aug 04, 2018 3:40 pm
TL;DR
Make ammo-turret entities use and require electric power grid if LuaEntityPrototype.energy_source is not nil.What ?
Currently ammo-turret type entities completely ignore electric grid information. I tried to make turrets that take ammo AND require electric energy as well,but ammo-turret entities ignore energy_source entry and electric-turret entities cannot be fed with ammo even if ammo_category is not set to electric.
Since code for this is already in the game (Laser Turrets), this should be very easy to implement.
For example:
Code: Select all
type = "ammo-turret",
name = "w93-rocket-turret2",
...
energy_usage = "300kW",
energy_source =
{
type = "electric",
drain = "50kW",
usage_priority = "secondary-input"
},
...
attack_parameters =
{
type = "projectile",
ammo_category = "rocket",
...