Allow rail-planner with no curved rail

Things that we aren't going to implement
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Allow rail-planner with no curved rail

Post by mrvn »

I'm trying to create a rail waypoint entity that can be used in place of a straight rail but can be added to a trains schedule. Internally it is a straight rail with 2 hidden train stops to allow for bidirectional traffic.

So my plan was to create an entity rail-waypoint that is just a copy of straight rail. Also create a copy of train-stop that is invisible and will be added to the rail-waypoint via script.

Then I need an item for the rail-waypoint and there I run into trouble:

Code: Select all

local item_rail_waypoint = table.deepcopy(data.raw["rail-planner"]["rail"])
item_rail_waypoint.name = "rail-waypoint"
item_rail_waypoint.place_result = "rail-waypoint"
item_rail_waypoint.straight_rail = "rail-waypoint"
item_rail_waypoint.curved_rail = nil
A waypoint can not be a curved rail since I can't add train stops to that. But there is no way to tell the rail-planner that. The above gives:
1.254 Mods to disable:Failed to load mods: Error while loading item prototype "rail-waypoint" (rail-planner): Key "curved_rail" not found in property tree at ROOT.rail-planner.rail-waypoint
So my interface request is for a rail-planner with no curved_rail.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2251
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Allow rail-planner with no curved rail

Post by boskid »

Your usage is invalid. If you do not want to provide curved_rail, you clearly should not use "rail-planner" but a regular item instead. "rail-planner" is just a type of an item which enabled the rail planner feature and for this is requires to have both entities provided.

mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Allow rail-planner with no curved rail

Post by mrvn »

Seems to work, thanks. I was afraid if I don't use the same thing as real rails then the rail wouldn't work right in some ways, like the way the rail planer allows extending a rail and such.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2251
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Allow rail-planner with no curved rail

Post by boskid »

Rail planner is a special item type that enables certain building modes but for this it requires both entities provided. A rail entity does not know how it was built or from what item so any rail that you have on surface will work as a valid rail planner's starting point candidate once you have a rail planner item in the cursor stack.

As for the original request i am not interested in implementing that for 1.1.x. Rail plan finder logic would need a lot of changes to make it work with only straight rails. That would be quite interesting rail planner which once started would allow you to place only straight sections of rails.

mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Allow rail-planner with no curved rail

Post by mrvn »

It actually works much better without the rail planner in my case. Putting down a row of Waypoints makes no sense. With the rail-planner it was way to easy to put down a row. With the normal item each Waypoint has to be placed separately, much better.

So consider this issue closed pleased.

But if you are still thinking about a rail planner that only does straight rails then try dragging rails. Imho that should behave the same way belts do and only extend the track in the direction of the track. Movement perpendicular to the track should be ignored. Maybe that would be a simple change and then you have the rail-planner for straight+curved and dragging for just straight rails.

Post Reply

Return to “Won't implement”