I've been trying to figure this out myself (I like to try and do these things myself as I learn much better that way ) but just can't get this one, and it's driving me nuts.
What I have:
I have made a fixed sized sandbox test area. I usually just dump a heap of solar for power but noticed on the Production Challenge scenario there is a electric-energy-interface providing power.
What I want to do:
Have an electric-energy-interface in my map and set the properties as I like ie unlimited power without having to enable a mod.
Is there a reasonably simple way of adding to the control.lua to do this? Or a reasonably simple way to do this?
This is my first post so cheers for any help.
Edit:
So for anyone interested I finally figured it out.
Code: Select all
script.on_init(function()
global.p_providers = {}
for i=1,16,1 do
local p_provider = game.get_entity_by_tag("Tag" .. i)
p_provider.destructible = false
p_provider.minable = false
p_provider.rotatable = false
p_provider.power_production = 5 * 10^9
p_provider.power_usage = 0
p_provider.electric_buffer_size = 5 * 10^9
p_provider.energy = 2.55 * 10^9
p_provider.electric_output_flow_limit = 50000000
p_provider.electric_input_flow_limit = 50000000
global.p_providers[i] = p_provider
end
global.p_substations = {}
for i=17,24,17 do
local p_substation = game.get_entity_by_tag("Tag" .. i)
p_substation.destructible = false
p_substation.minable = false
p_substation.rotatable = false
global.p_substations[i] = p_substation
end
p_pole = game.get_entity_by_tag("Tag0")
p_pole.destructible = false
p_pole.minable = false
p_pole.rotatable = false
end)
Now to figure out how to export a map to a map_settings.lua file...