When running a conversation from a script, the conversation runs fine, but once it's over, I can't do anything. The cursor doesn't change over hotspots, can't interact with anything, can't walk, except I CAN bring up the pause menu. Once I do that, and close out of it, everything works again. To run the conversation I am using this code (The Conversation component is on the same object as the script running it):
AC.Conversation conv = gameObject.GetComponent<AC.Conversation>();
conv.Interact();
Any ideas?
Edit with more info: This seems to only happen when the conversation's interaction source is set to "custom script." I tried it set to Asset File and it worked perfectly well.
The custom script method that it calls just throws up a dialog box (but it also does the exact same thing when no script at all is called, like for the "bye" option):
AC.KickStarter.dialog.StartDialog(npc, "Testing");
Comments
149 else if (interactionSource == InteractionSource.CustomScript)
150 {
151 if (_option.customScriptObject != null && _option.customScriptFunction != "")
152 {
153 _option.customScriptObject.SendMessage (_option.customScriptFunction);
154 }
155 KickStarter.stateHandler.gameState = GameState.Normal;
156 }
This is not a perfect solution, though because if you set "Time before can skip (s):" to higher than 0, the dialog doesn't block action anymore, but works well enough for me for now.
To end the active conversation, call EndConversation:
AC.KickStarter.playerInput.EndConversation ();
Calling AC.KickStarter.playerInput.EndConversation (); is one of the first things I tried. It doesn't solve the problem.
Whether called from my own method or from the same place in the above code where I set the gamestate, it makes no difference. Nothing can be done until I go to the pause menu and come back out again.
AC.KickStarter.actionListManager.SetCorrectGameState ();
However, I'll see if this should be called automatically from within Conversation from now on.
KickStarter.actionListManager.SetCorrectGameState();
It also solves the problem, but still doesn't work well if "Time before can skip (s):" is higher than 0:
If you want the speech to put the game in a cutscene while it plays, you need to put it in a co-routine:
public void OptionOne ()
{
StartCoroutine (OptionOneCoroutine ());
}
private IEnumerator OptionOneCoroutine ()
{
KickStarter.stateHandler.StartCutscene ();
Speech speech = AC.KickStarter.dialog.StartDialog (KickStarter.player, "Testing");
while (speech.isAlive)
{
yield return null;
}
KickStarter.stateHandler.EndCutscene ();
}
Thanks so much for the exceptional support once again.