Copy/paste train schedules as plain text

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Copy/paste train schedules as plain text

Post by Demosthenex »

TL;DR
Pressing copy or paste while in the train schedule UI should export/import the train schedule using plain text and the clipboard.

What ?
Borrowing from Path of Exile, in that game highly complex items with statistics and enchantments allow you to hit control-c (copy) with the cursor on an item to get a plain text representation of the item into the clipboard. Other planning tools (ie: Path of Building) allow you to paste that human readable text to create the same item.

I often have quite complex train schedules in Factorio, and the ability to copy the existing schedule and paste it to Notepad, make a few changes, and paste it back would be fantastic. This also avoids adding excess new UI elements into the game. For instance, the following is a circuit controlled mixed item route.

Image
Image

If with my cursor over the schedule, I hit control-c (copy), I'd want the following copied into the clipboard as plain text:

Code: Select all

 - Station: Mixed-C-[Item: Stainless Steel]
   - OR
     - Item count: [Item: Copper Plate] = 0
     - Item count: [Item: Sulfur] = 0
     - Item count: [Item: Niobium Plate] = 0
     - Item count: [Item: Cobalt Extract] = 0
     - Item count: [Item: Ferrochrome] = 0
     - Item count: [Item: Phosphorous Rock] = 0
     - Item count: [Item: Nickel Plate] = 0

 - Station: Mixed-C-[Item: Stainless Steel]
   - AND
     - Inactivity: 5 seconds
     - Circuit signal: [Item: Copper Plate] > 0
     - Circuit signal: [Item: Sulfur] > 0
     - Circuit signal: [Item: Niobium Plate] > 0
     - Circuit signal: [Item: Cobalt Extract] > 0
     - Circuit signal: [Item: Ferrochrome] > 0
     - Circuit signal: [Item: Phosphorous Rock] > 0
     - Circuit signal: [Item: Nickel Plate] > 0

 - Station: [Item: Copper Plate]-P
   - OR
     - Item count: [Item: Copper Plate] >= 200
     - Time passed: 30 seconds

 - Station: [Item: Sulfur]-P
   - OR
     - Item count: [Item: Sulfur] >= 100
     - Time passed: 30 seconds

 - Station: [Item: Niobium Plate]-P
   - OR
     - Item count: [Item: Niobium Plate] >= 200
     - Time passed: 30 seconds

 - Station: [Item: Cobalt Extract]-P
   - OR
     - Item count: [Item: Cobalt Extract] >= 100
     - Time passed: 30 seconds

 - Station: [Item: Ferrochrome]-P
   - OR
     - Item count: [Item: Ferrochrome] >= 500
     - Time passed: 30 seconds

 - Station: [Item: Phosphorous Rock]-P
   - OR
     - Item count: [Item: Phosphorous Rock] >= 400
     - Time passed: 30 seconds

 - Station: [Item: Nickel Plate]-P
   - OR
     - Item count: [Item: Nickel Plate] >= 500
     - Time passed: 30 seconds
Ideally I can paste that into a text editor (Hi Emacs!), do some editing, and then paste it back.

To paste back, I'd expect to have the text in my clipboard and when the mouse hovers over the schedule if I hit paste it replaces the entire schedule.

Alternatively UI buttons could be added to export/import to the clipboard. Not in an encoded format, but a human readable one.

Errors should return line number failure info on the console, and not make changes.
Why ?
Factorio is about controlling rising complexity. Trains and schedules are some of the most complicated portions of the game. I've seen recommendations for schedules, routes, additional UI elements to allow changes. Many of those require many changes or in depth UI. Allowing a player to edit some text is very simple and can allow external tools to assist with composing schedules.

vjbone
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Feb 14, 2016 10:02 am
Contact:

Re: Copy/paste train schedules as plain text

Post by vjbone »

I think blueprints save train settings. So you can copy/paste when you want
And it looks like work for external tool to convert bp format to readable text(I saw something like this somewhere)

Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by Demosthenex »

Duplicating schedules with a blueprint isn't the same as exporting a human readable and editable schedule, to then be imported.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by ssilk »

Demosthenex wrote:
Tue Mar 23, 2021 2:51 pm
Duplicating schedules with a blueprint isn't the same as exporting a human readable and editable schedule, to then be imported.
I would never use that and I think most other players even would know about it or await this feature.

And it's kind of crude software-design to add something like that to any software. I've seen people working like so: They had a big database. But instead of writing software to operate/change their data, the wrote excel-sheets to get some data, edit it in excel and then store that back to the database. The errors they did, when they made their changes like so, was way bigger, then the effort to make things "right", by writing kind of CRUD-interface to their database.
This is the same.

Wouldn't it be much better to add the missing functionality to the current schedule-editor instead of adding such a misleading functionality?

Or make a mod to program you schedule kind of "human-readable". :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Trific
Fast Inserter
Fast Inserter
Posts: 147
Joined: Thu Dec 31, 2020 7:57 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by Trific »

Can we just get the ability to edit the station name on the schedule?

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by ptx0 »

ssilk wrote:
Wed Mar 24, 2021 11:15 pm
Demosthenex wrote:
Tue Mar 23, 2021 2:51 pm
Duplicating schedules with a blueprint isn't the same as exporting a human readable and editable schedule, to then be imported.
I would never use that and I think most other players even would know about it or await this feature.
you could have said that about blueprint string sharing.

i have some complex work-of-art train schedules that would be cool to share.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by ssilk »

Sharing “blueprints“ of train-schedule is a much better idea from my point of view. It fits into the overall “I want to import/export all things I can do, to not repeat things over and over, every time I start a new game”, like personal logistics, hotbar, sorting inventory, equipment grid config. In my eyes it makes much sense to add also, that you should be able to save vehicles with their grid, schedules, orders etc.

Once it’s a blueprint, others can make an editor to read it, change it and create own blueprints. That’s the way to go.

Recently worked on that article:
viewtopic.php?f=6&t=88751 Save/Load (import/export) everything (Persistent Logistic requests, hotbar, inventory filters, equipment grid...)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Copy/paste train schedules as plain text

Post by eradicator »

Protip: Train schedules are tables representable as JSON. Should be easy to make a mod with a simplistic text window that let's you load/edit/save the JSON. There's no point in inventing a new data representation language just for train schedules unless you want a multi-language capable representation that can't be copy-/paste'ed across language barriers.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Copy/paste train schedules as plain text

Post by ptx0 »

eradicator wrote:
Fri Mar 26, 2021 1:42 pm
Protip: Train schedules are tables representable as JSON. Should be easy to make a mod with a simplistic text window that let's you load/edit/save the JSON. There's no point in inventing a new data representation language just for train schedules unless you want a multi-language capable representation that can't be copy-/paste'ed across language barriers.
JSON is for machines, not humans.

Post Reply

Return to “Ideas and Suggestions”