Page 1 of 1

Stockpile blueprint needed

Posted: Tue Dec 18, 2018 10:38 pm
by inick
All,

I would really like a circuit-enabled buffer/stockpile blueprint. The basic idea is that a trainload (or belt) of product comes to a point and via circuit network:
(A) If there is cargo in the train, to unload it and not put it back onto the train.
(B) if there is an empty cargo car, load the car without taking the product back out.


This sounds just like the need of an SR-latch, but I'm coming to the conclusion that having a set condition of a value of zero is never evaluating true. This part is needed for (B). I had (A) worked out long ago.

I'd prefer the solution to have vanilla entities, but I am not objecting to a modded suggestion. I'd love to hear what you brainiacs can come up with.
Please respond as needed, I'm hoping this to be an open exchange. I'm just dry, can't think of how to solve (B)


--iNick

Re: Stockpile blueprint needed

Posted: Tue Dec 18, 2018 11:39 pm
by DaveMcW
Station -> Decider combinator

Station is set to "read train contents" and "read stopped train".
Decider combinator is set to: Each ≠ 0 → N (1)

If N = 0 there is no train.
If N = 1 there is an empty train (the only signal is train ID).
If N ≥ 2 there is a loaded train.

Re: Stockpile blueprint needed

Posted: Wed Dec 19, 2018 9:47 am
by Pi-C
DaveMcW wrote:
Tue Dec 18, 2018 11:39 pm
Station -> Decider combinator

Station is set to "read train contents" and "read stopped train".
Decider combinator is set to: Each ≠ 0 → N (1)

If N = 0 there is no train.
If N = 1 there is an empty train (the only signal is train ID).
If N ≥ 2 there is a loaded train.
That's elegant, I've always eliminated the train ID and checked then whether any signal is not zero to find out whether a train is empty or loaded. With your solution, I can save on combinators.

That said, it seems to me the setup is not quite what inick needs. Checking for condition A (Does the train have cargo?) will work correctly. However, condition B is about single cars, not the whole train. Your method will only work for a special case (trains with only one car).

I don't know how one could *easily* check for the contents of a single car in vanilla. There is a mod, however, that looks useful, but I've not tried it yet. If you have a vanilla solution, I would be very interested in it as well. :-)

Re: Stockpile blueprint needed

Posted: Wed Dec 19, 2018 4:34 pm
by inick
DaveMcW wrote:
Tue Dec 18, 2018 11:39 pm
Station -> Decider combinator

Station is set to "read train contents" and "read stopped train".
Decider combinator is set to: Each ≠ 0 → N (1)

If N = 0 there is no train.
If N = 1 there is an empty train (the only signal is train ID).
If N ≥ 2 there is a loaded train.
Very creative, DaveMcW; Now I need to get my peon-size brain wrapped around how to utilize this information. Good tip, thank you.