Page 1 of 1

Quest State Listener and scene changes

Posted: Wed Sep 29, 2021 5:44 pm
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?

Re: Quest State Listener and scene changes

Posted: Wed Sep 29, 2021 9:43 pm
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.