LVNAuth Tutorials - Lists

Lists

In LVNAuth, a list is used for storing and retrieving data.

You can create a list of data and then later retrieve that data, either sequentially or randomly.

The data in lists are retained only while the visual novel is being played; they are not saved for future sessions.

Purpose

Let's say you have a character that owns a shop in your visual novel. When the player interacts with the shop owner, you might want the shop owner to say something random, from a preset list of dialogues. For that, you would use a list to retrieve a random dialogue.

Example

To implement the example above (a shop owner) where the shop owner character says something random, the script could look something like this:

<variable_set: dialogue1, Hey stranger, are you looking to buy something?>
<variable_set: dialogue2, I have some great prices at my shop. Take a look!>
<variable_set: dialogue3, What would you like to buy?>

# Add the values to a new list.

# dialogue1 contains a comma in the sentence, 
# so we use <list_add_single> so it treats it as one value.
<list_add_single: shop owner, ($dialogue1)>

# dialogue2 and dialogue3 don't have commas in the values
# so we can use <list_add> to add multiple values to the list.
<list_add: shop owner, ($dialogue2), ($dialogue3)>

# Get a random dialogue from the list
# and put the value into a new variable.
<list_get_random: shop owner, random_dialogue>

# Show the random dialogue (assuming the dialogue rectangle is already showing)
($random_dialogue)

<halt>

Explanation

Looking at the example script above, the first part deals with the command: <variable_set>. We're filling 3 variables with 3 different dialogue sentences.

Next, we're using the command: to add the value of dialogue1 to a list. Why <list_add_single> and not <list_add>? It's because dialogue1 has a comma in the sentence, so if we use <list_add>, it will think we're trying to add multiple dialogues, separated with a comma, but in fact the comma is part of the character's sentence. So we use <list_add_single> so it treats the comma as part of the sentence, all as one value.

Next, we use <list_add> to add the values of 2 variables to the list - dialogue2 and dialogue3. So at this point our list, which is called shop owner, contains 3 sentences.

The next part uses the command: <list_get_random> which chooses a random sentence from the list, shop owner, and puts the value into a new variable named random_dialogue.

Finally, we show the value of the random_dialogue variable and the player gets to see a random sentence from the list.

Last updated: Mon 24 August 2026