What’s New
Getting Started

Operator Nodes

Last Updated: November 3, 20244.4 min read

Overview

Operator nodes in Sceneri’s Logic Graph perform mathematical and comparison operations, allowing you to manipulate data, compare values, and drive conditional logic in your game. These nodes are essential for controlling behavior and adjusting variables based on game-specific conditions. This article provides an overview of the operator nodes currently available in Sceneri, explaining their functionality and common use cases.

Less Equal Operator Shown

Available Operator Nodes

Equal

  • Description: The Equal node checks if two values are exactly the same and returns true if they match, otherwise false.
  • Use Cases: Useful for conditional checks, such as verifying if a player’s score matches a target or if an item quantity is equal to a specific amount.

Greater or Equal

  • Description: The Greater or Equal node checks if the first value is greater than or equal to the second value and returns true if the condition is met, otherwise false.
  • Use Cases: Often used to determine if a player has reached a minimum score or if a countdown timer has expired.

Less or Equal

  • Description: The Less or Equal node checks if the first value is less than or equal to the second value, returning true if the condition holds, otherwise false.
  • Use Cases: Useful for situations where you want to trigger an action if a value hasn’t exceeded a certain limit, such as allowing entry only if a player has a certain level or lower.

Shift Right

  • Description: The Shift Right node shifts the bits of an integer value to the right by a specified number of places, effectively dividing the number by powers of two.
  • Use Cases: Commonly used in optimization and performance scenarios, especially in cases involving binary operations or bitwise manipulation.

Add

  • Description: The Add node performs addition on two numbers and outputs the sum.
  • Use Cases: Ideal for increasing values, such as updating a player’s score, adding to health points, or counting items.

Shift Left

  • Description: The Shift Left node shifts the bits of an integer value to the left by a specified number of places, effectively multiplying the number by powers of two.
  • Use Cases: Useful in situations where bitwise manipulation is required, or when performing quick multiplications, especially in performance-critical parts of your game logic.

Remainder

  • Description: The Remainder node divides one number by another and returns the remainder of that division.
  • Use Cases: Often used in looping structures, such as checking for even or odd numbers, or performing actions at specific intervals (e.g., every third enemy).

Less

  • Description: The Less node checks if the first value is less than the second value and returns true if this condition is met, otherwise false.
  • Use Cases: Useful for triggering actions when a value is below a certain threshold, such as a player’s health falling below a critical level.

Divide

  • Description: The Divide node divides one number by another and outputs the result.
  • Use Cases: Commonly used for scaling values, calculating averages, or determining percentages. For instance, dividing health by a max health value to get a health percentage.

Multiply

  • Description: The Multiply node multiplies two numbers and outputs the product.
  • Use Cases: Used for scaling values, adjusting quantities, or determining areas and volumes. For example, multiplying a score multiplier by a base score to give bonus points.

Subtract

  • Description: The Subtract node subtracts one value from another and outputs the result.
  • Use Cases: Ideal for reducing values, such as decreasing health points, reducing timers, or calculating distance between values.

Not Equal

  • Description: The Not Equal node checks if two values are not the same and returns true if they differ, otherwise false.
  • Use Cases: Useful for conditions where you want to ensure two values are distinct, such as checking that a player hasn’t selected the same option twice.

Greater

  • Description: The Greater node checks if the first value is greater than the second value and returns true if the condition holds, otherwise false.
  • Use Cases: Often used to trigger actions when a value exceeds a certain threshold, such as when a player’s score surpasses a high score or when time left is above a certain amount.

Conclusion

Logic nodes are fundamental for creating responsive and interactive gameplay in Sceneri’s Logic Graph. By combining nodes like Or, Not, Negate, Exclusive Or (XOR), and And, developers can build complex conditional logic that brings depth to their game mechanics. Using these nodes effectively will enhance your ability to create dynamic, engaging experiences in Sceneri.

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.