Page 1 of 1

Override OnConversationStart with MultiLineBarks

Posted: Tue Sep 14, 2021 5:52 pm
by Sapidus3
So from other form posts, I figured out how to use the override UI to set up a bark with multiple lines.

However, since it requires setting it as a conversation instead of a bark it is calling OnConversationStart.

I have been disabling/reenabling my player controller using the event system. I saw how to override continue button functionality inside a conversation, but is there anything I can do to disable calling OnConversationStart for certain conversations / conversation triggers?

Or is there an alternate approach you would recommend?

Thanks!

Re: Override OnConversationStart with MultiLineBarks

Posted: Tue Sep 14, 2021 8:55 pm
by Tony Li
Hi,

Assuming that only NPCs bark, I recommend running the multi-line barks as conversations that don't involve the player. This way the player GameObject won't receive OnConversationStart/OnConversationEnd messages.

Then put the Dialogue System Events component on the player GameObject, and configure OnConversationStart/OnConversationEnd to disable and re-enable the player controller.

Otherwise, if the player must be involved in the bark conversation, you can add a custom field to the conversation that indicates whether the player controller should be disabled or not. In this case, instead of using Dialogue System Eents, add a script to the player that has an OnConversationStart() method. In this method, check the field. Example:

Code: Select all

void OnConversationStart(Transform actor)
{
    var conversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationStarted);
    if (conversation.LookupBool("Is Bark Conversation") == false)
    {
        // Your code here to disable the player controller.
    }
}

Re: Override OnConversationStart with MultiLineBarks

Posted: Tue Sep 14, 2021 9:41 pm
by Sapidus3
Putting an event system on the player is a really simple solution. Mentally I just defaulted to it needing to be on the manager.

The custom field approach is also good for me to keep in mind.

Thanks again for the fast response!

Re: Override OnConversationStart with MultiLineBarks

Posted: Tue Sep 14, 2021 10:12 pm
by Tony Li
Glad to help!