Hi everybody.
I want to know if there is a way to catch when a quest is visualize.
When a player is asking for a quest (which is waiting to start), just before the player accept the quest.
I want to play some audio clip on top of the text.
Thanks a lot if someone can help me.
OnVisualizeQuest
Re: OnVisualizeQuest
I'm getting a headache...
I search for a way to get current quest and current node which is display.
I can script over QuestMachine code but, dunno where i'm suppose to get these informations cause of the specific structure of QuestMachine.
I search for a way to get current quest and current node which is display.
I can script over QuestMachine code but, dunno where i'm suppose to get these informations cause of the specific structure of QuestMachine.
Re: OnVisualizeQuest
Hi,
What if you add Audio Quest Content to the quest's Offer Text?
What if you add Audio Quest Content to the quest's Offer Text?
Re: OnVisualizeQuest
I can't because i use Localization for sounds (an a Manager for that).
I want to trigger a scene event at the same place as your audio clip is triggered.
Edit : Like a "Offer Action".
I want to trigger a scene event at the same place as your audio clip is triggered.
Edit : Like a "Offer Action".
Re: OnVisualizeQuest
Hi,
You can write a custom quest content script. Duplicate QuestContentTemplate.cs and rename it something like LocalizedAudioQuestContent.cs. Then fill in your code where the comments indicate. Quest Machine will automatically recognize your script and make it available in dropdown menus.
You can write a custom quest content script. Duplicate QuestContentTemplate.cs and rename it something like LocalizedAudioQuestContent.cs. Then fill in your code where the comments indicate. Quest Machine will automatically recognize your script and make it available in dropdown menus.
Re: OnVisualizeQuest
I'll try it in couple of minutes and let you know after.
Thanks a lot again for your help.
Thanks a lot again for your help.
Re: OnVisualizeQuest
I don't understand where i have to put my code.
The template show us 6 possibilities to uncomment, but no one is triggered when i open the offer quest.
I am missing something somewhere but dunno what and where.
The template show us 6 possibilities to uncomment, but no one is triggered when i open the offer quest.
I am missing something somewhere but dunno what and where.
Re: OnVisualizeQuest
Finally found a solution.
First there is my custom QuestContent : In second time, i had to add this condition to trigger my QuestContent at the right moment (in UnityUIBaseUI.cs) : Finally, i create in UnityUIBaseUI.cs a method to redirect to my custom QuestContent : Don't know if this is the cleaner way but it works for my purpose.
Thanks again for your help.
First there is my custom QuestContent : In second time, i had to add this condition to trigger my QuestContent at the right moment (in UnityUIBaseUI.cs) : Finally, i create in UnityUIBaseUI.cs a method to redirect to my custom QuestContent : Don't know if this is the cleaner way but it works for my purpose.
Thanks again for your help.
Re: OnVisualizeQuest
Hi,
That will work. If you have directly modified UnityUIBaseUI.cs, I recommend making a subclass instead. Example:
Then use MyQuestDialogueUI on your quest dialogue UI instead of UnityUIQuestDialogueUI. To replace the script in-place, change the Inspector view to Debug, and then drag your MyQuestDialogueUI script into the UnityUIQuestDialogueUI component's Script field.
That will work. If you have directly modified UnityUIBaseUI.cs, I recommend making a subclass instead. Example:
Code: Select all
public class MyQuestDialogueUI : UnityUIQuestDialogueUI
{
protected virtual void AddContent(QuestContent content)
{
if (content is LocalizsedAudioQuestContent)
{
AddLocalizedAudioContent(content as LocalizedAudioQuestContent)
}
else
{
base.AddContent(content);
}
}
protected virtual void AddLocalizedAudioQuestContent(LocalizedAudioQuestContent localizedAudioQuestContent)
{
if (localizedAudioQuestContent == null || localizedAudioQuestContent.index == -1) return;
localizedAudioQuestContent.Play();
}
}