Dialogues
This guide provides an overview of how to implement dialogue systems for non-player characters (NPCs) in your game. Effective dialogue enhances player interaction and storytelling, making NPCs more engaging and immersive.
Key Concepts
- Dialogue pool: A collection of dialogues that can be assigned to NPCs. This allows for organized management of conversations.
- NPC interaction: Setting up dialogues that players can trigger through interactions with NPCs.
Preparing dialogues
To create dialogues for your NPCs, follow these guidelines:
-
Accessing the dialogue pool: In the Explorer window, navigate to Settings > Dialogue, and select + New Dialogue. This action allows you to create a new dialogue entry.
-
Populate dialogue fields:
Field Description Name The name of the dialogue. The name is the first text that a player sees when the conversation is activated. Sentence Sentences that speakers say during the conversation. You can add as many sentences as you like. NPC/Player Specify whether the speaker is an NPC or a player. You can create a consecutive conversation with it. Text The content of the sentence -
Creating additional dialogues: To add more dialogues, simply click on the + icon within the dialogue pool.
Creating an NPC and attaching dialogues
Once your dialogues are prepared, you can create an NPC and link it to these dialogues:
-
Model selection: Find a model in Asset Library and place it in the scene.
-
Designating as NPC: Make the model an NPC by attaching a Character component to it.
-
Adding Dialogue Component: Add a Dialogue component to the NPC and select a dialogue from the dialogue pool. You can make the dialogue repetitive or one-off.
Setting up cnversation triggers
To enable player interactions with your NPC's dialogue, configure triggers effectively:
Trigger configuration
-
Default trigger condition: Initially, the trigger condition is set to self-trigger on start. This means the conversation will automatically begin when certain conditions are met.
-
Customizing trigger conditions: Change the trigger condition to Touched by player or experiment with other conditions to see how they work in your Space.
-
Testing your setup: After configuring your dialogues and triggers, switch to Play Mode to test how players interact with your NPC.