Integer
MAX
The MAX node is a utility node that takes two integer inputs and outputs the larger of the two values. It provides a simple way to compare two numbers and select the maximum value within a spell.
Inputs
a
(integer, default: 0): The first integer value to compare.b
(integer, default: 0): The second integer value to compare.
Outputs
result
(integer): The maximum value between the two input integers.
Configuration
This node does not have any additional configuration options.
Usage
To use the MAX node, follow these steps:
- Add the MAX node to your spell.
- Connect the two integer values you want to compare to the
a
andb
inputs of the node. - The node will output the larger of the two input values through the
result
output. - Connect the
result
output to the desired destination node or use it as needed in your spell.
Example
Here’s an example of how to use the MAX node in a spell:
In this example, the MAX node will compare the values 5 and 10, and output the larger value, which is 10. The Debug node will display the result, showing that the maximum value between the two inputs is indeed 10.
Best Practices
- Ensure that the inputs connected to the MAX node are of the correct type (integer). Connecting inputs of different types may lead to unexpected behavior.
- Use the MAX node when you need to compare two integer values and select the larger one. It’s a simple and efficient way to make decisions based on numeric comparisons.
Common Issues
- If either of the inputs is not connected or receives a non-integer value, the MAX node will use the default value of 0 for that input. Make sure to properly connect and provide integer values to the inputs to avoid unintended results.
By using the MAX node, you can easily compare two integer values and obtain the maximum value within your spell. It’s a handy utility node for making decisions and selecting values based on numeric comparisons.