Making a puzzle With … Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Amine33
Posts: 22
Joined: Mon May 21, 2018 4:48 pm

Making a puzzle With … Dialogue System

Post by Amine33 »

I try to make a puzzel With Dialogue System .but but I have some difficulty...to understand the right way ..

We have a closed door
Image

The player must answer the questions of the three men


If he answered correctly (The three questions)the door would open.


If the answer was wrong, the door would remain closed.
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a puzzle With … Dialogue System

Post by Tony Li »

Define 4 variables, such as:
  • NumCorrect: (Number) Records the number of correctly-answered questions.
  • AnsweredA: (Boolean) Records whether the player has answered NPC A's question.
  • AnsweredB: (Boolean) Records whether the player has answered NPC B's question.
  • AnsweredC: (Boolean) Records whether the player has answered NPC C's question.
Write a conversation for each NPC. In NPC A's conversation, check AnsweredA. If it's true, tell the player that the question is already answered. Otherwise ask the question. If the player answers correctly:

1. Set AnsweredA to true.
2. Add 1 to NumCorrect.
3. If NumCorrect >= 3, open the door.

Here is a complete working example:

ThreeRiddlesExample_2019-01-07.unitypackage
Amine33
Posts: 22
Joined: Mon May 21, 2018 4:48 pm

Re: Making a puzzle With … Dialogue System

Post by Amine33 »

Thank you very much for your help ..Everything works correctly.
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a puzzle With … Dialogue System

Post by Tony Li »

You're welcome! :-)
Post Reply