Page 1 of 1

Resume dialogue on LoadFromSlot

Posted: Wed May 19, 2021 6:11 am
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?

Re: Resume dialogue on LoadFromSlot

Posted: Wed May 19, 2021 7:58 am
by Tony Li
Hi,

Set up the save system, and add a DialogueSystemSaver component and ConversationStateSaver component to the Dialogue Manager.

Re: Resume dialogue on LoadFromSlot

Posted: Wed May 19, 2021 10:24 am
by Nhysi
Thanks for your answer!

The ConversationStateSaver was what I was missing :)

Re: Resume dialogue on LoadFromSlot

Posted: Wed May 19, 2021 1:05 pm
by Tony Li
Glad to help!

Re: Resume dialogue on LoadFromSlot

Posted: Fri May 28, 2021 5:05 am
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)

Re: Resume dialogue on LoadFromSlot

Posted: Fri May 28, 2021 7:49 am
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?

Re: Resume dialogue on LoadFromSlot

Posted: Fri May 28, 2021 8:18 am
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?

Re: Resume dialogue on LoadFromSlot

Posted: Fri May 28, 2021 10:47 am
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?

Re: Resume dialogue on LoadFromSlot

Posted: Tue Jun 01, 2021 7:49 am
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.

Re: Resume dialogue on LoadFromSlot

Posted: Tue Jun 01, 2021 8:38 am
by Tony Li
Great! Thanks for the update.