Forum rules - please read before posting.

Replacement Token doesn't read out its content, but its name.

Hey everyone,

I have a weird problem with a simple task. In our game we have a menu with just one button, which should change to another scene. This is necessary because in some 2D scenes you can't see the entrance you come from but maybe you want to go back. I have two variants how I can do that:

1st Variant (The old one. This worked for sure as I can test it in an older backup.)
A global variable (string) gets filled in every scene with the correct scene name.
The back button runs an action list with just one action: Scene: Switch with Choose scene by: Name and the replacement token [var:5] from the global variable.

2nd Variant (The new one. Here I can't confirm that it worked at some point.)
A local variable (string) with a static scene name as default.
The back Button runs the same scene switch action as above but with the other replacement token [localvar:1]

Now I get an error message for both variants and for me it seems that the Scene: Switch can't get the content of the replacement token, but takes it as a string.

Error:
Scene '[var:5]' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...

Unity version: 2022.3.47f1
Adventure Creator Version 1.81.7

Thanks for your help :)

Comments

  • What is the error in full, stacktrace included, and what is your Settings Manager's Reference scenes by field set to?

  • Scene '[var:5]' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
    To add a scene to the build settings use the menu File->Build Settings...
    UnityEngine.SceneManagement.SceneManager:LoadScene (string,UnityEngine.SceneManagement.LoadSceneMode)
    AC.SceneInfo:Open (bool,UnityEngine.SceneManagement.LoadSceneMode) (at Assets/AdventureCreator/Scripts/Game engine/SceneInfo.cs:207)
    AC.SceneInfo:Open (bool) (at Assets/AdventureCreator/Scripts/Game engine/SceneInfo.cs:81)
    AC.SceneChanger/d__56:MoveNext () (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:1157)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    But I guess it is the Reference scenes by setting. In my present version this is set to Name. In the backup version it is Number. If I set it to Number all works correctly.
    I always switch scenes by Name, so why do I need to choose by Number in the settings manager?

    Thanks for the hint!

  • It's an issue that has since been fixed, as of v1.83.

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.