Forum rules - please read before posting.

Is there a correct way to quit a scene before it finishes given it could be middle of cutscene, etc.

Just thought I'd check to see how to correctly end a scene on the fly.
I have a scene with a menu that allows people to select and play a scene. (Mainly for testing)
Once in the selected scene I wanted to give them the option to quit the scene there in and go back to the menu scene.  I think I've got it worked by doing an EndCutscene, then using Engine to disable all, then I reenable them back in the menu scene.  Can't see to find a simple function to quit a scene that ends everything.   Is my approach ok?    Thanks John

Comments

  • It depends on whether or not you want any currently-running ActionLists to be considered "skipped" so that any changes they make to the scene are kept.  If you do, then skipping them with EndCutscene would be necessary.

    If not, simply switching scene with Scene: Switch should be enough, but you can force the ending of all ActionLists with:

    AC.ActionListManager.KillAll ();

    Which you can then follow up with code to change scene via script:

    SceneInfo nextSceneInfo = new SceneInfo (mySceneName);
    KickStarter.sceneChanger.ChangeScene (nextSceneInfo, true);

    Where "mySceneName" is the name of the scene (or build index number), and "true" is replaced with "false" if you don't want to save the state of any objects in the old scene.
  • Great.  Thanks!
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.