Forum rules - please read before posting.

ActionSceneCheck.cs improvement?

Hi it is correct, IMHO, to check if the previous scene number is -1.
This enable you:
1) to check first scene
2) to test scenes even if not coming from certain scene

I applied the following patch starting from line 113 (my version is v1.72.4)

if (actualSceneNumber == -1 && sceneToCheck == SceneToCheck.Previous)
{
LogWarning ("The " + sceneToCheck + " scene's Build Index is currently " + actualSceneNumber + " - is this the game's first scene?");

            if (intCondition == IntCondition.EqualTo)
            {
                if (chooseSceneBy == ChooseSceneBy.Number && actualSceneNumber == sceneNumber)
                {
                    return true;
                }
            }
            else if (intCondition == IntCondition.NotEqualTo)
            {
                if (chooseSceneBy == ChooseSceneBy.Number && actualSceneNumber != sceneNumber)
                {
                    return true;
                }
            }

            return false;
        }

Comments

  • edited July 2021

    I'll give it some thought, thanks for the suggestion.

    to test scenes even if not coming from certain scene

    Sorry, can you explain your meaning here? Is this change solely about determining if the current scene is the first-loaded?

  • The issue with checking by -1 is that this will be true if the previous scene was loaded in via Addressable, and not part of the game's Build Settings.

    Checking if the previous scene's name is an empty string, however, should be valid in both scenarios. I'll implement this in the next release.

  • Hi Chris, I understand the Addressable problem and I did not take it into consideration. However, I have not tested it ... I will try to explain the testing issue within the actionlist "Scene Check". The main problem is that you can't set previous scene name or number using an actionlist or code (obviously) so I use this trick to avoid this problem and test actionlist having conditional code.

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.