Set Red Signal

Place to get help with not working mods / modding interface.
Post Reply
bt_darkwolf
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Nov 26, 2021 8:54 am
Contact:

Set Red Signal

Post 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.

Image

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.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2540
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Set Red Signal

Post 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.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Set Red Signal

Post by mrvn »

There probably is a hidden constant combinator that only has the red wire connected so it only generates a red signal.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2540
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Set Red Signal

Post 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?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Set Red Signal

Post by mrvn »

A constant combinator is the only way to set signals from LUA script. Having an invisible one with invisible wire is common.

Post Reply

Return to “Modding help”