Variables
Declaration
Variables can be declared in one of three ways.
Graph variables
Graph variables can be declared in the graph properties panel. You need to assign them a name, type and an initial value.
Once declared you can then reference a variable using the get, set and set reference nodes.
Decl variables
Decl variables can be declared in the class/entity properties panel. Functionally they are identical to graph variables, the only real difference being that they are owned by the decl rather than a particular graph and can therefore be accessed from any graph in a class/entity decl.
Inline variables
Inline variables are owned rather than referenced by a single node, making them less flexible but often more convenient than graph variables.
You can still modify inline variables however using the set reference node.
You can also reference selected entities using inline variables.
If you decide later on that you want a graph variable instead, you can promote the variable from the node's context menu.
Lists
Lists are collections of variables which you can add to, remove from, access via index and traverse.
Implicit Conversion
For convenience some basic type conversions are handled automatically.
Any type can be converted to a list of the same type.
You can also connect an int to a float or vice versa.
References and Mutability
By default all variable pins are constant (i.e. not modifiable) and the results of a node are passed via outputs. Reference variables are different; denoted by a white outline around the pin, they allow variables to be modified directly. This can be particularly useful when dealing with lists and types where copy operations are non-trivial.
There are also times when it is simply more convenient to use a reference like for example if you want to increment a number.
It is possible to link from a reference variable to a non-reference variable but not the other way around.