"bob-laser-turret-2"
"bob-laser-turret-3"
"bob-laser-turret-4"
"bob-laser-turret-5"
Im trying to make them slow firing snipers, but the beam type attack keeps bugging in max range (fire and consumes energy, but does zero damage), it also happens in other mods that adds long range lasers... I will try to change that too when i have time.
I know next to nothing about programming and modding, but im a very smart monkey, these are my changes to your code that im currently using... you will need to add some IF lines to prevent it from executing when not using bobs or the game will crash on start...
...........................................................................
function updateLaserTurret(name, cooldown, range, damage_modifier, energy_consumption, energy_imput, energy_buffer)
if data.raw["electric-turret"][name] then
data.raw["electric-turret"][name].attack_parameters.cooldown = cooldown
data.raw["electric-turret"][name].attack_parameters.range = range
data.raw["electric-turret"][name].attack_parameters.damage_modifier = damage_modifier
data.raw["electric-turret"][name].attack_parameters.ammo_type.energy_consumption = energy_consumption
data.raw["electric-turret"][name].energy_source.input_flow_limit = energy_imput
data.raw["electric-turret"][name].energy_source.buffer_capacity = energy_buffer
end
end
updateLaserTurret("laser-turret", 60, 30, 5, "800kJ", "20000kW", "8000kJ")
updateLaserTurret("bob-laser-turret-2", 55, 35, 10, "1200kJ", "20000kW", "12000kJ")
updateLaserTurret("bob-laser-turret-3", 50, 40, 15, "1600kJ", "20000kW", "16000kJ")
updateLaserTurret("bob-laser-turret-4", 45, 45, 20, "2400kJ", "20000kW", "24000kJ")
updateLaserTurret("bob-laser-turret-5", 40, 50, 25, "3400kJ", "20000kW", "34000kJ")