Difference between revisions of "For (LogiX node)"

From Neos Wiki
Jump to navigation Jump to search
m (Zyzyl moved page LogiX: For to For (LogiX node): Changing name to match standard form)
(Update page to new format)
Line 1: Line 1:
<noinclude>[[Category:LogiX|For]]
+
<languages></languages>
[[Category:LogiX: Flow|For]]
+
<translate>
</noinclude>
+
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.
{|class=wikitable
+
 
| Inputs
+
<!--[[File:|border|256px|right]]-->
| style="width: 100px;" |
+
 
| Outputs
+
== Inputs & Outputs ==
 +
{| class="wikitable"
 +
|+Inputs
 +
|-
 +
| Color
 +
| Label
 +
| Type
 +
|-
 +
| style="background-color:{{Impulse-color}}" |
 +
| Run
 +
| Impulse
 +
|-
 +
| style="background-color:{{Int-color}}" |
 +
| Count
 +
| Integer
 +
|}
 +
 
 +
{| class="wikitable"
 +
|+Outputs
 +
|-
 +
| Color
 +
| Label
 +
| Type
 
|-
 
|-
| style="background-color:#ffffff" | Impuse: Trigger
+
| style="background-color:{{Impulse-color}}" |
|  
+
| LoopStart
| style="background-color:#ffffff" | Impuse: On Start
+
| Impulse
 
|-
 
|-
| style="background-color:#ffffff" |  
+
| style="background-color:{{Impulse-color}}" |
|  
+
| LoopIteration
| style="background-color:#ffffff" | Impuse: Iteration
+
| Impulse
 
|-
 
|-
| style="background-color:#ffffff" |  
+
| style="background-color:{{Impulse-color}}" |
|  
+
| LoopEnd
| style="background-color:#ffffff" | Impuse: On End
+
| Impulse
 
|-
 
|-
| style="background-color:#1fff1c" | Int: Count
+
| style="background-color:{{Int-color}}" |
|  
+
| Iteration
| style="background-color:#1fff1c" | Int: Current Iteration
+
| Integer
 
|}
 
|}
  
* Inputs
+
== Usage ==
** Trigger            - Triggers the start of the for loop
+
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.
** Count              - How many times the for should loop
+
== Examples ==
* Outputs
+
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 (LogiX node)|While]] node.
** On Start          - Fires when the loop starts
+
== Node Menu ==
** Iteration          - Fires each iteration of the loop
+
</translate>
** On End            - Fires at the end of the loop
 
** Current Iteration  - Outputs the current iteration as an integer
 
  
==Description==
+
[[Category:LogiX|For]]
For will fire x times on impulse.
+
[[Category:LogiX: Flow|For]]
X is defined by a given Integer.
+
{{:NodeMenu-Flow}}
 
 
Impulse outputs are On Start, Iteration, On End, and an integer output of the current iteration.
 
 
 
The integer output is only available on the same frame that the iteration output fires.
 
 
 
<hr>{{:NodeMenu-Flow}}<hr>
 

Revision as of 11:11, 13 July 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