Page 4 of 4

Re: Skip/Auto Button Help

Posted: Fri Mar 24, 2017 3:33 pm
by Tony Li
:-)

Is conversation 2 keyed off of conversation 1 somehow, so that conversation 2 starts immediately after conversation 1 ends? Or does some time pass between them before conversation 2 starts?

I'm trying to get an idea if there's some kind of timing/overlap issue. Your skip button code looks fine to me, so I don't have an idea yet of what could be causing the issue.

Re: Skip/Auto Button Help

Posted: Fri Mar 24, 2017 3:45 pm
by HawkX
Thanks so much for helping troubleshoot this (and everything always)

Here is the full order :

Startconversation (0) is called (by string + int0) with actor being empty gameobject

when conversation0 ends, the empty gameobject runs :

Code: Select all

	public void OnConversationEnd (Transform gm)
	{
		GV.inCutscene = false;
		if (GV.boolNewGame == true)
		{
			FindObjectOfType<IntroGM>().IntroNext();
			return;
		}
here is what "IntroNext" does :

Code: Select all

	public void IntroNext ()
	{
		intFightPhase++;


		if (intFightPhase == 1)
		{
			imageBackground.sprite = listBgImages [1];
			imageGirlFight.sprite = listGirlImages [1];
			StartConversation ();
			return;
		}
the 2 images changed has no incidence on the conversations at all... then it starts "ConversationName1" (first one was "ConversationName0")

this goes on and on until 15... with more stuff happening inbetween... but only 1,2,3 happens one after the other...

should i try an "invoke("StartConversation()", 1f)

(TRYING NOW BEFORE SUBMIT)

HOLY FUCK YOU'RE GOOD!! hahahahaha...
it fixed it!!

so it was being called too fast...
I'll reduce the 1f for something smaller like 0.2f...

anothing problem fixed!! THANKS!! :D

Re: Skip/Auto Button Help

Posted: Fri Mar 24, 2017 3:54 pm
by Tony Li
Whew! :-)

One frame would be enough delay. I think the problem is that OnConversationEnd gets called on the same frame in which it's still closing the conversation.

If at some point you really want to pare down the delay to the barest minimum, this would do it:

Code: Select all

public void OnConversationEnd (Transform gm)
{
      GV.inCutscene = false;
      if (GV.boolNewGame == true)
      {
          StartCoroutine(IntroNextAfterOneFrame());
      }
}

IEnumerator IntroNextAfterOneFrame()
{
    yield return null; // Wait 1 frame.
    FindObjectOfType<IntroGM>().IntroNext();
}