Skip to content

Script Node

The script node allows you to execute code at a point in the editor flow. Variables defined using modify state nodes or in the global script are accessible with standard JavaScript syntax, and changes in those variables can be retrieved in any other node.

Using variables

Info

Legacy projects needs to reference variables without state., like this myVariable = true

To access variables defined with modify state nodes or to create new variables. The variable name need to be prepended with state. like this:

state.myVariable = true
state.playerIsAlive = state.hitpoints > 0

Local variables can be defined by writing let before the variable name. These variables only exist in the current script - their value is not stored and they do not interfere with the variables created in other nodes - with the exception of the global script nodes.

Keywords and strings are highlighted when applied correctly. This helps to avoid common syntax mistakes.

script