ProtoFlux:For: Difference between revisions

From Resonite Wiki
make more concise, matching async for
move async link to see also
 
Line 18: Line 18:


The '''For''' node is used to perform looping operations by allowing one to fire impulses a set amount of times.
The '''For''' node is used to perform looping operations by allowing one to fire impulses a set amount of times.
For the [[async]] variant of this node, see [[ProtoFlux:Async For|Async For]].


== Inputs ==
== Inputs ==
Line 58: Line 56:
File:For node example.png|Using the '''for''' node to iteratively check if a child slot has the tag 'foo'. and replace it with 'bar' using the [[Children Count (ProtoFlux)|Children Count]] and [[Get Child (ProtoFlux)|Get Child]] nodes.
File:For node example.png|Using the '''for''' node to iteratively check if a child slot has the tag 'foo'. and replace it with 'bar' using the [[Children Count (ProtoFlux)|Children Count]] and [[Get Child (ProtoFlux)|Get Child]] nodes.
</gallery>
</gallery>
== See Also ==
* [[ProtoFlux:Async For]] for the [[async]] variant of this node.


[[Category:ProtoFlux:Flow]]
[[Category:ProtoFlux:Flow]]

Latest revision as of 19:11, 15 December 2024

For
*
LoopStart
Count
LoopIteration
Reverse
LoopEnd
iteration
Flow

The For node is used to perform looping operations by allowing one to fire impulses a set amount of times.

Inputs

* (Call)

Begin the for loop.

Count (Int)

The amount of times to trigger LoopIteration. Will not trigger any iterations if less than 1.

Reverse (Bool)

If True, the Iteration output will start at Count - 1 and go down towards 0.

Outputs

LoopStart (Call)

Fires after * is pulsed and before any iterations are done. Will be pulsed even if Count < 1.

LoopIteration (Call)

Fires for each iteration of the loop. This impulse is triggered <count>Count amount of times and the next iteration will only be fired once the current iteration's context is finished.

LoopEnd (Continuation)

Fires after the final LoopIteration completes execution.

Iteration (Int)

For each LoopIteration, this output is set to be the index of the iteration for said iteration's context. By default, this will start at 0 and increment until Count - 1 unless Reverse is True.

Examples

See Also