ProtoFlux:Async Range Loop Int

From Resonite Wiki
Revision as of 02:55, 13 December 2024 by Yosh (talk | contribs) (cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Async Range Loop
*
LoopStart
Start
LoopIteration
End
LoopEnd
StepSize
Current
Async

The Async Range Loop Int node is the async analogue to the Range Loop Int node. It is used to perform looping operations by allowing one to define a range of values and step size for iterations to follow. It is a more flexible version of the Async For node.

Inputs

* (IAsyncOperation)

Begin the range loop.

Start (int)

The number for Current to start at during execution.

End (int)

The number for Current to iterate towards and compare to during execution. This input is inclusive.

StepSize (int)

The value that is added or subtracted to Current per iteration for the current LoopIteration. The loop will either add or subtract this value depending on whether Start is less than or greater than End. There will be no iterations if this value is less than 1.

As of the time of writing, this node does not account for overflow or underflow when evaluating the loop range. To avoid this issue, make sure that 2147483647 - End >= StepSize when going forwards or 2147483648 + End >= StepSize when going backwards.

Outputs

LoopStart (AsyncCall)

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

LoopIteration (AsyncCall)

Fires for each iteration of the loop. This impulse is triggered until Current exceeds End in the direction of the loop, at which point the iterations will stop.

LoopEnd (Continuation)

Fires once the loop has finished.

Current (int)

This value will start at Start for the first iteration, then at each iteration, this value will either increase or decrease by StepSize depending on whether End is greater than or less than Start. This value lasts for said iteration's entire context.

Examples