[2.0.77] Train ID is sent before the train content can be read
Posted: Tue Sep 22, 2026 2:22 am
I was trying to fill one stack of an item type from a chest to a wagon. However the inserter always inserts 12 (max stack size) instead of the required amount when the train just arrived. That's because I am sending the stack size S when the train id T > 0. However when the train just arrived the content of the train is not read yet, so the stack size I am sending is MAX STACK SIZE - TRAIN CONTENT (0) = MAX STACK SIZE. It would make more sense for T to be set only when the train content is readable already otherwise there is no way to know when it is the case.
To reproduce:
The train has 99 plates, the inserter should insert 1 but it's going to insert 12.
Set the train to automatic for it to reach the station.
It only happens when the train just reached the station.
The circuit checking the condition if T > 0 then send S should not be true before the train content is readable.
What the circuits do:
== : for each signal in chest send train signal (so we only get the plate signal from the train)
- : max stack size from chest item type - filtered signal from the train (how many plates we need to fill one full stack in our train)
> : if T (train id) > 0 then send S (stack size)
inserter : enable if S > 0, stack size set to S

To reproduce:
The train has 99 plates, the inserter should insert 1 but it's going to insert 12.
Set the train to automatic for it to reach the station.
It only happens when the train just reached the station.
The circuit checking the condition if T > 0 then send S should not be true before the train content is readable.
What the circuits do:
== : for each signal in chest send train signal (so we only get the plate signal from the train)
- : max stack size from chest item type - filtered signal from the train (how many plates we need to fill one full stack in our train)
> : if T (train id) > 0 then send S (stack size)
inserter : enable if S > 0, stack size set to S
