Page 1 of 1

working quest do not show dialog

Posted: Fri Sep 07, 2018 10:40 pm
by linyangyang2015
quest.png
quest.png (72.36 KiB) Viewed 904 times
1、I want auto start a quest,the quest's "Autostart" is set "Message:FindGlass Start"
2、Then,My code is "MessageSystem.SendMessage(this, "FindGlass", "Start",null);"
3、result,the quest is active,but the dialog do not show in viewport,detail in attachment,quest.png

I want to auto start a quest and show the dialog,not use "QuestGiver.StartDialogue",because I don't let user select "Accept/decline".
Thanks.

Re: working quest do not show dialog

Posted: Fri Sep 07, 2018 11:47 pm
by Tony Li
Hello,

If the quest is already active, you can use QuestGiver.StartDialogueWithPlayer(). It won't show the Accept/Decline dialogue because it doesn't need to offer the quest. Instead, it will show the Active > Dialogue Text.

Example:

Code: Select all

MessageSystem.SendMessage(this, "FindGlass", "Start");
GetComponent<QuestGiver>().StartDialogueWithPlayer();

Re: working quest do not show dialog

Posted: Sat Sep 08, 2018 2:16 am
by linyangyang2015
OK,I have a try,thanks!

Re: working quest do not show dialog

Posted: Sat Sep 08, 2018 2:26 am
by linyangyang2015
quest2.png
quest2.png (72.36 KiB) Viewed 901 times
using code:
MessageSystem.SendMessage(this, "FindGlass", "Start");
questGiver.StartDialogueWithPlayer();
it don't show attachment mark(Heading Text/Body Text/Caption Text)?

Re: working quest do not show dialog

Posted: Sat Sep 08, 2018 9:03 am
by Tony Li
Sorry, I misunderstood. Now I understand that you want to show HUD text, not dialogue.

Is the quest on the player? It must be in the player's Quest Journal component.

If the quest is already in the player's Quest Journal but it is not active yet, you can do this:

Code: Select all

MessageSystem.SendMessage(this, "FindGlass", "Start");
If the quest is not in the player's Quest Journal but on a quest giver GameObject, you can call QuestGiver.GiveQuestToQuester to put it in the player's Quest Journal first:

Code: Select all

QuestGiver giver = GetComponent<QuestGiver>(); // Need a reference to QuestGiver.
Quest quest = giver.FindQuest("Task1:FindGlass"); // Find quest in QuestGiver's list.
giver.GiveQuestToQuester(quest, "Player"); // Give quest to player's journal. Assumes player's ID is "Player".
MessageSystem.SendMessage(this, "FindGlass", "Start");
Confirm that the player's Quest Journal has a copy of the quest, and this copy is active. If that is correct, then make sure the "findglass" node's Active > HUD Text contains content.

If you get stuck, you are welcome to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.

Re: working quest do not show dialog

Posted: Sat Sep 08, 2018 11:37 pm
by linyangyang2015
It's OK,Thank you very much.