Forum rules - please read before posting.

Starting AC from second scene error

Hello,
in our project the Title Screen and the Intro scene are made without using AC, but from that point on AC is present in every scene of our game. However, there's a problem with starting up AC in the third scene: whenever the scene loads, the MultiSceneChecker tries to register the new scene as Sub-Scene (we use asynchronous loading) but crashes;

I think the crash is due to the fact that the Kickstarter gets initialized on line 43 of MultiSceneChecker.cs, after the newScene.Initialise on line 27. Is something wrong on my side, or is this an unintended bug?

I could obviously add AC in every single scene of our game, but we're trying to close the demo as soon as possible and adding AC in the Intro may prove more taxing that we can afford right now.

I'm using Unity 2020.2.0f and AC version 1.72.4

Thanks!

Comments

  • Can you share more on how you're managing / switching your scenes without AC? Is this "third scene", the first AC scene that is loaded, and how are you loading it?

    Asynchronous loading doesn't necessarily mean having sub-scenes, but it is a requirement if you want to make use of them.

    Sub-scenes, in AC terminology, refers to adding scenes additively - so that multiple are open at once. Is this what you're looking to have? If multiple scenes are open, then the main/active one must be an AC scene.

    If the KickStarter component registers itself a sub-scene, it will stop before running its regular Initialise function - see the return statement on line 28.

    Are you getting any error messages either in the Console, or the crash log?

    One workaround you could try is to create a new AC scene that loads before your non-AC Title/Intro scenes, which has nothing but a Scene: Switch Action in an OnStart cutscene to load your first "proper" scene. If AC is loaded, but a non-AC scene is switched to, it'll go to sleep until an AC scene is switched to again.

    In general, however, I would recommend making your Title Screen scene an AC scene so that you can make use of AC's Options / Saving game loading features.

  • Hi Chris,
    I'll answer your questions right away:

    Is this "third scene", the first AC scene that is loaded, and how are you loading it?

    the scene switching is made by asynchronously loading a "Loading" scene in simple mode, and then the real scene we want to load in Additive mode. As soon as the loading of the real scene has ended, we remove the "Loading". The "third scene" is in fact the first one with AC, and I encounter the same problem even if I skip passing through the intro and entering the third scene directly from the title screen.

    Sub-scenes, in AC terminology, refers to adding scenes additively - so that multiple are open at once. Is this what you're looking to have? If multiple scenes are open, then the main/active one must be an AC scene.

    Since the loading is made like I said above, yes, I'd briefly need to have multiple scenes loaded into my game, and the main one currently doesn't have AC.

    Are you getting any error messages either in the Console, or the crash log?

    Yes. The error in the console reports a NullReferenceException in the awake function of MultiSceneChecker on line 27. I'd say that the reason is the fact that the main scene isn't an AC one as you said.

    One workaround you could try is to create a new AC scene that loads before your non-AC Title/Intro scenes, which has nothing but a Scene: Switch Action in an OnStart cutscene to load your first "proper" scene. If AC is loaded, but a non-AC scene is switched to, it'll go to sleep until an AC scene is switched to again.

    Thank you, I'll give it a try and let you know
    Willy

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.