Broken AC integration as of AC 1.77.0

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
rairun
Posts: 34
Joined: Mon Feb 19, 2018 3:48 pm

Broken AC integration as of AC 1.77.0

Post by rairun »

Since the last Adventure Creator update, AC is not playing well with Dialogue System. The issue is with the Remember Dialogue System component, which breaks the game when you return to a scene.

Before the AC update, everything worked flawlessly. After the update, loading the first scene for the first time still works just fine. If you change scenes, it still works. But when you switch back to the original scene, it breaks the game. I get the following console error:

Code: Select all

MissingReferenceException: The object of type 'RememberDialogueSystem' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
AC.LevelStorage+<UnloadScriptData>d__29.MoveNext () (at Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs:751)
AC.LevelStorage+<LoadSceneData>d__19.MoveNext () (at Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs:437)
AC.LevelStorage+<ReturnCurrentLevelData>d__7.MoveNext () (at Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs:165)
AC.SaveSystem+<InitAfterLoadCo>d__47.MoveNext () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:755)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
By breaking, I mean that AC's OnStart actionlist doesn't run, the player is not teleported to the correct Player Start marker, etc. Probably a lot more.

I removed the Remember Dialogue System component as a test, and replaced it with a regular AC remember component (Remember Visibility). This broke the game too.

From what I understand, Dialogue System makes the first scene's manager persistent, but when you leave and return to that scene, the manager will naturally be there in the hierarchy again. DS takes care of this by destroying the non-persistent copy that 'respawns' whenever you reenter the scene. What might be happening here is that after the AC update, DS is destroying the non-persistent copy before AC has the chance to load its Remember component? Maybe? But again, this didn't happen before the update.

Any advice? Chris from AC said I could try creating a new first scene, which is never visited again, and moving the DM to there, but while this might work, it would be a nightmare to work on the game without being able to load scenes in a different order for quick testing.
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Broken AC integration as of AC 1.77.0

Post by Tony Li »

Hi,

I'll need to update the integration for 1.77.0. I'll post an updated integration here later today.
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Broken AC integration as of AC 1.77.0

Post by Tony Li »

Hi,

I think you can just move the Remember Dialogue System script to the PersistentEngine prefab. That seems to work in my test setup. This way AC won't get confused about seeing multiple versions of Remember Dialogue System.
rairun
Posts: 34
Joined: Mon Feb 19, 2018 3:48 pm

Re: Broken AC integration as of AC 1.77.0

Post by rairun »

Hi Tony, sorry for the delay getting back to you.

I just wanted to report that on my request Chris sneaked in a null-reference check into AC 1.77.1, and this seems to have solved the issue without moving the Remember component to the Persistent Engine prefab.
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Broken AC integration as of AC 1.77.0

Post by Tony Li »

Great! Thanks for the update.
Post Reply