Train Control Signals

by Klonan

Simple ways of controlling trains.

Content
3 years ago
1.1
25.5K
Trains

b Error while running event Train_Control_Signals::on_train_changed_state (ID 24)

2 years ago
(updated 1 year, 8 months ago)
The mod Train Control Signals (1.0.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Train_Control_Signals::on_train_changed_state (ID 24)
__Train_Control_Signals__/script/train_control_signals.lua:40: attempt to index local 'station' (a nil value)
stack traceback:
    __Train_Control_Signals__/script/train_control_signals.lua:40: in function 'station_is_disabled'
    __Train_Control_Signals__/script/train_control_signals.lua:145: in function 'handler'
    __core__/lualib/event_handler.lua:47: in function <__core__/lualib/event_handler.lua:45>
1 year, 8 months ago

I have the same error

Error while running event Train_Control_Signals::on_train_changed_state (ID 25)
__Train_Control_Signals__/script/train_control_signals.lua:40: attempt to index local 'station' (a nil value)
stack traceback:
    __Train_Control_Signals__/script/train_control_signals.lua:40: in function 'station_is_disabled'
    __Train_Control_Signals__/script/train_control_signals.lua:145: in function 'handler'
    __core__/lualib/event_handler.lua:47: in function <__core__/lualib/event_handler.lua:45>

It was happened when I change a state of a train from auto to Manual control.

1 year, 6 months ago

Hoy

Same error, we were online, one player changed auto to manual as well. But we don't manage to reproduce.

5 months ago

The error still there, having the same issue, change from auto to manual = crash

5 months ago
  • Little update, the crash only occurs while changing to manual during the inactivity countdown and if the station before where the train stopped on the schedule is a temporary one, and doesn't need to be a rider on the train.
2 months ago
(updated 2 months ago)

I got the same problem and I changed the code in script\train_control_signals.lua to the following (starting line 135) and wasn't able to reproduce the behaviour. (unzip it, change the code, zip it)

local current = schedule.current
local index = current
while true do
  index = index - 1
  if index == 0 then index = #schedule.records end
  if index == current then break end
  if schedule.records[index].station then
    if station_is_open_depot(schedule.records[index].station) then
      schedule.current = index
      break
    end
    if not station_is_disabled(schedule.records[index].station) then
      break
    end
  end
end

end

2 months ago

Does Klonan accept pull requests? :D

2 months ago

I guess this mod isn't maintained anymore because its obsolete when the expansion is released with the remodeled train behaviour. Don't know if he has much spare time between summer activities and finalizing Space Age ;-)

New response