A function to bulk transfer signals from circuit network to a constant combinator

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
tux_mark_5
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Thu Jan 15, 2015 2:20 pm
Contact:

A function to bulk transfer signals from circuit network to a constant combinator

Post by tux_mark_5 »

Right now the way to bulk transfer a signal from one place to another by using Lua API is:
1. Manually read the input signal from some entity.
2. Write the result to a constant combinator using control_behavior.parameters = {parameters = signals}

This, unfortunately has 2 limitations:
1. There is no way to transfer both networks (red and green) using a single constant combinator: the color of the signal depends on the wire connected to the constant combinator.
2. This is abhorrently slow: control_behavior.parameters = {parameters = signals} is the UPS killer.

I'd like to propose/request the 2 following items:
1. A new entity that works like constant combinator, but is only accessible via Lua API and can support both signal colors at the same time.
2. A method that copies the signal from a given LuaCircuitNetwork to the provided entity/network combo. That way the signal would be copied completely on C++ side, without having to convert the entirety signal from C++ structures to Lua and then back to C++.

If a new entity is too much work or is too niche of a request, I'd be more than contempt with:
1. LuaConstantCombinatorControlBehavior.copy_signal_from_network(<here goes a LuaCircuitNetwork>)
2. LuaConstantCombinatorControlBehavior.merge_signal_from_network(<here goes a LuaCircuitNetwork>): this would sum all the signals from given source network to current constant combinator, without erasing anything it has first.

This would help immensely with bulk transfer of signals. Mods like Factorissimo2, RadioNetwork, TrainsSignalSender would benefit a lot from this.

Post Reply

Return to “Modding interface requests”