Project Cybersyn - Logistics Train Dispatcher


Creates a feature-rich train logistics network through cybernetic combinators. With just this mod you can coordinate the economic inputs and outputs of your entire megabase.

Content
7 months ago
1.1
15.7K
Logistics Trains Circuit network

b Auto allow list not working on 10 st rail

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

In railway station made of 10 straight rails and rest curved, with 1-2 trains, auto allow list doesn't work. It starts working if I increase the number of straight rails to 11.
doesn't work: (10 st rails.)

...β €β €β €β €β €β €β €β €β €β €
/β€Žβ€Žβ€Žβ€Žβ€Žβ€Žβ €β €β €β €β €β €β €β €β €β €β €\
|β €β €β €β €β €β €β €β €β €β €β €β €|

Works fine: (11 st rails.)
...β €β €β €β €β €β €β €β €β €β €β €
/β €β €β €β €β €β €β €β €β €β €β €β €\
|β €β €β €β €β €β €β €β €β €β €β €β €β €|

1 year, 2 months ago

Having the same problem with 1-4 trains, guessing there is an off-by-one error when checking whether a train fits in a station(?)

1 year, 2 months ago

Patching layout.lua with this fixes the problem for me by effectively allowing curved rail to be part of the station only on the last segment. Probably not a proper fix though

        local rail, rail_direction, rail_connection_direction = pre_rail.get_connected_rail({rail_direction = rail_direction_from_stop, rail_connection_direction = defines.rail_connection_direction.straight})
        if not rail or not rail.valid then
            rail, rail_direction, rail_connection_direction = pre_rail.get_connected_rail({rail_direction = rail_direction_from_stop, rail_connection_direction = defines.rail_connection_direction.left})
            if not rail or not rail.valid then
                rail, rail_direction, rail_connection_direction = pre_rail.get_connected_rail({rail_direction = rail_direction_from_stop, rail_connection_direction = defines.rail_connection_direction.right})
            end
        end
        if not rail or not rail.valid then
            is_break = true
            break
        end
1 year, 2 months ago
(updated 1 year, 2 months ago)

Thank you. Sounds like proper fix to me.

In a simple look at the your code, it doesn't seem to differentiate between last segment and non-last segment. Though I might be wrong.

1 year, 2 months ago

At the end of the block in the code it breaks out of the loop if the rail isn't straight which handles that case.

1 year, 2 months ago

Okay, thanks again.

New response