As many of you might already know, a Visual Novel is a popular genre of game that consists in a series of dialogues accompanied by images of the participating characters. It's a very accessible type of game either to develop and play. I implemented a custom Visual Novel style narrative into the Orchid Rain map editor project that you can easily make use of to give some story to your levels.
We'll start by creating a Level Visual Novels object anywhere in the Project panel. Right click and select Create > Game Stats > Level Visual Novels.
This is what you'll see in the Inspector once you create it. A Dialogue is a collection of many "Sequences", or Lines. Reveal the Dialogues field by giving it a value of 1.
We now see more fields.
Expand Sequence by giving it a value of 1.
The contents of a Sequence are now available to edit. Normally, a Dialogue will contain many Sequences. You can think of a Sequence as a Dialogue "line", as in a line on a movie script. A Sequence is the equivalent of one screen of text, said by a character.
Let's say we want a Dialogue where one character asks a question to the player, to which the player says something and the asking character gets angry. These are 3 lines of Dialogue, so we'll need 3 Sequences.
Each Sequence contains a line of dialogue that a character is supposed to be saying. I'll show you how the following Dialogue will be seen in-game.
Right, so now we have a Dialogue completely lined out. We now need to create a new GameObject and give it a Visual Novel Receiver component.
Add an appropriate Trigger to activate this Receiver. I added a Level Start Trigger so that the Dialogue shows as soon as the level loads. In the Visual Novels field, drop the Level Visual Novels object we just edited. The property Visual Novel Index will determine which Dialogue will play. So far we've only done one Dialogue, but we can write many more if we wished to.