Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

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

Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

Season's Greetings, everyone!

(This project uses Dialogue System for Unity and Adventure Creator, the versions are in my signature)

So, I have two game saves. One is at the start of the conversation, the other is a couple of entries in. If I load either of them
when no conversations are active, they run fine.

Save 1: https://www.mediafire.com/view/3yfiypci ... 1.png/file

Save 2: https://www.mediafire.com/view/a28kajbf ... 2.png/file

If I load them while any conversation is running, they skip straight to entry 7, but with their expected
entry's sequences played out:

Save 1: https://www.mediafire.com/view/20sk42b9 ... 3.png/file

Save 2: https://www.mediafire.com/view/18dkg690 ... 4.png/file

There's a similar issue where if you load a save with no active dialogue and the previous game state had an active conversation, that conversation remains open in the newly loaded game. It seemed like the simplest solution was to
make an AC variable monitor when a conversation was started, then have the Pause menu's resume button's on_click
action list shut down any conversations that don't line up.

Somehow, shutting down a conversation in this way interferes with the Pause menu's ability to fade out during shutdown.

example: https://www.mediafire.com/view/zqswbpt5 ... 5.png/file

Finally, it seems the AC variables don't update when a game is loaded with an inventory open during a conversation.

To trigger this bug, start a conversation, click the Court Record button and create two saves, each with a different item in the inventory selected. Then, try loading either save. Nothing will seem to happen. If you load the after the conversation closes, the saves behave normally.

Merry Christmas to all... Gaaah!
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: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by Tony Li »

Hi and Merry almost-Christmas!
CodePrincess wrote: Thu Dec 17, 2020 7:55 pmSo, I have two game saves. One is at the start of the conversation, the other is a couple of entries in. If I load either of them when no conversations are active, they run fine. ...
If I load them while any conversation is running, they skip straight to entry 7, but with their expected entry's sequences played out ...
Both saves skip straight to entry 7? Even though you didn't save while it the conversation was on entry 7?
CodePrincess wrote: Thu Dec 17, 2020 7:55 pmThere's a similar issue where if you load a save with no active dialogue and the previous game state had an active conversation, that conversation remains open in the newly loaded game. It seemed like the simplest solution was to make an AC variable monitor when a conversation was started, then have the Pause menu's resume button's on_click action list shut down any conversations that don't line up.
Maybe your variable check is causing the load game actionlist to jump past the action that fades out the pause menu. What if you configure your load game actionlist to always run the Third Party: Dialogue System Conversation > Stop Conversation action before loading the game, without checking a variable? If no DS conversation is active, the action won't do anything.
CodePrincess wrote: Thu Dec 17, 2020 7:55 pmFinally, it seems the AC variables don't update when a game is loaded with an inventory open during a conversation.

To trigger this bug, start a conversation, click the Court Record button and create two saves, each with a different item in the inventory selected. Then, try loading either save. Nothing will seem to happen.
Do you mean that it won't load the saved game, or when you load the saved game it doesn't have the saved AV variable values?
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

Both saves skip straight to entry 7? Even though you didn't save while it the conversation was on entry 7?
Exactly!
Maybe your variable check is causing the load game actionlist to jump past the action that fades out the pause menu. What if you configure your load game actionlist to always run the Third Party: Dialogue System Conversation > Stop Conversation action before loading the game, without checking a variable? If no DS conversation is active, the action won't do anything.
Good Idea! I'll try that in the morning!
Do you mean that it won't load the saved game, or when you load the saved game it doesn't have the saved AV variable values?
AV is the Adventure Creator variables, right? If so, yes, that's right, the AV vars don't reflect the values in the game save; the game successfully goes through the motions of loading a game, yet I don't see any changes in the variables that are supposed to reflect which inventory menu is open, or which category is selected, or which item is highlighted.
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: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by Tony Li »

