Subsurface - build your base underground!

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
a month ago
1.1 - 2.1
8.58K
Transportation Logistics Trains Environment Mining

b [Fixed] Item Elevator de-syncs after fast replace

6 days ago

Hi!

The Item Elevators have a bug, where they can "de-sync" from their pair, and from that point on, if I try to remove/rotate it, it causes a non-recoverable error, and the the game exits to the main menu. Once the elevators are de-synced, the save is pretty much corrupted from that point on, as the entities can no longer be removed.

How to reproduce:

  1. Have at least two levels (e.g.: overworld, and one subsurface level) - I'll call them Layer 'A' and Layer 'B'
  2. Place an item elevator of any tier on Layer 'A'.
  3. Move to Layer 'B'
  4. Place the elevator's pair on 'Layer 'B'
  5. At this point, they are paired and work as expected
  6. If I hover over the elevator without the item in hand, and try to rotate, it switches the "layer transport direction" from Layer 'A' -> Layer 'B' to Layer 'B' -> Layer 'A' - the expected behavior.
  7. But, if I have the item in hand, and hover over the elevator on any of the layers, and I try to rotate, it will rotate the item elevator itself, not the "layer direction"
  8. If I placed the elevator with the belt facing down, I can rotate it, so the belt would be facing right for example.
  9. At this point, they are still synced. I can still remove or switch the layer transport direction.
  10. Now, if I replace the item elevator, e.g. upgrading from Tier 1 to Tier 2, or downgrading, they will de-sync.
  11. Now, when I hover over it, I no longer see the layer transport direction, but just the yellow boundaries of the placed item.
  12. Try to rotate or remove the item elevator, and it will cause a non-recoverable error

Rotate:

Error while running event Subsurface::subsurface-rotate (ID 301)
__Subsurface__/scripts/elevators.lua:25: attempt to index field '?' (a nil value)
stack traceback:
    __Subsurface__/scripts/elevators.lua:25: in function 'switch_elevator'
    __Subsurface__/scripts/elevators.lua:158: in function 'elevator_rotated'
    __Subsurface__/control.lua:918: in function <__Subsurface__/control.lua:912>

Remove:

Error while running event Subsurface::on_player_mined_entity (ID 76)
__Subsurface__/scripts/elevators.lua:270: bad argument #1 of 2 to 'ipairs' (table expected, got nil)
stack traceback:
    [C]: in function 'ipairs'
    __Subsurface__/scripts/elevators.lua:270: in function 'elevator_removed'
    __Subsurface__/control.lua:647: in function <__Subsurface__/control.lua:643>

I love the mod! And many-many thanks for investing the time and effort in it!

5 days ago

Will be fixed in the next release

New response