In other languages: 日本語

Virtual signals: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Small cleanup)
m (Rearrange each/output section)
Line 59: Line 59:
| {{imagelink|arithmetic-combinator|Arithmetic Combinator}} | {{imagelink|decider-combinator|Decider Combinator}} |-
| {{imagelink|arithmetic-combinator|Arithmetic Combinator}} | {{imagelink|decider-combinator|Decider Combinator}} |-
|}
|}
The "Each" signal can only be set as output if the left input signal is also "Each". A decider combinator outputs only the input signals whose condition is true. An arithmetic combinator outputs each input signals with an amount that is the result of the operation.
The "Each" signal can only be set as output if the left input signal is also "Each".
 
* Decider combinators output only the input signals for which the input condition is true.
* Arithmetic combinators apply the operation to each input signal, and output the results alongside each other.

Revision as of 07:23, 7 February 2017


There are three types of logic signals

Virtual signals can used as signals in Circuit networks. They are signals that are not associated with a certain item type, and therefore are immune to non-player based changes. If a circuit network contains virtual signals, they act like a normal item signal, so one can perform comparisons and arithmetical operations.

Containing signals

Currently Factorio has 45 virtual signals:

  • Numbers 0-9
  • Letters A-Z
  • Colors (red, green, blue, yellow, magenta, cyan, white, gray, black)

Each signal has:

  • A name (for example "N") and
  • A value (for example "19").

This is similar to a map in programming, where a key holds a value, and the value can be accessed by that key.

Logic signals

There are also some logic signals in Factorio which are accessible by clicking certain signal slots on devices. They have special functions to control information with multiple signals. These three signals are:

  • Everything
  • Anything
  • Each

Everything

As input

Transport belts | Inserters |
Gate.png
Gate | Rail signal |
Lamp.png
Lamp | Offshore Pump | Small pump | Decider Combinator | Power switch |-

The "Everything" signal works like a logical AND. It can only be used as the left term of the circuit condition. The condition will only be true if the condition is true for all signals the device receives. Be careful with signals with amount 0, because these signals will not considered by "Everything", as they are considered 'inactive'.

If the decider combinator output is set as "Input count" and not "Everything", there will be no output even if the condition is true.

As output

Decider Combinator |-

If the condition is true, all input signals are outputted, either with amount 1 or with their input amount.

Anything

As input

Transport belts | Inserters |
Gate.png
Gate | Rail signal |
Lamp.png
Lamp | Offshore Pump | Small pump | Decider Combinator | Power switch |-

It works similar as "Everything", but the condition is true if the condition for at least one input signal is true. (logical OR)

As output

Anything cannot be used as output, will output nothing.

Each

As input

Arithmetic Combinator | Decider Combinator |-

The "Each" signal also performs the operation for all input signals, but the condition is not true or false once, but true or false for each input signal individually.

If the output is "1" and not "Each" (decider combinators only), the signal will only be outputted if at least one condition is true. If the output is "Input count" and not "Each", all amounts of input signals whose condition is true or (for arithmetic combinators) the results of mathematical operations for each input signal are summed and outputted.

As output

Arithmetic Combinator | Decider Combinator |-

The "Each" signal can only be set as output if the left input signal is also "Each".

  • Decider combinators output only the input signals for which the input condition is true.
  • Arithmetic combinators apply the operation to each input signal, and output the results alongside each other.