Logistic Carts


Carts (mini cars) carry items around a network of painted paths.

Content
2 years ago
1.1
1.23K
Logistics

b Thank you & Bug when deleting sticker

2 years ago

First of all thank you for your fix of the constant combinator error of the original mod. Nevertheless I got another error that crashed my online game (I had to restart the game server afterwards). This error came up when I wanted to delete arrows that had stickers on them as well as the sticker itself. Dont ask me if it was the deletion of the sticker or the arrow which had a sticker on it:

16374.066 Error MainLoop.cpp:1285: Exception at tick 21689147: The mod Logistic Carts (0.3.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event logicarts2::on_pre_player_mined_item (ID 11)
logicarts2/control.lua:912: attempt to index field '?' (a nil value)
stack traceback:
logicarts2/control.lua:912: in function <logicarts2/control.lua:900>
16374.067 Error ServerMultiplayerManager.cpp:91: MultiplayerManager failed: "The mod Logistic Carts (0.3.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event logicarts2::on_pre_player_mined_item (ID 11)
logicarts2/control.lua:912: attempt to index field '?' (a nil value)
stack traceback:
logicarts2/control.lua:912: in function <logicarts2/control.lua:900>"
16374.067 Info ServerMultiplayerManager.cpp:780: updateTick(21689147) changing state from(InGame) to(Failed)
16374.067 Quitting: multiplayer error.
16375.042 Info ServerMultiplayerManager.cpp:140: Quitting multiplayer connection.
16375.042 Info ServerMultiplayerManager.cpp:780: updateTick(4294967295) changing state from(Failed) to(Closed)

2 years ago

Thanks for the report. I will check it

1 year, 3 months ago

Did you see/fix the problem?

1 year, 3 months ago
(updated 1 year, 3 months ago)

(Might have been mined using the Nanobots mod.)

I could reproduce the error using nanobots to copy existing green logistic carts arrows with stickers to other positions and then delete them using nanobots, see: https://ludwig-software.de/uploads/logicarts_error.png

I suggest to make sure that this "nil" problem is catched in the lua code before it leads to game breaking errors.

Therefore I suggest to edit the control.lua lines 911 and 912 like this:

Instead of currently:

if entity.name == STICKER then
mod.stickers[entity.unit_number].display.destroy()
end

better:

if entity.name == STICKER and mod.stickers[entity.unit_number] ~= nil then
mod.stickers[entity.unit_number].display.destroy()
end

Using nanobots from https://mods.factorio.com/mod/Nanobots also leads to the problem that copying green arrow path tiles with stickers with items leads to path tiles having a sticker but no item on the sticker. If you click the sticker and leave it again then the sticker appears. If you delete the path tile which has a sticker without any visible item then you get an error like this: https://ludwig-software.de/uploads/logicarts_error_incompatible_with_nanobots.png

Don't you use the nanobots mod yourself?

New response