Narrative Design - Enhance your Unreal Engine projects with Convai.
Narrative Design can be extended using Unreal Engine Blueprints, allowing you to invoke triggers created in the Narrative Graph, as well as access dynamic variables such as the time of day or relevant information like inventory contents in the game.
Use Convai's Narrative Design Triggers in Unreal Engine to enhance your game stories.
Before proceeding with this section, it is advisable to familiarize yourself with the Narrative Design system, as elucidated in this tutorial.
Develop the logical flow for your specific use case. In this instance, we have created a simple museum tour guide scenario.
Once the logic is decided we can move to Unreal Engine. (In this guide we will use the same setup described in this guide)
Our goal is to invoke the trigger Start Tour
in the narrative Design graph, using the Invoke Narrative Design Trigger
.
The Trigger Name
in the function should be the same as the Trigger
name on the graph.
The above example showcased only one Trigger. The use of more than one Trigger is also possible based on execution logic.
This guide shows how to dynamically pass variables to Narrative Design section and triggers
We will create a simple scenario where the character welcomes the player and asks them about their evening or morning based on the player's time of day.
In the playground, enable Narrative Design on your character and change the starting section name to Welcome
.
Add the following to the Objective field of the Welcome section:
The time of day currently is {TimeOfDay}. Welcome the player and ask him how his {TimeOfDay} is going.
Notice that by adding any string between curly brackets it becomes a variable, and what we did here is adding the time of day as a variable, then from Unreal we can pass either the word "Morning" or "Evening" and the character will respond accordingly.
Back in Unreal, open the character's blueprint.
Set the Narrative Template Keys
variable with a map containing the same variable name TimeOfDay
and for demonstration purposes we will hard code the value to "Morning".
Start the play mode and try it out.
Feel free to try other scenarios and settings to align better with your usecase.
You can use the narrative design keys feature in both sections and triggers.
Make sure the variable names are between curly brackets and has no spaces in between.
You can dynamically set, change or clear the narrative keys in Unreal blueprints.