In other languages:

Virtual signals: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Rearrange each/output section)
(Make explanations more concise, remove info common to all signals, improve captions)
Line 1: Line 1:
{{Languages}}
{{Languages}}


[[File:virtual_signals.png|thumb|300px]][[File:logic_signals.png|300px|thumb|There are three types of logic signals]]
[[File:virtual_signals.png|thumb|300px|The interface for selecting a virtual signal]]
'''Virtual signals''' can used as signals in [[Circuit network]]s. 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.
[[File:logic_signals.png|300px|thumb|The icons of the three logic signals]]
'''Virtual signals''' are special non-item signals used in [[circuit network|circuit networks]]. Other than the three logic signals, virtual signals do not behave differently from item signals.


== Containing signals ==
45 virtual signals can be sent over a network. They include the digits zero through nine, the letters A through Z and the colors red, green, blue, yellow, magenta, cyan, white, gray and black.
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 ==
== Logic signals ==
Three of the virtual signals cannot be sent over a network but apply special logic to multiple 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 ===
* <span style="color:#ff0000">Everything</span>
''Everything'' can be used on the left side in conditionals. The condition will be true when the condition is true for each input signal. The condition is also true if there are no signals.
* <span style="color:#548b54">Anything</span>
* <span style="color:#eeb422">Each</span>


=== Everything ===
The output of a [[decider combinator]] may also use ''everything''. When used the combinator will output all signals that pass the condition. The ''everything'' and ''anything'' signals are the only signals used in conditions that can make multiple signals pass a condition.
==== As input ====
{| class="wikitable"
| {{imagelink|basic-transport-belt|Transport belts}} | {{imagelink|basic-inserter|Inserters}} | {{imagelink|gate|Gate}} | {{imagelink|rail-signal|Rail signal}} | {{imagelink|lamp|Lamp}} | {{imagelink|offshore-pump|Offshore Pump}} | {{imagelink|small-pump|Small pump}} | {{imagelink|decider-combinator|Decider Combinator}} | {{imagelink|power-switch|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 ====
{| class="wikitable"
| {{imagelink|decider-combinator|Decider Combinator}} |-
|}
If the condition is true, ''all input signals are outputted'', either with amount 1 or with their input amount.
=== Anything ===
=== Anything ===
==== As input ====
''Anything'' can be used on the left side of conditionals. The condition will be true when the condition is true for at least one signal.
{| class="wikitable"
| {{imagelink|basic-transport-belt|Transport belts}} | {{imagelink|basic-inserter|Inserters}} | {{imagelink|gate|Gate}} | {{imagelink|rail-signal|Rail signal}} | {{imagelink|lamp|Lamp}} | {{imagelink|offshore-pump|Offshore Pump}} | {{imagelink|small-pump|Small pump}} | {{imagelink|decider-combinator|Decider Combinator}} | {{imagelink|power-switch|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 ===
=== Each ===
==== As input ====
''Each'' can only be used in left input side and output of [[decider combinator|decider]] and [[arithmetic combinator|arithmetic]] combinators. The signal can only be used as output when also used as input. When used in both the input and output it makes a combinator perform its action on each input signal individually. The combinator will output the sum of each of the actions if only used in the input.
{| class="wikitable"
| {{imagelink|arithmetic-combinator|Arithmetic Combinator}} | {{imagelink|decider-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 ====
{| class="wikitable"
| {{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".
 
* 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 17:16, 7 February 2017


File:Virtual signals.png
The interface for selecting a virtual signal
The icons of the three logic signals

Virtual signals are special non-item signals used in circuit networks. Other than the three logic signals, virtual signals do not behave differently from item signals.

45 virtual signals can be sent over a network. They include the digits zero through nine, the letters A through Z and the colors red, green, blue, yellow, magenta, cyan, white, gray and black.

Logic signals

Three of the virtual signals cannot be sent over a network but apply special logic to multiple signals.

Everything

Everything can be used on the left side in conditionals. The condition will be true when the condition is true for each input signal. The condition is also true if there are no signals.

The output of a decider combinator may also use everything. When used the combinator will output all signals that pass the condition. The everything and anything signals are the only signals used in conditions that can make multiple signals pass a condition.

Anything

Anything can be used on the left side of conditionals. The condition will be true when the condition is true for at least one signal.

Each

Each can only be used in left input side and output of decider and arithmetic combinators. The signal can only be used as output when also used as input. When used in both the input and output it makes a combinator perform its action on each input signal individually. The combinator will output the sum of each of the actions if only used in the input.