Sequencer Parser question

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Sequencer Parser question

Post by fkkcloud »

Hi,

I have registered a sequence shortcut like below.
sequencer_register.png
sequencer_register.png (17.89 KiB) Viewed 177 times
Then, I use it like below which works for the most case of mine.
sequence_inbox.png
sequence_inbox.png (12.3 KiB) Viewed 177 times
For this specific dialogue that is not working, I am calling Continue() via Timeline to get to this specific dialogue node.
timeline.png
timeline.png (24.13 KiB) Viewed 177 times
Then I get below warning and it does now work.
warning.png
warning.png (47.7 KiB) Viewed 177 times
DialogueSystemController who has SequenceShortcuts component is persistent throughout the game as part of singleton (so its own DontDestroyOnLoad is ticked off but it is singletone in a way)
Last edited by fkkcloud on Sat Dec 19, 2020 11:46 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequencer Parser bug

Post by Tony Li »

Hi,

Are you sure the Dialogue Manager with those SequencerShortcuts is the active one in the scene?

Are you starting play mode from another scene and coming into that scene through a scene change?

If you're arriving from another scene that replaces the Dialogue Manager, it's possible the SequencerShortcuts on the Dialogue Manager in the new scene is running its OnDisable() method before the Dialogue Manager is destroyed. The OnDisable() method will unregister the sequencer shortcuts. If you think this is what's happening:

1. As a test, temporarily remove the SequencerShortcuts from the Dialogue Manager. Add it to a GameObject in the scene with the Timeline conversation. If this works, then the problem is probably what I described above.

2. Put the SequencerShortcuts back on the Dialogue Manager. When arriving from another scene, make sure to destroy the new Dialogue Manager in Awake(), so it won't run its OnEnable()/OnDisable() methods.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Sequencer Parser question

Post by fkkcloud »

Hi, I think it was unregistered and I am coming from another scene to the scene.

I just changed my game's system to always instantiate a new DialogueSystermController prefab every time I load a new scene without DontDestroyOnLoad.
Basically, the old one will be destroyed when the new scene is loaded.

What I currently have setup should do below but let me know if this is something not DialogueSystem is designed for!
SceneLoaded -> new DialogueSystemController prefab instantiated -> gameplay/dialogue goes here -> When new scene is loaded : originally instantiated DialogueSystemController prefab will be destroyed. - SceneLoaded -> new DialogueSystemController prefab instantiated .. repeat

Would this be fine?


p.s I changed the thread subject to be question rather than a bug
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequencer Parser question

Post by Tony Li »

That's fine, but it may reset Dialogue System data between scene changes. If you need to remember values across scene changes, keep the same Dialogue Manager when you change scenes.

Have you tried ticking the Dialogue Manager's Don't Destroy On Load checkbox?
Post Reply