added MultiPlex Node Page |
restructured the first paragraph. Added a note about using conditionals in the case of using only 2 values. |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
[ | [ | ||
{"Name":"Index", "Type":"int"}, | {"Name":"Index", "Type":"int"}, | ||
{"Name":"Inputs", "Type":"Dummy", "Multi": | {"Name":"Inputs", "Type":"Dummy", "Multi": 2} | ||
] | ] | ||
|Outputs= | |Outputs= | ||
Line 17: | Line 17: | ||
|}} | |}} | ||
The Multiplex | The <code>Multiplex</code> node is a node that changes its output to a specific input based on its index. | ||
The node can be used as a fixed-size* array in [[ProtoFlux]] or to iterate over multiple [[Value Type|values]] or variables in a [[ProtoFlux:For|For Loop]]. The size of a multiplex can be near infinite, and can multiplex any [[Type:Type|Type]]. | |||
{{Note|If you are looking to switch between only 2 values or objects, consider using a [[ProtoFlux:Conditional|Conditional]] instead.|information}} | |||
== Inputs == | == Inputs == | ||
Line 23: | Line 27: | ||
=== Index ([[Type:Int|int]]) === | === Index ([[Type:Int|int]]) === | ||
Selects the input value for the output. | |||
=== Inputs (Generic) === | === Inputs (Generic) === | ||
Line 33: | Line 37: | ||
=== Output (Generic) === | === Output (Generic) === | ||
Returns the selected value from the selected index. | |||
=== InputCount ([[Type:Int|int]]) === | === InputCount ([[Type:Int|int]]) === | ||
The number of inputs in the fixed-size* array of items in Inputs | The number of inputs in the fixed-size* array of items in Inputs. | ||
Line 49: | Line 53: | ||
== Footnotes == | == Footnotes == | ||
<nowiki>*</nowiki> It can be made bigger or smaller while editing the flux. | <nowiki>*</nowiki> It can be made bigger or smaller while editing the flux. | ||
[[Category:ProtoFlux:Utility]] |
Latest revision as of 12:48, 8 June 2025
Multiplex
Inputs
+
-
Utility
The Multiplex
node is a node that changes its output to a specific input based on its index.
The node can be used as a fixed-size* array in ProtoFlux or to iterate over multiple values or variables in a For Loop. The size of a multiplex can be near infinite, and can multiplex any Type.
Inputs
Index (int)
Selects the input value for the output.
Inputs (Generic)
A fixed-size* array of items with a type that will always match Output's type.
Outputs
Output (Generic)
Returns the selected value from the selected index.
InputCount (int)
The number of inputs in the fixed-size* array of items in Inputs.
Examples
-
Example of how to use a Multiplex with a For Loop to show how it can be used to make code simpler.
Footnotes
* It can be made bigger or smaller while editing the flux.