Page 1 of 1
Making a puzzle With … Dialogue System
Posted: Mon Jan 07, 2019 9:24 am
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
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.
Re: Making a puzzle With … Dialogue System
Posted: Mon Jan 07, 2019 11:20 am
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
Re: Making a puzzle With … Dialogue System
Posted: Mon Jan 07, 2019 6:20 pm
by Amine33
Thank you very much for your help ..Everything works correctly.
Re: Making a puzzle With … Dialogue System
Posted: Mon Jan 07, 2019 7:20 pm
by Tony Li
You're welcome!