Script Set to only Trigger at OnConversationEnd also Running after Game Loads.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Script Set to only Trigger at OnConversationEnd also Running after Game Loads.

Post by CodePrincess »

Good evening!

This is the event.
https://www.mediafire.com/view/i2umtuw5 ... n.png/file


This is the script:

Code: Select all

 public class PostConvoSceneMenuManager : MonoBehaviour
{
    public void CheckSceneMenuDisplayRequest()
    {
        if (GlobalVariables.GetVariable(49).BooleanValue == false)
        {
            Menu menu;
            // turn on the Scene Menu
            menu = PlayerMenus.GetMenuWithName("Scene Menu");
            menu.TurnOn(menu);
            Debug.Log(" Tryin' to load that  "+menu.name+". How's it going?");

        }
    }
    

}
Somehow the script triggers after a game save w/ a conversation is loaded.

https://www.mediafire.com/view/xj5zdmbf ... n.png/file

The only way to avoid the
bug is to make sure a conversation is running before loading a game save.

Does anyone think this might be a bug, or am I missing something?
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Script Set to only Trigger at OnConversationEnd also Running after Game Loads.

Post by Tony Li »

Hi,

Could the scenario below be happening?

You save a game while a conversation is active. The Conversation State Saver records that a conversation is active.

Then you're playing the game and a conversation is active when you try to load a saved game. The Conversation State Saver will see that a conversation was active in the saved game. So it will end the currently-active conversation and start the conversation from the saved game. When the currently-active conversation ends, it will trigger that event that you set up to load the Scene Menu.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Script Set to only Trigger at OnConversationEnd also Running after Game Loads.

Post by CodePrincess »

That's perfectly logical, which makes it weird that the bug only happens when you load a save with a conversation and there wasn't already a conversation running in the game previously.

Still, It sounds like loading conversations is pretty much an inherently spooky situation . I should probably look for a different condition to test for activating Scene Menu.

I love a solid lead!

Thank you, Tony!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Script Set to only Trigger at OnConversationEnd also Running after Game Loads.

Post by Tony Li »

Glad to help. Good luck!
Post Reply