LuaEntity.get_merged_signals_filtered()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

LuaEntity.get_merged_signals_filtered()

Post by Optera »

What?
LuaEntity.get_merged_signals_filtered(circuit_connector, type, name)
Parameters:
circuit_connector :: defines.circuit_connector_id (optional)
type :: string(optional): "item", "fluid", or "virtual".
name :: string (optional): Name of the item, fluid or virtual signal.

Why?

I often need to treat read signals different depending if they are virtual, item or fluid.
Currently for a one or two number of signals entity.get_circuit_network(defines.wire_type.green) + entity.get_circuit_network(defines.wire_type.red) has decent performance is an option, but it quickly looses performance.
For more than a few signals we have to loop through a potentially huge list returned by get_merged_signals(). I know the proposed call would do nothing else than this loop, but it'd execute a lot quicker in C than lua.

Post Reply

Return to “Modding interface requests”