Flow Nodes
Overview
In Sceneri’s Logic Graph, flow nodes are essential for controlling the execution order of your scripts and managing complex logic. These nodes enable you to create dynamic behaviors and ensure that your game’s logic flows smoothly. This article provides an overview of the flow nodes currently available in the Sceneri game engine, detailing their functions and use cases.
Available Flow Nodes
Branch
- Description: The Branch node allows you to create conditional statements in your logic graph. It evaluates a specified condition and directs the flow of execution based on whether the condition is true or false.
- Use Cases: Commonly used for decision-making processes, such as checking if a player’s health is below a certain threshold or if a particular item has been collected. Depending on the outcome, you can execute different actions.
While Loop
- Description: The While Loop node enables you to repeat a sequence of actions as long as a specified condition remains true. This is useful for executing actions that need to occur continuously until a certain state is achieved.
- Use Cases: Ideal for scenarios where you need to perform actions repeatedly, such as continuously checking if a player is within a certain area or collecting resources until an inventory is full.
Switch
- Description: The Switch node allows you to handle multiple conditions by evaluating a single input against a set of predefined cases. Depending on the matching case, it will direct the flow to the corresponding output.
- Use Cases: Useful for implementing state machines or handling various game events, such as switching between different character states (e.g., idle, running, jumping) based on user input.
Sequence
- Description: The Sequence node is used to execute a series of actions in a specific order. Once the first action is completed, it proceeds to the next action in the sequence, ensuring that tasks are carried out step by step.
- Use Cases: Perfect for scenarios where actions need to be performed in a particular order, such as executing a series of animations, initiating a dialogue sequence, or triggering events after completing prerequisites.
For Each
- Description: The For Each node allows you to iterate through a collection of items (such as an array) and execute a specified action for each element in that collection.
- Use Cases: Ideal for applying logic to each item in an inventory, processing a list of enemies, or manipulating data within an array.
Conclusion
As shown, in Sceneri’s Logic Graph, flow nodes are essential for controlling the execution order of your scripts and managing complex logic. These nodes enable you to create dynamic behaviors and ensure that your game’s logic flows smoothly. This article provides an overview of the flow nodes currently available in the Sceneri game engine, detailing their functions and use cases.
Feedback
Please be sure to submit issues or feature requests through the embedded feedback form. In the event it is a major issue please contact us directly through Discord.