Modding
Discord Wishlist on Steam

Graphs

Expressions

Some sums are clearer typed than wired. The Expression node takes a line of maths or a condition, and its pins come from the names in it:

(health - damage) * 0.5
hour >= 21 or hour < 4
clamp(strength - armour, 0, 100) / 10

Type the text into the field across the node's first row. When typing pauses, the node works its pins out again: each name becomes an input, unless it is a variable of the graph, of the mod or of the run, which is read directly. The result's pin says its kind: = whole number, = number or = yes or no.

A mistake shown with its place, under the text.
A mistake shown with its place, under the text.
The same expression right: strength, armour and bonus as inputs, its result a number.
The same expression right: strength, armour and bonus as inputs, its result a number.

What it understands

numbers3, 0.5
namesinputs, or variables read directly
arithmetic+ - * / % (remainder) ^ (power)
comparisons= (or ==), != (or ≠, <>), <, >, <= (or ≤), >= (or ≥)
logicand (or &&), or (or ||), not (or !)
brackets( )
functionsmin, max, abs, round, floor, ceil, clamp, lerp, sqrt, sin, cos, random(a, b)

Order, from loosest to tightest: or, and, not, comparisons, + and -, * / %, a minus sign, then ^, which works from the right: 2 ^ 3 ^ 2 is 2 ^ 9.

Nothing else: no text, no dotted names, no other calls. An expression reaches nothing but its inputs and the variables it names.

Mistakes

A mistake is shown under the text as you type, with its place: at 7: a ( is not closed. A graph with a broken expression isn't loaded, as with any other problem.

Limits: at most 1,000 letters, 400 parts, nesting 48 deep and 16 inputs.

As nodes

As nodes in the node's head (or Show as nodes in its menu) turns the expression into ordinary maths and compare nodes, wired the same, giving the same answer.

In the library

Several of the library's functions are one expression each: Is night, Is between hours, Health percent, Is hurt and Is between. Their pages show how they are made.