Train Supply Manager (TSM)


Control train scheduling via a publish/subscribe event based system. Easy to use, and stress tested to gigabase level. Includes automated refueling. Distributed priorities for sourcing, and request priorities. Setup via simple to use GUIs and basic combinators.

Content
7 months ago
0.17 - 1.1
15.6K
Trains

g index nil value error

7 months ago

The error happens when clicking "show requestors train stops and priority assignments" > "e". Detailed log can be found below:

Error while running event train-pubsub::on_gui_click (ID 1)
train-pubsub/control.lua:1299: attempt to index field '?' (a nil value)
stack traceback:
train-pubsub/control.lua:1299: in function <train-pubsub/control.lua:924>
206.193 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Train Supply Manager (1.1.18) caused a non-recoverable error.
Please report this error to the mod author.

7 months ago

I was browsing the code.

local backer_name, cur_pub = resource_id(element.name, 8)
...
gui_open(player, global.newpublishers[player.surface.name][backer_name][cur_pub].entity, true)

A bit more context, I had multiple renames/edit of both source ids and its supplystations. To fix the crash I introduced a new resource id pair, added the supply stations and updated all requester station to use the new pair, and deleted the old one. Now this works and I cannot reproduce it anymore...

7 months ago

OK. Here is the save that can produce it: https://drive.google.com/file/d/1ZDeERDXwTTtsdXNEiW9bympg0_IFOEqE/view?usp=sharing
Open the request station list, click the "e" on any requester which uses virtual-signal as the 2nd resource id will crash the game.

I use (item, signal-E) pair for the empty train of that item and I use signal-Any to for universal dumping station

billbo99 β˜†
7 months ago

I can add some code protection .. looks like you deleted the requester lights.

New response