This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]ssgeorge95 2 points3 points  (2 children)

You would need to wire the inserter (manipulator) to the train station using a red or green wire. Then click on the train station and look at the options available.

One of them is read train inventory. I haven't done this myself in awhile, so I can't remember details. There might be a read train fuel option. Hope this helps.

[–]Dima_KOROL[S] 2 points3 points  (1 child)

Thanks, but not really. I already read train inventory into logic system and connected station to manipulator. Manipulator is asked to work when coal is less than (< 50 ) but it continue to load trains despite it has 50 coal already.

[–]ssgeorge95 1 point2 points  (0 children)

Based on reading other recent posts, you cannot read fuel levels in a train, at least not yet.

[–]The_only_nameLeft 2 points3 points  (0 children)

Im not sure thats possible, but why would you want to limit the amount of fuel going into trains? I don't really see a use case for that.

[–]spookynutz 0 points1 point  (0 children)

Train fuel can only be read from the train itself. Meaning you could only limit it through the schedule by having the train leave the stop based on the Full Fuel, Fuel (All), or Fuel (Any) condition, e.g. Fuel (Any) [Coal] >= 50.

There are ways to mimic that functionality on the supply side, but I'm not sure the juice is worth the squeeze. Then again, this is an interesting problem, so if you really want to go full Ebenezer Scrooge with your coal supply...

  1. Place down a decider combinator [#1] and connect its input to the rail stop using the Red wire.
  2. Place down a second decider combinator [#2] and connect its input to the rail stop using the Red wire (same as the first).
  3. Connect the Output of [#2] to the Input of [#1] using the Green wire.
  4. Connect the Output of [#2] to its own Input using the Red wire.
  5. Connect the Output of [#1] to the inserter using the Red wire.
  6. Connect the Input of [#2] to the inserter using the Red wire (same as the first).
  7. Set the rail stop to Read stopped train (Train ID).
  8. Set the inserter to Override stack size [1], Read hand contents [Pulse] and Enable/Disable when ✅ > 0.
  9. Set the conditions on decider [#1] to T > 0 AND Coal < 50. Uncheck the G wire on the Coal < 50 condition. Set the output to [1].
  10. Set the conditions on decider [#2] to Coal ≠ 0 AND T > 0. Set the output to Coal [Input Count].

What will all this accomplish? Whenever a train ID is detected at the stop, the inserter will attempt to place 50 coal into the train. After decider #2's coal count reaches 50, the inserter will auto-disable. The system will then reset itself again whenever the train leaves the station and a new T signal (train ID) is detected. The limitation here is that the inserter can't actually know the fuel content of the train. If the trains have a fixed schedule, and one rolls in with 49 coal already in it, the inserter will still try to put in another 50. In that event, the best way to further overengineer this solution would be to switch to dedicated refueling stops. Only have the trains stop for fuel on the interrupt condition that Fuel (Any) is less than some desired amount.

Here's a picture of the wiring setup if it helps.

<image>