Scripts a written in JavaScript

Script Reference

There are two ways to write scripts. There is the script node and then there are variable property scripts.

A script node auto wire connections to get values that the script defined and then later return values to an auto created outlet of the returned type.

script-7-dark.png

The script node has can be triggered to run manually or set to live mode, then it will run as soon as one of it's connected inlet wires update.

<aside> <img src="/icons/light-bulb_gray.svg" alt="/icons/light-bulb_gray.svg" width="40px" />

Live mode does not run on a loop, it only updates when one of it’s input wires update.

</aside>

Main Script

async function main() {
    console.log("Hello, World!")
    return 123
}

This script is composed of a async main function. The script first prints (loggs to the console)  "Hello, World!" then returns a number.

<aside> <img src="/icons/light-bulb_gray.svg" alt="/icons/light-bulb_gray.svg" width="40px" />

Numbers are represented with the Float type in the script node, even if it does not have decimals.

</aside>

Variable Property Scripts

script-3-dark.png

script-2-dark.png

There is a script button on all variable properties. When in script mode, code can be written to calculate values.

<aside> <img src="/icons/light-bulb_gray.svg" alt="/icons/light-bulb_gray.svg" width="40px" />

Variables properties have both a property and an inlet.

</aside>

Auto Wire Connections

script-1-dark.png