Difference between revisions of "For (LogiX node)"

From Neos Wiki
Jump to navigation Jump to search
Line 19: Line 19:
 
| style="background-color:{{Int-color}}" |
 
| style="background-color:{{Int-color}}" |
 
| Count
 
| Count
| [[:Category:Types:Integer|Integer]]
+
| [[:Category:Types:Inte|Integer]]
 
|}
 
|}
  
Line 43: Line 43:
 
| style="background-color:{{Int-color}}" |
 
| style="background-color:{{Int-color}}" |
 
| Iteration
 
| Iteration
| [[:Category:Types:Integer|Integer]]
+
| [[:Category:Types:Int|Integer]]
 
|}
 
|}
  

Revision as of 00:21, 5 September 2020

Other languages:
English • ‎日本語

The For node fires impulses from LoopInteration equal to the number of iterations specified by the Count input. For the duration of the impulse chain started by each LoopIteration impulse the Iteration value is equal to the iteration number. An impulse is fired from LoopStart before iterations begin and from LoopEnd after iterations have completed.


Inputs & Outputs

Inputs
Color Label Type
Run Impulse
Count Integer
Outputs
Color Label Type
LoopStart Impulse
LoopIteration Impulse
LoopEnd Impulse
Iteration Integer

Usage

Neos uses zero indexing, hence the Iteration value for the first impulse fired from LoopImpuse is zero. Iteration values will increase up to Count - 1. All iterations for this node complete within a single frame update - if this does not complete within the time normally taken for a frame update it produces visible framerate hitches. There is a timeout which puts this node into an error state (visual turns red) if it delays an update excessively to prevent complete freezes.

Examples

The For node is extremely useful for looping a known number of times. If similar looping behavior is required, but the number of required iterations cannot be determined prior to starting the loop, consider using the While node.

Node Menu

Flow
Back Events Boolean Latch Delay Delay With Value Dynamic Impulse Receiver Dynamic Impulse Receiver With Value`1
Dynamic Impulse Trigger Dynamic Impulse Trigger With Value`1 Fire On Change Fire On False Fire On True Fire While True For
If Impulse Demultiplexer Impulse Multiplexer Local Fire On Change`1 Local Fire On False Local Fire On True Local Impulse Timeout
Local Leaky Impulse Bucket One Per Frame Pulse Random Sequence Timer Update Updates Delay
Updates Delay With Value While