Detecting incoming train

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

axxiz144
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Aug 07, 2017 6:08 am
Contact:

Detecting incoming train

Post by axxiz144 »

I'm trying to figure out a way to set the programmable speaker to ring when the lamp on the LTN station is yellow ("incoming train"). I hooked the speaker up to the lamp, but I'm unclear on what the lamp settings should be to detect "yellow" on the lamp?

Thanks!
Dune
Fast Inserter
Fast Inserter
Posts: 212
Joined: Tue Dec 12, 2017 4:27 am
Contact:

Re: Detecting incoming train

Post by Dune »

if the color yellow is > 0

Image

And for the lights, anything > 0 with colors enabled.

Image
Image
R-800
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat May 19, 2018 5:04 am
Contact:

Re: Detecting incoming train

Post by R-800 »

Dune's suggestion definitely does exactly what you ask. My goal was a bit different, so my solution was too. I wanted the speaker to go off not just when the light was yellow, but also while it was red. I only wanted it to be inactive when the light was green. There appears to be no way to trigger a circuit effect with more than one condition being met. So I set it to trigger in the case of a green signal instead, and to be "off" when "green." This worked for my purposes. But I do have a question. Why does it seem as if in the condition specified in the Circuit connection settings creates a behavior which will only trigger when that condition is NOT met, instead of when it IS met? It seems counter-intuitive for it to work this way. My screenshot shows how I set it up, and as you can see, the "light equals green" condition is specified. But the resulting behavior is one which makes the speaker NOT play (the effect triggers when the condition is false). Yet it seems natural to me to expect the specified condition to make the speaker play (the effect triggers if the condition is true).
Attachments
train warning.jpg
train warning.jpg (728.27 KiB) Viewed 4699 times
Loewchen
Global Moderator
Global Moderator
Posts: 9161
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Detecting incoming train

Post by Loewchen »

R-800 wrote:Dune's suggestion definitely does exactly what you ask. My goal was a bit different, so my solution was too. I wanted the speaker to go off not just when the light was yellow, but also while it was red. I only wanted it to be inactive when the light was green. There appears to be no way to trigger a circuit effect with more than one condition being met. So I set it to trigger in the case of a green signal instead, and to be "off" when "green." This worked for my purposes. But I do have a question. Why does it seem as if in the condition specified in the Circuit connection settings creates a behavior which will only trigger when that condition is NOT met, instead of when it IS met? It seems counter-intuitive for it to work this way. My screenshot shows how I set it up, and as you can see, the "light equals green" condition is specified. But the resulting behavior is one which makes the speaker NOT play (the effect triggers when the condition is false). Yet it seems natural to me to expect the specified condition to make the speaker play (the effect triggers if the condition is true).
Your condition is simply wrong, you compare the amount of lamp items against the value of the circuit signal "green", since both are zero in case of a non green train signal you get accidentally the inverted behaviour of what you actually want.
Use "green" = value 0.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Detecting incoming train

Post by quyxkh »

You can change what a rail signal outputs.

If you want a one-wire yellow-or-red-rail-signal output, set both the yellow-rail-signal and red-rail-signal slots to output the same circuit signal. String multiple rail blocks together along the wire to get a longer advance notice.
Post Reply

Return to “Logistic Train Network”