Dialog and Interactions
In this tutorial, we’ll see how to add dialog - the bread and butter of story-driven games. We’ll create the dialog and implement a player interact trigger to play the dialog.
Showing Dialog
The Dialog event
shows text in a dialog box in the game.
Adding Dialog
-
Navigate to
Maps > Map 1 > Events
. -
Click
+ Event
and add theDialog
event. -
In the event configuration:
Paste the following dialog text: -
Navigate to
Play test
and we should see the dialog play after the other events finish.
PressEnter
orX
to play the next dialog.
Adding an Interaction
Our current set up will play the dialog event when the map loads. But what if we want to play dialog when the player interacts with something? To do this, let’s add an event group.
How Event Groups Work
Event groups are a group of events separate from the map’s initial events which play on map load. To play the event group’s events, we must add it to the map with the Add event group
event. Once added to the map, they can be triggered by player Interact
or Touch
.
Event groups is the feature that allows for multiple endings, dynamic interactions, and puzzles. Learn more about how event groups work.
New Event Group
-
Navigate to
Maps > Map 1 > Events
at theEvent groups
section. -
Click
+ Create event group
. -
Click the name to rename the event group as “Talking tree.”
-
Add a new dialog event in the event group:
Paste the following dialog text: -
Under the
Map Events
section
Add an event and choose theAdd event group
event (see image below).- Select
Talking tree
for the event group to play. - Set the trigger type to interact.
- Set the trigger position to a tree in the map.
- Select
Keep in mind, since events play one after another, the event group will not be added until the other events are finished playing.
Now head over to Play test
and use Arrow keys
or WASD
to walk up to the tree. When we press Enter
or X
, we should see the dialog play.