[2.0.73] Train Schedule Parameter Overwrite

Post your bugs and problems so we can fix them.
rosilisk
Inserter
Inserter
Posts: 23
Joined: Wed Aug 10, 2016 4:11 am
Contact:

[2.0.73] Train Schedule Parameter Overwrite

Post by rosilisk »

It seems like the logic to update a train schedule when a train stop name is changed is not performing as desired/expected for some cases with parameterized train blueprints.

Steps to Reproduce
  1. Load the initial save file:
    train_parameter_overwrite.zip
    (2 MiB) Downloaded 9 times
  2. Observe the train's schedule: it's set to load and unload iron ore at the correct train stops as shown:
    Schedule_Initial.png
    Schedule_Initial.png (29.44 KiB) Viewed 110 times
  3. Copy the train station fragment on the left (with 0 and 1 parameter stop names). The copied section represents a blueprint for a dropoff station with parameterized resource names.
  4. Paste onto the completed rail loop on the right, overlapping the existing train stops. The parameter selection box will pop up; select iron ore for {0} and copper ore for {1}. This represents expanding the dropoff station to copper ore, where before it only handled iron ore.
  5. Observe the train's schedule: it's set to unload at a train stop named "{0} Drop" as shown:
    Schedule_After.png
    Schedule_After.png (29.36 KiB) Viewed 110 times
    . The resulting save file is here:
    train_parameter_overwrite_after_paste.zip
    (2.01 MiB) Downloaded 7 times
    .
Expected Result
I expect that the train's schedule should be unmodified. After all, the train stop it was set to drop off at is unchanged. Plus, the one it is now set to is inaccessible and includes a parameter that I set during paste.

Discussion
This situation is pretty common for me and perhaps others. I have a blueprint to drop off two types of items where the train stop names include the item as an icon. I parameterize that blueprint - in reality I would filter inserters and do other things with the parameter also. I keep a copy of that blueprint to make updates as necessary.

Sometimes, I only set one item at dropoff in the two-item-blueprint. Maybe the second item isn't unlocked yet or I'm not sure what I want yet. Then, later, I add a second item, keeping the same item for the already-in-use-section. This should work in theory but it always results in the train schedule including the parameterized train stop name.

I think what's happening here is the train sees a stop on its route change name (to "{0} Drop"), so it updates its schedule. Then the name changes again (from "{0} Drop" to "{iron-ore} Drop") but this time there are two stops named "{0} Drop" so it doesn't change back. I'm not quite sure how to fix this issue - maybe train schedules don't get updated until parameter selection is complete?

Attached is a current logfile too if that helps:
factorio-current.log
(9.69 KiB) Downloaded 7 times
.
Post Reply

Return to “Bug Reports”