CodePrincess wrote: Fri Dec 18, 2020 1:41 am
Both saves skip straight to entry 7? Even though you didn't save while it the conversation was on entry 7?
Exactly!
Please temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then reproduce the issue. The Dialogue System will log every entry that it goes through, including every Sequence that it plays. This may give you some insight into what's going on under the hood.
CodePrincess wrote: Fri Dec 18, 2020 1:41 am
Do you mean that it won't load the saved game, or when you load the saved game it doesn't have the saved AV variable values?
AV is the Adventure Creator variables, right? If so, yes, that's right, the AV vars don't reflect the values in the game save; the game successfully goes through the motions of loading a game, yet I don't see any changes in the variables that are supposed to reflect which inventory menu is open, or which category is selected, or which item is highlighted.
"AV" is how I misspell "AC" when it's late at night. ;-)

This sounds like a bug that I can make a patch for. I'll check it out today and let you know.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by Tony Li »

Hi Melissa,

How is your save system set up? Are you using a Dialogue System Saver component? If so, please make sure Skip Apply Data After Frames If Apply Immediate is ticked.

Can you configure your save process to call the Adventure Creator Bridge component's SyncLuaToAdventureCreator() method just before saving?
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

Please temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then reproduce the issue. The Dialogue System will log every entry that it goes through, including every Sequence that it plays. This may give you some insight into what's going on under the hood.
I added a partial copy of the readout. It's still a little long, though.

Okay, it goes roughly:

DialogueProgressSaver.LoadDialogueProgress(): attempting to load slot 2...

Restoring Dialogue System state from Adventure Creator.

Dialogue System: Ending conversation.

Dialogue System: Recording persistent data to Lua environment.
UnityEngine.Debug:Log(Object)

Dialogue System: Dialogue System Trigger is firing OnConversationEnd.

Dialogue System: ConversationStateSaver is resuming conversation Talk With Maya with actor=nil and conversant=nil at entry 4. (The correct entry for this
load)

Dialogue System: Starting conversation 'Talk With Maya', actor=, conversant=Maya

Dialogue System: Add Link (Maya): ID=3:5 '...' (True)

Dialogue System: Maya says 'He won the No-bell prize!'

Dialogue System: Dialogue System Trigger is firing OnConversationStart.

Dialogue System: Resetting Lua environment.

(Variable Update info)

Dialogue System: Applying persistent data from Lua environment.

SaveMessageMenu_TurnOn has been run.
(From Action #3 in ActionList 'SaveMessageMenu_TurnOn')

*I have no idea why this action list is activated!*

Restoring Dialogue System state from Adventure Creator.

.............................................................

It then proceeds to shut down the conversation and reopen it at entry 7. :?
How is your save system set up? Are you using a Dialogue System Saver component? If so, please make sure Skip Apply Data After Frames If Apply Immediate is ticked.
I am using Dialogue System Saver and "Skip Apply Data After Frames If Apply Immediate" is ticked.
Can you configure your save process to call the Adventure Creator Bridge component's SyncLuaToAdventureCreator() method just before saving?
I tried calling this script at the front of GameMessageMenu_YesButton_OnClick (Which loads the game) But it acts like a
dead loop when I run it. How should I use SyncLuaToAdventureCreator?

Code: Select all

public class SyncLuaToAC : MonoBehaviour
{
    public void SyncLuaToAdventureCreator()
    {
        // A shot at following Tony Li's advice from the PixelCrushers' forum.
        // I hope I did this right.
        SyncLuaToAC luaToAC = new SyncLuaToAC();
        luaToAC.SyncLuaToAdventureCreator();
    }
}
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
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

... just before saving?
Gaaah! I applied to to my loading routine!
Let me try that again!
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
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

Nope. Still a dead loop.

I guess I can't configure my save process to call the Adventure Creator Bridge component's SyncLuaToAdventureCreator() method just before saving, or at any other time. :oops:
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: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by Tony Li »

Hi,

This AC action will let you sync from AC to the Dialogue System's Lua, or from Lua back to AC:

DS_AC_SyncAction_2020-12-19.unitypackage

Before saving the game, use it to sync from Lua back to AC.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Post by CodePrincess »

Got it! Thank you so much, I'll report what I find on Monday!

Merry Christmas, 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
Post Reply