Skip to content

Creating basic scenario

Razdvizh edited this page Sep 13, 2024 · 3 revisions

Introduction

Internally, FScenario is a struct that represent a single row in the Data Table. Scenario describes a single scene or "frame" of the visual novel, while the Data Table represents an array of scenarios. Scenario cannot exist outside of the Data Table.

Data Table asset

So, it is not meant to create scenario without creating a Data Table first. In editor, Content Browser->Right Click->Miscellaneous->Data Table.

Select Scenario in the Select Row Structure prompt

image

In the Data Table

image

Scenarios are processed by Visual Controller is ascending order, meaning that first row is the first scenario of the node, second row is following scenario and so on.

Import data

It is possible to create a Data Table asset from CSV or JSON that resembles Scenario struct. Here is explanatory, importable sample JSON:

[
    {
        "Name": "NewRow",
        "Info": 
        {
            "Author": "",
            "Line": "",
            "Sound": "None",
            "Background": 
            {
                "BackgroundArtInfo": 
                {
                    "Expression": "None",
                    "ColorAndOpacity": 
                    {
                        "R": 1,
                        "G": 1,
                        "B": 1,
                        "A": 1
                    },
                    "DesiredScale":  
                    {
                        "X": 1,
                        "Y": 1
                    },
                    "MirrorScale": 
                    {
                        "X": 1,
                        "Y": 1
                    },
                    "bAnimate": false,
                    "FrameIndex": 0
                },
                "TransitionMaterial": "None"
            },
            "SpritesParams": [],
            "Flags": 0
        }
    }
]