-
Notifications
You must be signed in to change notification settings - Fork 3
Introducing choices and versions
One of the most powerful features of VisualU is the player ability to change story and its path in the visual novel narrative. This tutorial will show basic example of path choice and will explain scenario versioning.
It is presumed that visual controller and scenario switching is already up. If not, check tutorial on how to set it up.
First, create three data tables. First data table will be the starting one and it will also introduce choices. Second data table will be the first choice. Accordingly, third data table will be the second choice. Make sure to add some scenarios to them, too.
Next, let's create basic user interface sprite to add choice options to the scenario. Create a blueprint widget that derives from Visual Sprite
class. Now, add a reference to the visual controller and set it to the valid instance, see the example below:
Then, design the widget with buttons and text as you like, or look at the example below:
Finally, connect choice functionality to the buttons:
Open the first data table and select any scenario in it. Then, add newly created choice sprite to the selected scenario. Don't forget to adjust position so that the sprite is visible on the screen. Check this tutorial for more details on modifying scenarios.
Choice is ready to go! Test it in runtime and check gameplay debugger to see what happens internally.
Visual versioning subsystem makes it possible to alter scenarios of a data table in runtime. Right now, this system is limited by two factors: altered data table will be chosen immediately after version is applied, which leads to all limitations of RequestNode function.
Check this modified choice sprite that alters and afterwards chooses a node:
Improved visual versioning is planned to be developed in the future.