ProtoFlux:Indirect Increment: Difference between revisions

From Resonite Wiki
make this page have broken image links instead of stub
m fix types
Line 5: Line 5:
[
[
{"Name":"*", "Type":"Impulse"},
{"Name":"*", "Type":"Impulse"},
{"Name":"Variable", "Type":"Variable"}
{"Name":"Variable", "Type":"IVariable`2"}
]
]
|Outputs=
|Outputs=
Line 15: Line 15:


Indirect increments can be commonly found in legacy content that has been migrated from other platforms.
Indirect increments can be commonly found in legacy content that has been migrated from other platforms.
Indirect increments take Variable ([[Type:Variable|Variable]]) as an input, and will increase the value that is wrapped by Variable ([[Type:Variable|Variable]]) by one.  
Indirect increments take Variable ([[Type:IVariable`2|Variable]]) as an input, and will increase the value that is wrapped by Variable ([[Type:IVariable`2|Variable]]) by one.  


{{Template:Basic Writes Info|Indirect Increments}}
{{Template:Basic Writes Info|Indirect Increments}}
Line 29: Line 29:
Call this to increase the value.
Call this to increase the value.


=== Variable ([[Type:Variable|Variable]] Generic)===
=== Variable ([[Type:IVariable`2|Variable]] Generic)===


The [[Type:Variable|Variable]] to increment by 1.
The [[Type:IVariable`2|Variable]] to increment by 1.


== Outputs ==
== Outputs ==
Line 41: Line 41:
=== OnFail ([[Impulses|Continuation]]) ===
=== OnFail ([[Impulses|Continuation]]) ===


sends an impulse after * ([[Impulses|Call]]) has been impulsed and the value wasn't able to be incremented due to a missing target or the variable not wrapping a valid [[Type:IField`1|IField`1]]
sends an impulse after * ([[Impulses|Call]]) has been impulsed and the value wasn't able to be incremented due to a missing target or the variable not wrapping a valid [[Type:IValue`1|IValue`1]]


== Examples ==
== Examples ==

Revision as of 18:36, 9 February 2024

Indirect Increment
*
OnWritten
Variable
OnFail
Indirect

Indirect increments can be commonly found in legacy content that has been migrated from other platforms. Indirect increments take Variable (Variable) as an input, and will increase the value that is wrapped by Variable (Variable) by one.

Indirect Increments are a way to change a specified value without driving it. Instead you can use Indirect Increments to change a value in a similar fashion to changing the value through the inspector. Using Indirect Increments helps with performance too, since the values provided to the node only evaluate for one game tick while the node is being impulsed vs a driver which evaluates every game tick. This can also be used to reduce the amount of times code is evaluated. If you have to search the entire root for your code to find a slot and then do an operation, using Indirect Increments with your operations will help with performance since you're only searching once and not every single game tick.

Keep in mind this node will only work if given variables that can be increased. Trying to increase a non numeric value like a Boolean or Enum will not work.

Variables for Indirect Increments can be made using a Field As Variable which can wrap any type (Generic). Variables can also be made by dragging a source of the same wrapped type (ex:Source<String> -> Variable<String>) into any variable input and it will make a special converter to connect them. This can be multiplexed using Multiplexing for using multiple variables into the same input on Indirect Increments. Multiplexing the inputs on Indirect Increments can be useful in modifying a list of variables during a For or While loop.

Inputs

* (Call)

Call this to increase the value.

Variable (Variable Generic)

The Variable to increment by 1.

Outputs

OnWritten (Continuation)

sends an impulse after * (Call) has been impulsed and the value has been incremented .

OnFail (Continuation)

sends an impulse after * (Call) has been impulsed and the value wasn't able to be incremented due to a missing target or the variable not wrapping a valid IValue`1

Examples