QuestJournal "already registered" when reloading scene

Announcements, support questions, and discussion for Quest Machine.
Post Reply
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

QuestJournal "already registered" when reloading scene

Post by jakecard »

Hi!

My game has a "main scene" which includes my QuestJournal. When I leave this scene and come back later, I get the following message:

Code: Select all

Quest Machine: A QuestListContainer with id 'quest-journal' is already registered. Can't register QuestJournal (PixelCrushers.QuestMachine.Wrappers.QuestJournal)
My QuestJournal lives on the same GameObject as my QuestMachineConfiguration, so it's a singleton that's kept alive between scenes, in case this helps.

Based on digging through the code, it looks like this error message is being caused by IdentifiableQuestListContainer.OnEnable() calling QuestMachine.RegisterQuestListContainer(this). This seems fairly straightforward and expected, so I assume I've set something up wrong (or that I should just ignore this error message or something). Could you please advise?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QuestJournal "already registered" when reloading scene

Post by Tony Li »

Hi,

Is the Quest Machine Configuration component's 'Allow Only Once Instance' checkbox still ticked?
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

Re: QuestJournal "already registered" when reloading scene

Post by jakecard »

Hi Tony,

Yep, it's still ticked. Here's a screenshot of the configuration game object in the inspector. Worth noting: I also put the QuestJournal component on this same object, since we don't have a "Player" game object. Let me know if this might be screwing things up.

Image
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QuestJournal "already registered" when reloading scene

Post by Tony Li »

Hi,

You aren't doing anything wrong. Turns out it's a script execution order issue. This patch should fix it:

QM_ConfigPatch_2021-09-01.unitypackage
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

Re: QuestJournal "already registered" when reloading scene

Post by jakecard »

Awesome, thanks Tony! Will installing this patch play nicely when future QuestMachine updates are released, or will I have to re-apply it every time or something?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QuestJournal "already registered" when reloading scene

Post by Tony Li »

It'll play nicely. It's already in the repository for the next regular version release.
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

Re: QuestJournal "already registered" when reloading scene

Post by jakecard »

Awesome, thanks a bunch Tony! Appreciate the fix :)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QuestJournal "already registered" when reloading scene

Post by Tony Li »

Glad to help!
Post Reply