Forum rules - please read before posting.

Remembering Visibility after game Restart command

Hello.

We have a layer that appear/dissappears when player enters some areas. Default state at first start - Visible, It works fine. But when we do Restart of the game that layer is invisible. Looks like it remembered its last state. I thought Restart game command should reset all such state to defaults?

Here is the video:
https://1drv.ms/u/s!AnZXODcaB0k1uknqvGSvT1Me3jkY?e=NcG29P

Here is the layer:
http://joxi.ru/GrqYoVpu4PLXPr

Hiding using Fader:
http://joxi.ru/BA06zaotMnOLWm

Restart game command
http://joxi.ru/l2ZLB3kczxJbPr

Comments

  • edited September 2019

    Indeed it should. AC and Unity versions? I will attempt a recreation.

    Is this occuring when (before restarting) the scene in question is run for the first time, or have you exited/entered the scene beforehand?

    EDIT: Can't recreate a problem here. You're using the latest release?

  • AC 1.68.4 and Unity 2019.2.2f1
    It seems that it wasn't problem in OLDER versions of AC

    It was first start of the scene, then Restart was called. Saves were cleaned

  • Still, I can't reproduce the issue - copying the same values/settings that are in your screenshots.

    Best to place a couple of Debug.Log statements in your RememberVisibility.cs script so we can see what's going on.

    Find the following line (around #130):

    return Serializer.SaveScriptData <VisibilityData> (visibilityData);
    

    And insert the following above it:

    Debug.Log ("Saved vis data for " + name);
    

    Then find the following line around line 196:

    loadedData = true;
    

    And insert the following above it:

    Debug.Log ("Loaded vis data for " + name);
    

    Which of these statements appear in the Console, and when, when re-running the same steps that you do in the video?

  • Here is the video where you can see log.

    Our layer are WallHover and Doors

    https://1drv.ms/v/s!AnZXODcaB0k1ukxDcHWR9cmf8fwd?e=pnvdaL

  • Select the save log for the Doors that shows up upon pressing Quit. Clearing the log while the pause menu is open will make it easier to spot. What is the full message (stacktrace included)?

    Restarting the game shouldn't result in scene data saving, but I notice things are saving (with a save icon) after the opening cutscene. Are you manually autosaving? If you're autosaving upon leaving the scene, that may be the cause.

  • I'm manually saving the game after opening cutscene. No saving when exiting to MainMenu And as I can see in a console, when I do restart it still loads state for Doors?

    Here is what it's saving
    http://joxi.ru/zANe8QWsv3j8k2

    Loading
    http://joxi.ru/52an4JlHEpkgqA

    Video where I clear console

    https://1drv.ms/v/s!AnZXODcaB0k1uk3ylhthBZi4DIzV?e=aceTPT

  • Ok, we were able to fix this.

    The problem hides somewhere in Player switching in MainMenu. You can remember my post, that we had Player blinking while changing it on location.

    You suggested to move switching to MainMenu, which helped.

    But actually, blinking problem was my fault. In OnStart Cutscene first was Engine:Wait action. Despite Time=0, on low-end machines it caused tiny pause, which caused blinking,
    Now I put Player switching back to OnStart scene, removed it from MainMenu and problem with Wall and Door disappeared. Maybe you can say how it can be connected.

  • The stacktrace from the Console suggests that it the Scene: Switch is being called via an ActionList asset. I can't tell how/why that would be called, though.

    For what it's worth: setting a negative value in the Engine: Wait Action will cause a delay of exactly one frame.

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.