Page 1 of 1
Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Tue Nov 17, 2020 12:21 pm
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)?
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Tue Nov 17, 2020 1:28 pm
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.
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Tue Nov 17, 2020 4:51 pm
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?
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Tue Nov 17, 2020 7:48 pm
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.
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Tue Nov 17, 2020 10:44 pm
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.
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Wed Nov 18, 2020 8:27 am
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.
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Wed Nov 18, 2020 10:09 am
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.
Re: Can Condition statement GiveQuestToQuester also send StartDialogueWithPlayer
Posted: Wed Nov 18, 2020 10:12 am
by Tony Li
Always happy to help!