LogoPixi’VN

Storage

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

ink 同样支持变量,分为临时变量和全局变量。它们不仅能存储数值和文本数据,甚至能存储控制剧情走向的指令。 ink 的逻辑功能十分完善,还提供了一些额外的结构,帮助开发者更有条理地梳理分支故事中错综复杂的逻辑。

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

设置

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

获取

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.
}

On this page