Working on trains, I have found that circuit conditions checking that a signal is not present do not work if the train stop the train is at does not have a circuit connection.
This is somewhat of a problem as I am trying to set up a 'refuel' interrupt where specific train stops can inhibit that interrupt from firing if those stops have complex circuit logic attached to them.
This is the interrupt in my petri-dish world I have been testing with. The '2' is not significant.
Save file is attached. Incidentally you notice that the one "Goto B and D" interrupt gets cancelled by the "Goto C" interrupt instead of interrupted, which would be a real problem if the train was trying to pick cargo up at B and drop it off at D... This is (slightly improperly) documented in another bug report here that didn't get a response yet, and it appears to still be relevant to 2.1.21
[2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
[2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
- Attachments
-
- PetriDish.zip
- (1.35 MiB) Downloaded 22 times
Re: [2.1.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
It's way simpler, no train stop circuit condition is true without the stop having a circuit connection. This behavior was the same in 1.1.
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
I would counter that having interrupts that sometimes can and sometimes cannot function when they are checking that a signal is zero (or in this case "not 2") is in no way simpler to try and manage from a conceptual and maintenance point of view. As well, there is no "no circuit connection" trigger that could be used in an alternative clause to achieve equivalent functionality.
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
The "no circuit connection" trigger could be useful, but you can also use the At specified station / Not at specified station conditions if you know which stations have the circuit.Sukasa wrote: Sat Nov 30, 2024 11:18 pm I would counter that having interrupts that sometimes can and sometimes cannot function when they are checking that a signal is zero (or in this case "not 2") is in no way simpler to try and manage from a conceptual and maintenance point of view. As well, there is no "no circuit connection" trigger that could be used in an alternative clause to achieve equivalent functionality.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
That only works if you know the stations ahead of time, but if you're designing a blueprint book that's, unfortunately, not necessarily an available option
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
Hm... looking at the code i see this behavior was introduced literally when circuit conditions in schedule were added (it appears that was in 0.13.0) and it was always working this way (considering circuit condition as false when train stop does not provide a circuit connector). Changing this behavior causes no tests to fail however i always considered this behavior to be a feature. Changing this is relatively simple for me but i am not sure if its actually a bug. Similar behavior was put in place for space platform schedule when "send to platform" checkbox is disabled: in that case circuit conditions inside of a space platform are also considered as false regardless of conditions being true for zero-valued signals.
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
If you are designing a blueprint book, including the stations, then you can include an empty constant combinator attached to every station type where you want the interrupt to function.Sukasa wrote: Tue Dec 03, 2024 3:37 am That only works if you know the stations ahead of time, but if you're designing a blueprint book that's, unfortunately, not necessarily an available option
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
Sorry to bump this so late but I just encountered this in my game, I have a proposal that doesn't change the behaviour that hopefully will aid in discoverability (at least in some circumstances):
Can you add the green highlighting like from decider combinators to the interrupt conditions? Is that technically/mechanically possible to add from the perspective of the train that you are looking at? It wouldn't be perfect but it would at least make it clear to me which of the conditions wasn't firing.
To actually allow me to work around this, please can we also have an interrupt condition for "Not at a station" or "No circuit connection". That way I can have an interrupt with the circuit condition when at a station and an interrupt without the circuit condition which is only used when not at a station.
Context for my issue:
I have a refuelling interrupt that checks a circuit condition (used to indicate if a train station is "stacked" which requires special pathing to escape) to prevent it from triggering. I incorrectly assumed that a non-present connection would be treated the same as zero which follows the logic used elsewhere that any signal not explicitly set is zero. As you stated maybe this isn't a bug and maybe it is a feature, however I found it unintuitive and ended up spending quite a long time debugging why my interrupt wasn't firing since all of the conditions appeared to fulfilled. It's also extra annoying because this interrupt seems to work on some of my stations (because they have the send to train feature enabled by pure chance in a blueprint + circuit connection) but then on my fluid trains it doesn't (different/no blueprint for stations) which means I went for hours and hours without encountering this problem until one of my fluid trains got stuck.
Can you add the green highlighting like from decider combinators to the interrupt conditions? Is that technically/mechanically possible to add from the perspective of the train that you are looking at? It wouldn't be perfect but it would at least make it clear to me which of the conditions wasn't firing.
To actually allow me to work around this, please can we also have an interrupt condition for "Not at a station" or "No circuit connection". That way I can have an interrupt with the circuit condition when at a station and an interrupt without the circuit condition which is only used when not at a station.
Context for my issue:
I have a refuelling interrupt that checks a circuit condition (used to indicate if a train station is "stacked" which requires special pathing to escape) to prevent it from triggering. I incorrectly assumed that a non-present connection would be treated the same as zero which follows the logic used elsewhere that any signal not explicitly set is zero. As you stated maybe this isn't a bug and maybe it is a feature, however I found it unintuitive and ended up spending quite a long time debugging why my interrupt wasn't firing since all of the conditions appeared to fulfilled. It's also extra annoying because this interrupt seems to work on some of my stations (because they have the send to train feature enabled by pure chance in a blueprint + circuit connection) but then on my fluid trains it doesn't (different/no blueprint for stations) which means I went for hours and hours without encountering this problem until one of my fluid trains got stuck.
Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop
Make a feature request instead.