Narration
Input prompt
How to request text or numeric input from the player in ink using the Pixi’VN "# script" and access the result inside your narrative.
The ink + Pixi’VN integration introduces a "# script" that allows you to request an input prompt from the user. To do this, you need to use the following syntax:
# {operation} input {parameters}#: is the hashtag symbol to identify a hashtag script.operation: the operation for the input prompt. Currently supported:request: request an input prompt.
input: keyword indicating an input request.parameters(Optional): a space-separated list of property/value pairs. If a value contains spaces, wrap it in double quotes.
Common parameters:
type(Optional): a string identifying the kind of input (e.g.,string,number,html textarea).default(Optional): the default value to display in the input field.
The entered value is saved in storage under the system key _input_value_, so you can reference { _input_value_ } in your ink content.
For example:
=== start ===
Hello,
# request input type string
<>what is your name?
My name is { _input_value_ }
# request input type number default 18
How old are you?
I am { _input_value_ } years old
# request input type "html textarea"
Describe who you are:
{ _input_value_ }
Restart
-> DONE