ProtoFlux:Delay: Difference between revisions

From Resonite Wiki
Finish Delay ProtoFlux Node Page
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 10: Line 10:
[
[
{"Name": "Next", "Type":"Continuation"},
{"Name": "Next", "Type":"Continuation"},
{"Name": "OnTriggered", "Type":"SyncResumption"}
{"Name": "OnTriggered", "Type":"AsyncCall"}
]
]
|}}
|}}


Delay is a ProtoFlux node that allows for delaying an [[Impulses#Async|Async]] execution for the provided Duration (Sudo-Generic) before continuing.
Delay is a ProtoFlux node that allows for delaying an [[Impulses#Async|Async]] execution for the provided Duration (Pseudo-generic) before continuing.


== Inputs ==
== Inputs ==
Line 22: Line 22:
Start the delay.
Start the delay.


=== Duration (Sudo-Generic) ===  
=== Duration (Pseudo-generic) ===  


How long to delay for in seconds.
How long to delay for in seconds or timespan.


Examples: [[Type:Double | Double]], [[Type:Float | Float]], [[Type:Int | Int]] and [[Type:TimeSpan | TimeSpan]].
Examples: [[Type:Double | Double]], [[Type:Float | Float]], [[Type:Int | Int]] and [[Type:TimeSpan | TimeSpan]].
{{Note|Delays of less than 0.5 milliseconds will be rounded to zero and may cause Resonite to hang if used inside of a loop.|danger}}


== Outputs ==
== Outputs ==
Line 32: Line 34:
=== Next ([[Impulses|Continuation]]) ===
=== Next ([[Impulses|Continuation]]) ===


Fires after Duration (Sudo-Generic) time has passed after * ([[Impulses#Async|AsyncCall]]) was called.
Fires on the next game tick once the given duration has passed since the Delay was triggered '''and''' ''OnTriggered'' has finished. If ''OnTriggered'' takes longer than the delay duration to finish, ''Next'' will be executed immediately after.


=== OnTriggered ([[Impulses#Async|SyncResumption]]) ===
=== OnTriggered ([[Impulses#Async|AsyncCall]]) ===


Fires instantly after * ([[Impulses#Async|AsyncCall]]) is called.
Fires immediately after the Delay is triggered. This impulse chain will block ''Next'', e.g. if it contains another Delay with a higher duration.


== Examples ==
== Examples ==

Latest revision as of 23:44, 18 July 2024

Delay
*
Next
Duration
OnTriggered
Flow

Delay is a ProtoFlux node that allows for delaying an Async execution for the provided Duration (Pseudo-generic) before continuing.

Inputs

* (AsyncCall)

Start the delay.

Duration (Pseudo-generic)

How long to delay for in seconds or timespan.

Examples: Double, Float, Int and TimeSpan.

Delays of less than 0.5 milliseconds will be rounded to zero and may cause Resonite to hang if used inside of a loop.

Outputs

Next (Continuation)

Fires on the next game tick once the given duration has passed since the Delay was triggered and OnTriggered has finished. If OnTriggered takes longer than the delay duration to finish, Next will be executed immediately after.

OnTriggered (AsyncCall)

Fires immediately after the Delay is triggered. This impulse chain will block Next, e.g. if it contains another Delay with a higher duration.

Examples