Nanite-Construction-System / NaniteConstructionSystem

A continuation of scripts for the Nanite Construction System
14 stars 13 forks source link

Factory deconstructs all blocks in range when loading save with area beacon #144

Open JacksonTech opened 4 years ago

JacksonTech commented 4 years ago

The Nanite Factory will deconstruct all blocks in range and not on the main grid if a save is loaded with the following conditions:

  1. An Area beacon is present in the world
  2. The Area beacon has Deconstruction enabled
  3. Grids exist outside of the range of affect of the Area beacon and not on the factory grid.

If these cases are true, then, upon world load (e.g., dedicated server restart, or single player world load), the Nanite factory will consider all grids in range and not on the factory grid to be valid deconstruction targets. We lost a few ships this way! (Fortunately someone noticed eventually.)

My guess is that the Area beacon's area of effect is not being properly positioned or scaled on load, as I can't see where the area is after loading a game (I could see it when I first placed it, and I see that it was saved properly in the beacon settings data file in the game save).

Attached is a sample world with debug log enabled (level 1?) and debug screenshot. The issue happens on both singleplayer and dedicated server.

image

Nanite Test - Bugged - Beacon Placed.zip

JacksonTech commented 4 years ago

After additional testing:

  1. Removing the beacon entirely does not stop the grids that are in the middle of being deconstructed from being deconstructed.
  2. Removing the beacon, saving, and reloading DOES stop the deconstruction.
  3. Adding a (non-Area) beacon to a ship does cause it to be deconstructed.
  4. Removing said beacon in the middle of deconstruction also does not stop the ship from being deconstructed.
  5. Toggling the Nanite factory on/off, and/or toggling the Deconstruction checkbox on/off, does not help either with Area or non-Area beacons.

Reloading the save/restarting the server will stop any deconstructions in progress if there are no beacons attached to the grid.

This is non-intuitive behavior. Is there any way to force the Nanite factories to drop what they're doing and rescan?