Problems with conversation actor/conversant being static and proposed solutions

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by Tony Li »

Hi,

Thanks for the details.

I'll fix that issue where it caches -1, which it shouldn't do.

Any idea how the conversation properties' Actor and Conversant didn't get set? Are you creating conversations in code? Did you manually set them to None? When you create a conversation by clicking the "+" button next to the conversation title dropdown in the Dialogue Editor's Conversations panel, it should at least assign default characters to the new conversation's Actor and Conversant fields.
niskander
Posts: 9
Joined: Thu Jan 07, 2021 2:58 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by niskander »

I think I created a test conversation before the actors were created, and then I didn't care to update it cause I was counting on Dialogue Actor. It makes sense the way it works now... perhaps a quick mention in the docs would be helpful (something like "conversation actor/conversant still need to be set to static actors so that they can be reassigned correctly at runtime")

Thanks a lot for the support!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by Tony Li »

I'll make sure the Dialogue Editor shows a warning when editing a conversation whose actor and conversant aren't set. I'll try to get that into 2.2.15.

Later today, I'll post a patch here that doesn't cache id -1. Do a quick comparison with your own customizations before importing it to make sure it doesn't overwrite any other customizations you may have made.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by Tony Li »

This patch has two changes:

1. ConversationModel does not cache actor ID -1.

2. If a conversation's actor or conversant is unassigned, it will show "Actor: unassigned" in red in the lower right of the node editor.

DS_ActorIDPatch_2021-01-13.unitypackage
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by NotVeryProfessional »

I found this discussion while checking on a similar issue I am having. Maybe it sheds light on the same problem:


My game has a character creation step when starting a new game. The player picks a character name and portrait here. I write his choices into the database like this:

Code: Select all

			Field.SetValue(actorData.fields, "Display Name", name);
			actorData.portrait = pic;
Which works (the database is updated), but doesn't show up until the NEXT play. Meaning that after character creation I get the portrait and name chosen the LAST time. If I press stop and play again in the Unity editor, then I get the portrait and name I have chosen. So clearly, somewhere during startup the actor data is cached and changes to the database are then not active until the next game.

If I set "Warm Up Conversation Controller" to OFF, the portrait is updated immediately, but the name still is not.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by Tony Li »

Hi,

The Dialogue System Extras page has a Discover Name Example (direct download) that contains a Lua function that updates the name immediately.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by NotVeryProfessional »

True, I forgot about that.

The magic line is simply:

Code: Select all

			DialogueLua.SetActorField(PlayerActor, "Display Name", newDisplayName);
instead of my setting the field.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by Tony Li »

If a conversation is already running, you may need to update the current conversation model's cache, too. (See the code in the Lua function.)
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: Problems with conversation actor/conversant being static and proposed solutions

Post by NotVeryProfessional »

Yes, understood that from the code. However, in my case this is set at the start of the game, during character creation, so I can be certain that no conversation is running.
Post Reply