Page 1 of 1
Set Red Signal
Posted: Fri Nov 26, 2021 9:21 am
by bt_darkwolf
Hi there,
how can I generate a certain signal (red / green). The "Moon Logic" mod does that, but I don't understand how it does it.
The command does not generate a colored signal for me:
Code: Select all
entity.get_or_create_control_behavior (). set_signal (slot, {signal = {type = "virtual", name = "iron-plate"}, count = 1})
I would be grateful for tips.
Re: Set Red Signal
Posted: Fri Nov 26, 2021 1:38 pm
by FuryoftheStars
If I’m understanding what you’re looking for correctly, the color of the signal you generate depends on the color of the wire you transmit it on. So if you wanted to generate a red iron plate and a green copper plate signals, you’d need two separate sources: one transmitting the iron plate with only a red wire attached, and another transmitting the copper plate with only a green wire attached.
In this context, the color is merely indicating which set of wires the signal is traveling across, and it’ll keep them separate until you feed them both into something.
As such, afaik, you can’t actually control this via modding.
Re: Set Red Signal
Posted: Fri Nov 26, 2021 1:50 pm
by mrvn
There probably is a hidden constant combinator that only has the red wire connected so it only generates a red signal.
Re: Set Red Signal
Posted: Fri Nov 26, 2021 1:56 pm
by FuryoftheStars
Oh, yeah, I didn’t think of it that way. Even if there isn’t one like that, you should be able to connect an invisible red or green wire, right?
Re: Set Red Signal
Posted: Fri Nov 26, 2021 2:41 pm
by mrvn
A constant combinator is the only way to set signals from LUA script. Having an invisible one with invisible wire is common.