LogoPixi’VN

Storage

You can read more about using variables in ink on the official documentation.

ink also supports variables, both temporary and global, storing numerical and content data, or even story flow commands. It is fully-featured in terms of logic, and contains a few additional structures to help keep the often complex logic of a branching story better organised.

In the ink + Pixi’VN integration, the variables VAR and CONST are equivalent to variables in storage and the variables temp are equivalent to temporary variables in storage.

The name of the ink variables corresponds to the key of a variable in the storage.

Define

This functionality in Javascript/TypeScript corresponds to "Default storage variables".

You can define a variable in ink with the following code:

file_type_ink
ink
VAR myVariable = 42

Imposta

This functionality in Javascript/TypeScript corresponds to storage.set.

You can set a variable in ink with the following code:

file_type_ink
ink
~ myVariable = 100

Ottieni

This functionality in Javascript/TypeScript corresponds to storage.get.

In ink, variables can be used for different purposes. For each of these purposes, the way to get the value of a variable is different.

file_type_ink
ink
The value of myDuration is: {myDuration}
# show image bg /image.png with dissolve duration {myDuration}
{myDuration > 5:
    The duration is greater than 5.
- else:
    The duration is 5 or less.
}