Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Check previous scene bug in Windows build?

edited December 2014 in Engine development
I have a scene in my project which has two entrances, and therefore on the "room enter" cutscene I check for the previous scene. The engine check scene action works fine for this most of the time, and in fact I have no problems when testing it out in the editor.

However, in one of my Windows builds, there is a problem when entering the scene from the "second" room, and I get this message in the log:

NullReferenceException: Object reference not set to an instance of an object
  at AC.AssetLoader.RetrieveAsset[AnimationClip] (UnityEngine.AnimationClip originalFile, Int32 _ID) [0x00000] in <filename unknown>:0 

  at AC.RememberNPC.LoadData (AC.NPCData data) [0x00000] in <filename unknown>:0 

  at AC.LevelStorage.UnloadNPCData (System.Collections.Generic.List`1 _npcs) [0x00000] in <filename unknown>:0 

  at AC.LevelStorage.ReturnCurrentLevelData () [0x00000] in <filename unknown>:0 

  at AC.SceneSettings.Start () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

Now, what is strange about this is that the room enter cutscene has a third scene parameter to check for, which is an intermediate scene of sorts. So for clarity, let's say I have scene 1, 2, 3 and 4. Scene 2 can be entered from scenes 1 and 4, and while in scene 2 you can flash to scene 3 and then back to scene 2. 

In the Windows build, entering from scenes 1 and 3 seem to work perfectly fine. The actionlist runs as intended. But then entering from scene 4 causes the above error. Again, this is only in the build (I haven't tested Mac yet). Any idea what may cause this?

Comments

  • From these error messages, I think the "Engine: Check scene" Action might be a red herring.  This is to do with an NPC's animations not being properly retrieved.

    Open up Scripts/Static/AssetLoader.cs, and insert the following into the top of the RetrieveAsset function (line 39):

    if
     (originalFile == null)
    {
      return null;
    }

    If that works, I'll include it in 1.41.
  • Ah thanks, this worked! FYI adding this code  also changed a few of my Engine: Check Scene actions to Engine: Change Scene actions (not sure why it did this in one scene but not any others), but after I fixed that it seems to work perfectly!

    Thanks as always!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!