Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Announcements, support questions, and discussion for Quest Machine.
Post Reply
User avatar
CamperJohn
Posts: 14
Joined: Sun Apr 05, 2020 7:01 pm
Contact:

Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by CamperJohn »

Started using the GiveQuestToQuester within a Condition statement of a quest when True. Got it working fine and it sends a message to the HUD that it has been given. However, is there a way to send StartDialogueWithPlayer at the same time so the player can automatically see/read the quest (in case the player does not see it pop-up in the HUD)?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by Tony Li »

Hi,

Yes. Inspect the quest's main properties > States > Active > Actions. Add a Start Conversation action, and select the conversation that you want to start. Make sure the conversation has at least one node whose conditions will be true; otherwise the Dialogue System will try to start the conversation but find that no nodes are eligible to be shown.
User avatar
CamperJohn
Posts: 14
Joined: Sun Apr 05, 2020 7:01 pm
Contact:

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by CamperJohn »

From what I can see, there is no Start Conversation available from States > Active > Actions....does this need to be added somewhere as a valid choice?
Attachments
Image4.png
Image4.png (130.61 KiB) Viewed 1158 times
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by Tony Li »

Hi,

Sorry, I thought you were using Quest Machine's Dialogue System integration, so I described how to start a Dialogue System conversation.

To call StartDialogueWithPlayer:

1. Open the scene with the QuestGiver NPC.
2. Add a Scene Event action (not a Dialogue System Start Conversation action) to the quest.
3. Configure the Scene Event action to call the NPC's QuestGiver.StartDialogueWithPlayer method.
User avatar
CamperJohn
Posts: 14
Joined: Sun Apr 05, 2020 7:01 pm
Contact:

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by CamperJohn »

Thanks.
I think I got it working with the Scene Event and the following code:

public void Givequest()
{
GetComponent<QuestGiver>().StartDialogueWithPlayer();
}

Not sure if this is the best way, but first test went through without errors.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by Tony Li »

Hi John,

That's fine. But you don't really need the custom script. You can assign the QuestGiver component directly to the scene event, and set it to QuestGiver.StartDialogueWithPlayer.
User avatar
CamperJohn
Posts: 14
Joined: Sun Apr 05, 2020 7:01 pm
Contact:

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by CamperJohn »

Typical John move, making something harder than it really is. Thanks Tony, I got caught up writing scripts and failed to look at the simpler and easier way to perform the task. As always, thanks for such a quick reply...best support I have ever experienced. :D
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer

Post by Tony Li »

Always happy to help!
Post Reply