Resume dialogue on LoadFromSlot

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Nhysi
Posts: 14
Joined: Tue May 21, 2019 5:03 am

Resume dialogue on LoadFromSlot

Post by Nhysi »

Hi Tony!

Working on a VN game, I need to resume a dialogue to the current progress. Using LoadFromSlot works when from the main game scene when another dialogue is in progress. But when I come from another Unity Scene, how can I start the right dialogue?
Running another dialog before and using a button that calls "LoadFromSlot" seems to work but I can't script it.

Any tip?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume dialogue on LoadFromSlot

Post by Tony Li »

Hi,

Set up the save system, and add a DialogueSystemSaver component and ConversationStateSaver component to the Dialogue Manager.
Nhysi
Posts: 14
Joined: Tue May 21, 2019 5:03 am

Re: Resume dialogue on LoadFromSlot

Post by Nhysi »

Thanks for your answer!

The ConversationStateSaver was what I was missing :)
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume dialogue on LoadFromSlot

Post by Tony Li »

Glad to help!
Nhysi
Posts: 14
Joined: Tue May 21, 2019 5:03 am

Re: Resume dialogue on LoadFromSlot

Post by Nhysi »

Now that I can resume a conversation, I've a last issue: It does not load variables. I've the following error:

Image

(It's linked to Lua.cs RunRaw function)
The error message is:
"Cannot assign to a null value. Are you trying to assign to a nonexistent table element?."
After my variables, there is those Items who cause this error (it's only the first 5 lines):

Code: Select all

Item[\"Ntt_7BCF675F\"].Track=true; Item[\"Ntt_7BCF675F\"].State=\"unassigned\"; Item[\"Ntt_7BCF675F\"].Entry_1_State=\"unassigned\"; Item[\"Ntt_7BCF675F\"].Entry_2_State=\"unassigned\"; Item[\"Ntt_7BCF675F\"].Entry_3_State=\"unassigned\"; Item[\"Ntt_9D02E68F\"].Track=true; Item[\"Ntt_9D02E68F\"].State=\"unassigned\"; Item[\"Ntt_9D02E68F\"].Entry_1_State=\"unassigned\"; Item[\"Ntt_9D02E68F\"].Entry_2_State=\"unassigned\"; Item[\"Ntt_9D02E68F\"].Entry_3_State=\"unassigned\"; Item[\"Ntt_30566BCE\"].Track=true; Item[\"Ntt_30566BCE\"].State=\"unassigned\"; Item[\"Ntt_30566BCE\"].Entry_1_State=\"unassigned\";
It's all my quests but with names replaced by ID?

Edit: The error was due to an import with "use technical name", it's fixed .. but I still have default value on every variable (even if I can see lua.cs RunRaw function process all the variables from my actual save)
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume dialogue on LoadFromSlot

Post by Tony Li »

Hi,
Nhysi wrote: Fri May 28, 2021 5:05 am...I still have default value on every variable (even if I can see lua.cs RunRaw function process all the variables from my actual save)
Are you saying that the "Dialogue System: Lua code" log indicates that it's restoring the correct saved variable values, but later when you check the values they've been reset to their initial values? If so, is it possible that something's resetting the database after the load game operation?
Nhysi
Posts: 14
Joined: Tue May 21, 2019 5:03 am

Re: Resume dialogue on LoadFromSlot

Post by Nhysi »

Yes, it's possible that something's resetting the database but I don't know where and why.

We are using OnConversationLineEnd to trigger a save. Could this be a problem?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume dialogue on LoadFromSlot

Post by Tony Li »

That should be fine.

Please temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then reproduce the issue. The extra logs in the Console may help you identify what's going on.

If that doesn't help, can you send a reproduction project to tony (at) pixelcrushers.com?
Nhysi
Posts: 14
Joined: Tue May 21, 2019 5:03 am

Re: Resume dialogue on LoadFromSlot

Post by Nhysi »

Problem solved ! Dialogue System LoadScene was performing a database clear after the LoadSlot function execution. We now use Unity LoadScene and it works as expected.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume dialogue on LoadFromSlot

Post by Tony Li »

Great! Thanks for the update.
Post Reply