Multi-Scene Work Flow and Script Execution Order

Announcements, support questions, and discussion for Quest Machine.
Post Reply
roronoazaoxl
Posts: 2
Joined: Fri Oct 14, 2022 2:40 am

Multi-Scene Work Flow and Script Execution Order

Post by roronoazaoxl »

Hey,

My project is setuped using Multiscene work flow like this:

Image

QuestMachine's gameobject locate in Core scene and QuestGiver's gameobject, which is NPC, is in Level_Farm scene.

And my script execution order setup like this:

Image

QuestMachine's Singleton QuestMachineConfiguration is -80 and should call Awake() before Questmachines's QuestGiver's Awake() function.

However, the result is not what I excepted, QuestGiver's Awake() is calld first and the following error will cause the questgiver stop functionning.
questmechina_error.jpg
questmechina_error.jpg (61.7 KiB) Viewed 542 times
Can anyone help me to How do I make it right? Thanks.

Moreover, if I put QuestMachine's gameobject in the same scene with QuestGiver's gameobject. It will have the same error when Destroy the scene, QuestMachine's Destory() is called before QuestGiver's.
User avatar
Tony Li
Posts: 22100
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multi-Scene Work Flow and Script Execution Order

Post by Tony Li »

Hi,

What version of Unity are you using?

In any case, we'll need to make some adjustments internally to the Awake() and Start() methods in the next release of Quest Machine to handle this version of Unity. I'll post a patch here when it's ready, by the end of the weekend.
roronoazaoxl
Posts: 2
Joined: Fri Oct 14, 2022 2:40 am

Re: Multi-Scene Work Flow and Script Execution Order

Post by roronoazaoxl »

Thanks, I am using 2022.1.14f1.

It is not a stable version yet :( , but thanks for your help!
User avatar
Tony Li
Posts: 22100
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multi-Scene Work Flow and Script Execution Order

Post by Tony Li »

Please let me know if this patch fixes the issue:

QM_Patch_2022-10-16.unitypackage
  • It should fix the execution order issue.
  • Fixed: When reverting quest to inactive state, now properly resets quest conditions.
  • Fixed: Issue when loading a hand-written quest from saved game where quest asset's conditions list has changed since save.
Post Reply