This library will help you disable buildings (by name) on specific surfaces. How to enable and configure them is below.
--control.lua
--[[
local DeepSpaceRestrictor = require("dsr-lib.control")
if not data then
data = {extend = function(_, tbl)
DeepSpaceRestrictor.load_rules(tbl)
end}
end
require("rules") -- this is where the rules come from
DeepSpaceRestrictor.setup()
]]
--rules.lua
--[[
data:extend({
{
type = "disabled-zone",
name = "vulcanus-n", --name
zone_type = "location", --location = planet or space-location , connection = space-connection
zone_name = "vulcanus", --location name
buildings = {"assembling-machine-3", "gun-turret"}, --list
overlay_sprite = "freeze-overlay" --overlay
},
})
]]
More details in guide.lua
AI was used in writing the draft code