The Blueprint Lab - Bud

by Likos

Enter your lab to design your blueprints.

Content
4 years ago
0.17
11
Blueprints

b Error message clearing lab

5 years ago

The mod The Blueprint Lab - Bud caused a non-recoverable error.
Please report this error to the mod author.

Error while running event BlueprintLab_Bud17::on_gui_click (ID 1)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
BlueprintLab_Bud17/scripts/common.lua:15: in function 'DestroyEntity'
BlueprintLab_Bud17/scripts/logic.lua:125: in function 'ClearLab'
BlueprintLab_Bud17/scripts/gui.lua:34: in function <BlueprintLab_Bud17/scripts/gui.lua:28>
stack traceback:
[C]: in function 'index'
__BlueprintLab_Bud17
/scripts/common.lua:15: in function 'DestroyEntity'
BlueprintLab_Bud17/scripts/logic.lua:125: in function 'ClearLab'
BlueprintLab_Bud17/scripts/gui.lua:34: in function <BlueprintLab_Bud17/scripts/gui.lua:28>

5 years ago

it crashes for me too everyso often but can we also add a confirmation box when clearing i almost lost like 12 hours of work because i fat fingered the clear instead of leave button (on a server so no local autosaving)

5 years ago

Sorry, missing a week. Tomorrow fix this

4 years ago

Hi! What mods you using, when you get this error?

4 years ago

Oh my... It will not be easy to find the mod that caused the error :-)

4 years ago

sorry D;

4 years ago

I'd start with LTN, Train Supply Manager and Electric Trains. All three of those mods create extra entities when their particular item is placed in the world and remove it when it is mined/destroyed.

Looking at your clear lab code it gets all entities on the lab surface then goes down the list destroying them indiscriminately. Which is fine until a player places a multi-entity item. Player places say LTN train stop, LTN detects LTN train stop and spawns a special LTN combinator next to the train stop. Your mod when cleaning the lab destroys the LTN train stop, LTN destroys LTN combinator, your mod attempts to destroy LTN combinator, your mod blows up because entity isn't valid.

I bet adding a quick sanity check to the start of DestroyEntity function would solve the issue for just about every mod.

if not entity.valid then
--Entity already destroyed. Next!
return
end

4 years ago

Fixed

4 years ago

Really thanks.
Then I can come to use it freely and safely. :D

New response