conversationController is sometimes null
Posted: Sun Apr 06, 2025 9:09 am
This has been driving me nuts. We are using two dialogue databases, one for dialogues used on a particular level, and one called "Global" for texts that can be used anywhere (opening doors etc). But sometimes - and only sometimes - when I try to start a converation in the Global database I find that the conversationController is null and the dialogue can't start.
There are no differences between the databases that I can see (except that Global has only some of the Actors that are in the other database, since it has fewer dialogues). For example, I do:
DialogueManager.AddDatabase(database);
DialogueManager.StopAllConversations();
DialogueManager.StartConversation(conversation);
DialogueManager.Instance.SetActorPortraitSprite("Player", playerPortait);
And then right after I get a crash from these lines:
DialogueManager.Instance.conversationController.actorInfo -> NULL
DialogueManager.Instance.conversationController.conversantInfo -> NULL
DialogueManager.Instance.conversationModel -> NULL (which is also read from conversationController, I see in the code)
Ans delving some more in the code I find that DialogueManager.instance.FindActorTransformFromConversation is returning null when it looks for "Actor". What can be causing all this to happen?
There are no differences between the databases that I can see (except that Global has only some of the Actors that are in the other database, since it has fewer dialogues). For example, I do:
DialogueManager.AddDatabase(database);
DialogueManager.StopAllConversations();
DialogueManager.StartConversation(conversation);
DialogueManager.Instance.SetActorPortraitSprite("Player", playerPortait);
And then right after I get a crash from these lines:
DialogueManager.Instance.conversationController.actorInfo -> NULL
DialogueManager.Instance.conversationController.conversantInfo -> NULL
DialogueManager.Instance.conversationModel -> NULL (which is also read from conversationController, I see in the code)
Ans delving some more in the code I find that DialogueManager.instance.FindActorTransformFromConversation is returning null when it looks for "Actor". What can be causing all this to happen?