here is how the resources are fetched.
/c
local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = "Nauvis"})
for _, control in pairs(game.autoplace_control_prototypes) do
if control.category == "resource" then
if zone.controls[control.name] then
local zone_controls= zone.controls[control.name]
game.player.print(control.name .. " " .. zone_controls.frequency .. " " .. zone_controls.richness)
else
game.player.print(control.name .. " " .. 0 .. " " .. 0)
end
end
end
I have the mod disabled and still works.
with this you can generate any resources without an interface. I would match the richness and apply the depth.
I have Added this in the resources.lua:
function make_autoplace_controls(topname, depth)
local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = (topname:gsub("^%l", string.upper))})
res_table={}
for _, control in pairs(game.autoplace_control_prototypes) do
if control.category == "resource" then
if zone.controls[control.name] then
local zone_controls= zone.controls[control.name]
local freq=zone_controls.frequency
local rich=zone_controls.size
local siz=zone_controls.richness
if control.name=='crude-oil' or control.name=='adamo-carbon natural-gas' or control.name=='mineral-water' then
siz=siz*0.01
end
-- This is for mods added after space exploration.
if freq==0 and rich==0
then
freq=1
rich=1
siz=1
end
-- end of exception
local res={
frequency = freq*(1+depth*0.2),
size = rich*(1+depth*0.2),
richness = siz*(1+depth*0.2)
}
res_table[control.name]=res;
end
end
end
return res_table
end
It works like wonders.
Adapt it to your needs