Rail Logistics Dispatcher

by Viidi

Adds a dispatcher (building) to automate railway logistics based on provide and request stations. Has intuitive interface. Was inspired by LTN but went a different way.

Content
3 days ago
1.1 - 2.0
2.96K
Logistics Trains

b Crash on removing train

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

When I try to remove one specific train the game crashes with the following error. About half of my trains are affected by this issue :(
The mod version is 0.0.16

Error while running event RailLogisticsDispatcher::on_player_mined_entity (ID 67)
__RailLogisticsDispatcher__/script/SurClass.lua:582: attempt to call method 'removeDeliveryFromStop' (a nil value)
stack traceback:
    __RailLogisticsDispatcher__/script/SurClass.lua:582: in function 'removeDelivery'
    __RailLogisticsDispatcher__/script/SurClass.lua:567: in function 'removeDeliveriesBy'
    __RailLogisticsDispatcher__/script/SurClass.lua:641: in function 'removeTrain'
    __RailLogisticsDispatcher__/script/TrainClass.lua:436: in function 'handleRemoved'
    __RailLogisticsDispatcher__/control.lua:154: in function <__RailLogisticsDispatcher__/control.lua:147>
1 year, 10 months ago

And after removing some station game just crashes in a half minute after loading my save with the following error:
` Error while running event RailLogisticsDispatcher::on_nth_tick(2) __RailLogisticsDispatcher__/script/TrainClass.lua:165: attempt to index local 'schedule' (a nil value) stack traceback: __RailLogisticsDispatcher__/script/TrainClass.lua:165: in function '_findDepotNameInSchedule' __RailLogisticsDispatcher__/script/TrainClass.lua:185: in function '_appendDepot' __RailLogisticsDispatcher__/script/TrainClass.lua:427: in function 'gotoToDelivery' __RailLogisticsDispatcher__/script/SurClass.lua:400: in function '_tryToMakeDelivery' __RailLogisticsDispatcher__/script/SurClass.lua:246: in function <__RailLogisticsDispatcher__/script/SurClass.lua:194> (...tail calls...) __RailLogisticsDispatcher__/script/SurClass.lua:108: in function <__RailLogisticsDispatcher__/script/SurClass.lua:97>

1 year, 10 months ago

Same thing when train is killed

The mod Rail Logistics Dispatcher (0.0.16) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RailLogisticsDispatcher::on_entity_died (ID 4)
RailLogisticsDispatcher/script/SurClass.lua:581: attempt to call method 'removeDeliveryFromStop' (a nil value)
stack traceback:
RailLogisticsDispatcher/script/SurClass.lua:581: in function 'removeDelivery'
RailLogisticsDispatcher/script/SurClass.lua:567: in function 'removeDeliveriesBy'
RailLogisticsDispatcher/script/SurClass.lua:641: in function 'removeTrain'
RailLogisticsDispatcher/script/TrainClass.lua:436: in function 'handleRemoved'
RailLogisticsDispatcher/control.lua:154: in function <RailLogisticsDispatcher/control.lua:147>

1 year, 10 months ago

Thanks for your interest in my mod. Thanks for reporting the bug - I'll look for it and fix it!

1 year, 10 months ago

And after removing some station game just crashes in a half minute after loading my save with the following error:
` Error while running event RailLogisticsDispatcher::on_nth_tick(2) __RailLogisticsDispatcher__/script/TrainClass.lua:165: attempt to index local 'schedule' (a nil value) stack traceback: __RailLogisticsDispatcher__/script/TrainClass.lua:165: in function '_findDepotNameInSchedule' __RailLogisticsDispatcher__/script/TrainClass.lua:185: in function '_appendDepot' __RailLogisticsDispatcher__/script/TrainClass.lua:427: in function 'gotoToDelivery' __RailLogisticsDispatcher__/script/SurClass.lua:400: in function '_tryToMakeDelivery' __RailLogisticsDispatcher__/script/SurClass.lua:246: in function <__RailLogisticsDispatcher__/script/SurClass.lua:194> (...tail calls...) __RailLogisticsDispatcher__/script/SurClass.lua:108: in function <__RailLogisticsDispatcher__/script/SurClass.lua:97>
It's more like some train has lost its schedule.

1 year, 10 months ago

@miob, @odt1

Can you share the game save where the error occurs?

It is not difficult to understand how to hide the error, but I want to understand where it came from.

New response