Forum rules - please read before posting.

OnEndConversation event not consistently called?

I have been trying to make a separate system that listens to when a conversation starts and ends via the OnStartConversation / OnEndConversation events, but I have noticed that the latter (OnEndConversation) hasn't been firing consistently, leading to my system assuming that the player is still in a conversation while, in fact, they are not.

I have implemented a similar conversation as the one shown in the 2D primer tutorial (around the 39:00 - 40:00 minute mark) where an Interaction is used to override the conversation options with custom actions and what I have noticed is that the OnEndConversation isn't firing after each conversation option is selected (case 1) or when the conversation starts and no options are enabled (I have set the 'Auto-disable when chosen?' property of all of my conversation options to true) (case 2).

I was able to isolate the issue in two places in the Conversation.cs file:

  • In the RunOption() method (for case 1):
else
{
    KickStarter.playerInput.StartCoroutine (KickStarter.playerInput.DelayConversation (this, () => RunOption (buttonDialog)));
}

KickStarter.playerInput.activeConversation = null;

The activeConversation is set to null without firing the OnEndConversation event first. The same logic can also be found on the RunOptionWithID() method.

Suggestion: The issue is resolved if the KickStarter.playerInput.activeConversation = null; line is replaced with a call to the TurnOff (); method that calls the KickStarter.playerInput.EndConversation (); which does fire the event since the activeConversation is not null.

  • In the Interact() method (for case 2):
else if (numPresent > 0)
{
    KickStarter.playerInput.activeConversation = this;
}
else
{
    KickStarter.playerInput.EndConversation ();
    return;
}

The EndConversation() is called but the activeConversation of the PlayerInput class is already null so the event doesn't fire.

Suggestion: Just before (or instead of?) calling the EndConversation(); method we can fire the OnEndConversation event by doing something like: KickStarter.eventManager.Call_OnEndConversation (this);.


Let me know what you think of the above. Maybe I have missed setting up something else here and everything I have described is just crazy talk!

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.