[2.0] Be able to read/write interrupts for trains/space platforms

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 381
Joined: Tue Jul 08, 2014 10:06 am
Contact:

[2.0] Be able to read/write interrupts for trains/space platforms

Post by LuziferSenpai »

Hey,

it would be nice if we could r/w interrupts.
Currently my mod Automatic Coupling System has a lot of problem, because of the new interrupt & group logic.
Specially because I cant read/write the interrupts.

Greetz,

Luzifer
Last edited by LuziferSenpai on Fri Nov 08, 2024 1:38 pm, edited 1 time in total.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
robot256
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by robot256 »

Yes please. Reading and writing train schedule interrupt conditions and station stops is very much needed for many mods. Among them will be the Space Exploration space elevators. I hope it can be added before 2.1.
ahicks
Inserter
Inserter
Posts: 24
Joined: Sat Jul 13, 2024 10:45 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by ahicks »

This will also be critical for Factorio Access, though getting this far is a while out for us. We'll need to be able to implement an alternative UI for it.
Viidi
Inserter
Inserter
Posts: 35
Joined: Thu Jun 16, 2022 8:52 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by Viidi »

I also need in a Rail Logistics Dispatcher mod - the mod manages the train schedule, which erases interruptions.
darksid1
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Nov 06, 2024 2:27 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by darksid1 »

Hi friends,

I do support this request!

Thank you
danbopes
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Mon Feb 07, 2022 9:29 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by danbopes »

Related: viewtopic.php?p=634360#p634360

I wanted to implement something like this, but no way to manage interrupts in lua ATM
Viidi
Inserter
Inserter
Posts: 35
Joined: Thu Jun 16, 2022 8:52 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by Viidi »

I found dirty hack to change schedule with interrupts:

https://github.com/dvilker/FactorioRail ... #L419-L551
User avatar
EvilPLa
Inserter
Inserter
Posts: 21
Joined: Sat Nov 14, 2020 7:26 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by EvilPLa »

Looks like my mod exiguous-train-caller is deleting all Interupts too, need some way to modify the Schedule without wiping them.
I havent lost my mind, it's backed up on tape somewhere.
Viidi
Inserter
Inserter
Posts: 35
Joined: Thu Jun 16, 2022 8:52 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by Viidi »

EvilPLa wrote: Wed Nov 13, 2024 8:51 pm Looks like my mod exiguous-train-caller is deleting all Interupts too, need some way to modify the Schedule without wiping them.
https://github.com/dvilker/FactorioRail ... #L419-L551
robot256
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by robot256 »

Viidi wrote: Sat Nov 09, 2024 10:56 am I found dirty hack to change schedule with interrupts:

https://github.com/dvilker/FactorioRail ... #L419-L551
Nice hack :lol: You might not need to generate a helper surface if you put the blueprint item in a Script Inventory and used it from there.
Viidi
Inserter
Inserter
Posts: 35
Joined: Thu Jun 16, 2022 8:52 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by Viidi »

robot256 wrote: Thu Nov 14, 2024 3:56 pm Nice hack :lol: You might not need to generate a helper surface if you put the blueprint item in a Script Inventory and used it from there.
You can only copy the settings from a built locomotive. It doesn't work from a blueprint. That's why I build it on a hidden surface.
leeh
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Apr 13, 2019 5:17 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by leeh »

Similarly seeing interrupts cleared when amending schedules via lua
darksid1
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Nov 06, 2024 2:27 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by darksid1 »

I tried the hack, but it work only when the loco is in a group. Is this normal or I made a mistake?
robot256
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by robot256 »

Yes, that's consistent. The train has to be in a group, and there has to be at least one other train in the group for it to copy from when you assign the group. You could script-create a hidden train to make sure that is always true.

It is currently impossible to modify the schedule via script, which includes modifying which entry the train is currently going to, if interrupts are desired to remain. You can restore the interrupts by reassigning the group, but that overwrites all your changes to the main schedule too and resets the train to the first entry in the schedule.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 381
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by LuziferSenpai »

robot256 wrote: Thu Dec 05, 2024 8:34 pm Yes, that's consistent. The train has to be in a group, and there has to be at least one other train in the group for it to copy from when you assign the group. You could script-create a hidden train to make sure that is always true.

It is currently impossible to modify the schedule via script, which includes modifying which entry the train is currently going to, if interrupts are desired to remain. You can restore the interrupts by reassigning the group, but that overwrites all your changes to the main schedule too and resets the train to the first entry in the schedule.
The first entry can be fixed with LuaTrain.go_to_station(index)

But yes, I still cant wait until we FINALLY can edit interrupts via script :(
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
protocol_1903
Fast Inserter
Fast Inserter
Posts: 134
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by protocol_1903 »

+1, scripting automation with this could be insanely powerful
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
robot256
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0] Be able to read/write interrupts for trains/space platforms

Post by robot256 »

LuziferSenpai wrote: Thu Dec 05, 2024 9:02 pm

The first entry can be fixed with LuaTrain.go_to_station(index)

But yes, I still cant wait until we FINALLY can edit interrupts via script :(
Thanks, that will actually help me a little!
Post Reply

Return to “Modding interface requests”