Upgrade Planner / Fast replace modded rails
Posted: Sun May 12, 2019 8:55 pm
I'm working on a mod that adds a new kind of rail, basically just a cosmetic change with a different recipe. I wanted the ability to use the Upgrade Planner to easily switch between rail styles, so I added these lines into the entities.lua.
It works as intended. There's one strange problem, though. When building rails by hand, intersections are impossible as the rail that is crossed is fast replaced by the rail doing the crossing. This affects both vanilla and modded rails since they're all in the "rail" fast replaceable group.
The even weirder part is that I can't actually fast replace the two different rail types with each other by hand, only by upgrade planner. Is this supposed to happen? This problem doesn't exist when building with bots, so I'm thinking it might be an edge case in rail construction?
Ultimately, all I want is for the rails to be replaceable with the Upgrade Planner. Is there another way to do this that doesn't break rail building?
Code: Select all
data.raw["straight-rail"]["straight-rail"].fast_replaceable_group = "rail"
data.raw["curved-rail"]["curved-rail"].fast_replaceable_group = "rail"
data.raw["straight-rail"]["new-straight-rail"].fast_replaceable_group = "rail"
data.raw["curved-rail"]["new-curved-rail"].fast_replaceable_group = "rail"
The even weirder part is that I can't actually fast replace the two different rail types with each other by hand, only by upgrade planner. Is this supposed to happen? This problem doesn't exist when building with bots, so I'm thinking it might be an edge case in rail construction?
Ultimately, all I want is for the rails to be replaceable with the Upgrade Planner. Is there another way to do this that doesn't break rail building?