Subsurface - build beneath your base!

by Natha

While everyone is looking up to space, other planets and the rest of the universe, there is a whole world buried directly underneath us. Use this opportunity to declutter your factory logistics by routing it under your base and explore the underground!

Content
15 days ago
1.1 - 2.0
4.07K
Environment Mining

b [Fixed] Autoplace settings bug

25 days ago

Trying to drill on Gleba yields this error note. It appears when the surface drill is supposed to create the tunnel. (reminder that Gleba has no mineable resources other than stone, which doesn't spawn underground)

Error while running event Subsurface::on_resource_depleted (ID 31)
Subsurface/scripts/resources.lua:8: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
Subsurface/scripts/resources.lua:8: in function 'place_resources'
Subsurface/control.lua:237: in function 'clear_subsurface'
Subsurface/control.lua:521: in function <Subsurface/control.lua:507>

I tried to fix that myself but I have no idea what to do.

25 days ago
(updated 25 days ago)

Addition: I tried this isolated and it does happen. I also installed all the planet mods I could find, and the result was one: Only Gleba is broken, even SS++ planets based off of Gleba work normally.

Edit: Tried to dredge the "planet" Neumann from the mod Metal and Stars, which doesn't have mineable resources at all (so it doesn't have resources to spawn in the subsurface, like Gleba), and it crashes with the same error.

24 days ago

Could you replace line 8 with the following and try again:
for proto, _ in pairs((surface.map_gen_settings.autoplace_settings.entity or {settings = {}}).settings or {}) do

24 days ago

Will try as soon as I get home

20 days ago

Sorry for not replying for so long, dang I thought I did reply
It works perfectly with the line you provided

New response