Page 1 of 1

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

Posted: Sun Oct 20, 2024 2:14 am
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

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

Posted: Sun Oct 20, 2024 2:49 am
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.

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

Posted: Wed Oct 23, 2024 9:54 pm
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.

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

Posted: Wed Nov 06, 2024 11:02 am
by Viidi
I also need in a Rail Logistics Dispatcher mod - the mod manages the train schedule, which erases interruptions.

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

Posted: Wed Nov 06, 2024 4:03 pm
by darksid1
Hi friends,

I do support this request!

Thank you

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

Posted: Thu Nov 07, 2024 7:58 am
by danbopes
Related: viewtopic.php?p=634360#p634360

I wanted to implement something like this, but no way to manage interrupts in lua ATM

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

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

https://github.com/dvilker/FactorioRail ... #L419-L551

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

Posted: Wed Nov 13, 2024 8:51 pm
by EvilPLa
Looks like my mod exiguous-train-caller is deleting all Interupts too, need some way to modify the Schedule without wiping them.

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

Posted: Thu Nov 14, 2024 11:05 am
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

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

Posted: Thu Nov 14, 2024 3:56 pm
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.

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

Posted: Fri Nov 15, 2024 10:33 am
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.

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

Posted: Fri Nov 15, 2024 12:30 pm
by leeh
Similarly seeing interrupts cleared when amending schedules via lua

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

Posted: Sat Nov 30, 2024 5:11 am
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?

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

Posted: Thu Dec 05, 2024 8:34 pm
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.

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

Posted: Thu Dec 05, 2024 9:02 pm
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 :(

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

Posted: Thu Dec 05, 2024 9:07 pm
by protocol_1903
+1, scripting automation with this could be insanely powerful

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

Posted: Thu Dec 05, 2024 9:18 pm
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!