Issues with Relationship and Status saving

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tougon
Posts: 7
Joined: Mon Sep 07, 2020 12:15 pm

Issues with Relationship and Status saving

Post by Tougon »

Hello!

I've just started integrating the Dialogue System into a project, and while it is a great asset, I'm having an issue with saving and loading, specifically with Relationships and Statuses. Everything else appears to be saving properly.

This issue would occur with both PlayerPrefs and disc files, so I do not think the problem is caused by how I'm saving. I know my Lua code is functioning properly, sense my conversations are changing according to the relationship in editor, but when I stop play mode, and saving should occur, these values are not saved. When I turn on debugging, I noticed that the keys for the Relationship/Status table always output as INVALID. (ex: RelationshipTable = "INVALID,1;").

Is there a specific setup necessary for these tables to save properly?

I'm using Unity 2019.3, and my current settings on the dialogue system object are as follows:
-Include Status/Relationship Data = true
-Include Actor Data = true
-All other fields false
-Include Sim Status = false

On the object, I have the following components:
-Save System
-Disk Saved Game Data Storer
-Binary Data Serializer
-Dialogue System Saver
-Auto Save/Load
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with Relationship and Status saving

Post by Tony Li »

Hi,

Is it possible that you're specifying an invalid actor for a relationship function? They should look similar to:

Code: Select all

SetRelationship(Actor["Private_Hart"], Actor["Enemy"], -50)
or

Code: Select all

GetRelationship(Actor["Private_Hart"], Actor["Enemy"]) > 0
Note that although the actor is named "Private Hart" (with a space), the Actor[] table entry is Actor["Private_Hart"] (with an underscore).

Here's a patch that may help. It addresses an edge case:

DS_SavePatch_2020-09-07.unitypackage
User avatar
Tougon
Posts: 7
Joined: Mon Sep 07, 2020 12:15 pm

Re: Issues with Relationship and Status saving

Post by Tougon »

Tony Li wrote: Mon Sep 07, 2020 3:40 pm Hi,

Is it possible that you're specifying an invalid actor for a relationship function? They should look similar to:

Code: Select all

SetRelationship(Actor["Private_Hart"], Actor["Enemy"], -50)
or

Code: Select all

GetRelationship(Actor["Private_Hart"], Actor["Enemy"]) > 0
Note that although the actor is named "Private Hart" (with a space), the Actor[] table entry is Actor["Private_Hart"] (with an underscore).

Here's a patch that may help. It addresses an edge case:

DS_SavePatch_2020-09-07.unitypackage
Part of the issue was definitely caused by an invalid actor. My relationships no longer show as INVALID. However, even with that patch installed, nothing is being saved properly with the native components. I am able to save what I need with my own solution now, so for this project, everything will work fine, but I'm still unsure why some aspects are saving correctly and some aren't. Thank you for your help!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with Relationship and Status saving

Post by Tony Li »

It sounds like something is in place right now that's working. If you ever want to get to the bottom of why the default saving and loading of relationships isn't working in your project, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
Post Reply