Quest State Listener and scene changes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Quest State Listener and scene changes

Post by urrmurrmur »

Hi,

I have a number of characters in a scene with quest state listeners. I've attached some events upon entering certain quest states (active, success and return to NPC), one of which is a sound effect being played. Problem: it seems like the onEnterState is fired every time a scene loads, so my sound effect for entering the current quest state gets retriggered every time I switch scenes.

Is there a built-in way to avoid this behaviour, or do I have to write custom code to ensure the sound effect is only played the first time the quest state is updated?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest State Listener and scene changes

Post by Tony Li »

Hi,

Here's a patch with a change that will be in version 2.2.21:

DS_QuestStateListenerPatch_2021-09-29.unitypackage

Quest State Listener components now have a 'Suppress OnEnterState() Events On Start' checkbox. If you tick it, it won't run OnEnterState() events when the scene starts.
Post Reply