Train Control Signals

by Klonan

Simple ways of controlling trains.

Content
3 years ago
1.1
25.5K
Trains

b Stations that should not be skipped get skipped

3 years ago

I have a train with the following schedule:

Station: Depot signal (no wait condition)
Station: Pickup (Wait for full cargo)
Station Delivery (Wait for empty cargo)
Station: Refuel

The delivery stations are train-limited and usually fully stacked up.
The intention of this setup was that the train is in the depot until there is a pickup station available.
Then the train should wait at the pickup station until a Delivery-station becomes available.
After that it should check for refuel and go back to the depot (or go to pickup if one is active).

What actually happens:
The train goes from the depot to the pickup, detects that there is no available delivery and then goes back to the depot (supposedly skipping the Delivery stop).

3 years ago

Right, logic error on my side, should be fixed

3 years ago

Thanks...I'll try it out right away.
Being a .NET-developer myself I think I found the bug in the lua script already but I'm not firm enough in lua to actually find the solution :)

3 years ago

Ok...thanks again...works like a charm now :)

3 years ago

Here is another case with problem:

Station: Depot signal (no wait condition))
Station: Pickup (Wait for full cargo)
Station: Waiting to free pickup station (no condition)
Station Delivery: (Wait for empty cargo)

The conditions are the same as previous ones.
The trains should wait at the Waiting station until there is a delivery station available.
All stations are train-limited.

What happens: At the waiting station, the train goes directly to the depot when there is no delivery station available

I have tried a fix on the mod. I replace the line 76 in the file "train_control_signals.lua" with

local prev = schedule.current - 1
if prev == 0 then prev = #schedule.records  end
local prev_name = schedule.records[prev].station
return prev_name:find(depot_signal)

It seems to work

3 years ago

Hi Sorry for hte problem, It was a over zealous fix to another problem, it should be fixed now

3 years ago

It works. Thanks.

New response