Page 1 of 1

get_signal_last_tick() for all control behaviors

Posted: Fri Apr 08, 2022 2:17 am
by Xorimuth
I'm writing a tool to search all entities for their output signals, but the current API doesn't allow this. Going off the list of control behaviors (https://lua-api.factorio.com/latest/def ... avior.type), I've come up with a list of which entities allow the reading of their output signals.

Container - no
Generic - no
Inserter - no
[Lamp - no, doesn't output signals]
Logistic Container - no
Roboport - partial (yes for robot stats, no for logistic network contents)
Storage tank - no
Train stop - partial (yes for stopped train and train count, no for train contents)
Decider/arith combinator - yes (via combinator control)
Constant combinator - yes (get_signal)
Accumulator - yes (output_signal)
Rail signal - yes (red_signal, orange_signal, green_signal)
Chain signal - yes (red_signal, orange_signal, green_signal, blue_signal)
Wall signal - yes (output_signal)
Mining drill - no

In general, entities don't support reading of arbitrary signals (e.g. inventory contents), only pre-specified signals. The exception to this is decider and arithmetic combinators, which both have get_signal_last_tick. Would it be possible to add this to all control behaviours, or would that have a significant performance impact?