#Console command for deleting orphaned rails?

1 messages · Page 1 of 1 (latest)

grand parcel
#

orphaned as in at most one connected rail

pixel hunting for (image) after deleting intersections is getting kinda old

#

Console command for deleting orphaned rails?

glossy heart
#

My solution for that is using grid aligned rail blueprints.
When changing some rails, like adding an intersection, I deconstruct a generous chunk to prevent this.

rustic kite
#

You could probably make something using LuaEntity::get_connected_rail

Find all rails in a given area, run that function for each direction and for both ends, delete the rail if one side is empty.

grand parcel
grand parcel
grand parcel
#

doesnt prune the whole branch
and personal bots seem to only respond to first order_deconstruction(), but whatever, good enough for my use case

stiff dew
#

i don't think i saw anything preventing deleting rails that have a train stop attached (?)

grand parcel
#

stopped there cuz i learned i kinda hate lua lol

stiff dew
#

i'd just be worried that it eats rails that lead into deadend stations