Run Dialogue once

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Run Dialogue once

Post by ricjonsu098 »

I have this problem that on the first run, the tutorial dialogue runs on the Scene1. And then the player will enter a door leading to Scene2. And when the player goes back to the door leading to Scene1, the tutorial dialogue runs again.

How can I make it so that the tutorial dialogue runs once only? Like when the player goes back to Scene1, the tutorial dialogue will not run.

NOTE: Even I ticked the only once option in the conversation trigger in the player, the dialogue still runs. And oh, this is a monologue so the conversation trigger is set on OnStart and I set the actor/conversant is the player himself
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Run Dialogue once

Post by Tony Li »

Hi,

The "Only Once" checkbox gets reset every time the scene loads.

Instead, set a Dialogue System variable. Here are some example steps:

1. In the Dialogue Editor window, click on the Variables tab.

2. Select Menu > Add Variable.

3. Rename the variable to "Did Tutorial". Set the Type to Boolean. The variable's value will start as False.

4. Click on the Conversations tab and select your tutorial conversation.

5. On an appropriate dialogue entry node (maybe the last one or the START node), click the "..." to the right of Script. Click "+", then set the dropdowns to Variable > Did Tutorial > True, then click Apply. This will set the variable to True, indicating that the player completed the tutorial.

6. In Scene1, inspect the Conversation Trigger.

7. Expand the Condition > Lua Condition section. Click the "+" by the Lua wizard. Set the dropdowns to Variable > Did Tutorial > Is > False. Then click Apply. This will only allow the Conversation Trigger to fire if the variable is still False.
Post Reply