Upgrade Planner / Fast replace modded rails

Place to get help with not working mods / modding interface.
yeahtoast
Inserter
Inserter
Posts: 21
Joined: Wed Feb 27, 2019 6:17 pm
Contact:

Upgrade Planner / Fast replace modded rails

Post by yeahtoast »

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.

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"
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.

20190512133719_1.jpg
20190512133719_1.jpg (457.85 KiB) Viewed 1395 times
20190512133726_1.jpg
20190512133726_1.jpg (496.2 KiB) Viewed 1395 times
20190512133732_1.jpg
20190512133732_1.jpg (519.69 KiB) Viewed 1395 times
20190512133735_1.jpg
20190512133735_1.jpg (525.96 KiB) Viewed 1395 times

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?

20190512133810_1.jpg
20190512133810_1.jpg (661.76 KiB) Viewed 1395 times
20190512133812_1.jpg
20190512133812_1.jpg (663.19 KiB) Viewed 1395 times

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?
Last edited by yeahtoast on Mon May 13, 2019 4:35 pm, edited 1 time in total.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Upgrade Planner / Fast Replace Rail Help

Post by TheSAguy »

I’ve run into the same issue in Bio Industries.
Was hoping to be able to upgrade wood rail to cement, but no solution yet...
Hope you have better luck.
Post Reply

Return to “Modding help”