Page 2 of 2

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 2:59 am
by Saper
Hi Tony

I return to you with another question about skip. How to update the skip code to stop on response menu?
Right now when I use skip before response menu it will stop on response menu.
But when i made my choice it will finish the conversation.

Effect i want to have is:
- After skip, stop on response menu
- After choosing response, dialogue should go normally

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 7:34 am
by Tony Li
Hi,

Are you using the ConversationControl component?

If so, make a subclass and override the OnConversationResponseMenu method to stop skipping. Then use the subclass instead of the original.

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
public class MyConversationControl : ConversationControl
{
    public virtual void OnConversationResponseMenu(Response[] responses)
    {
        StopSkipAll();
        base.OnConversationResponseMenu(responses);
    }
}

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 9:20 am
by Saper
Yes we use this overide for it
Tony Li wrote: Tue Feb 06, 2024 10:17 am Hi,

First, use the current version of ConversationControl that will be in DS version 2.2.43:

DS_ConversationControl_2024-02-06.unitypackage

Then make a subclass of ConversationControl that skips all sequences except the final node's sequence if Skip All is set:

Code: Select all

public class MyConversationControl : ConversationControl
{
    public override void OnConversationLine(Subtitle subtitle)
    {
        if (skipAll && DialogueManager.currentConversationState.hasAnyResponses)
        {
            subtitle.sequence = "Continue()";
        }
        else
        {
            base.OnConversationLine(subtitle);
        }
     }
}

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 9:26 am
by Saper
If I understand correctly it should look like this?

Code: Select all

public class MyConversationControl : ConversationControl
{
    public override void OnConversationLine(Subtitle subtitle)
    {
        if (skipAll && DialogueManager.currentConversationState.hasAnyResponses)
        {
            subtitle.sequence = "Continue()";
        }
        else
        {
            base.OnConversationLine(subtitle);
        }
    }
     
   public virtual void OnConversationResponseMenu(Response[] responses)
    {
        StopSkipAll();
        base.OnConversationResponseMenu(responses);
    }
}

 

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 9:39 am
by Tony Li
That looks right!

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 10:06 am
by Saper
I changed:

Code: Select all

 public virtual void OnConversationResponseMenu(Response[] responses)
To:

Code: Select all

 public override void OnConversationResponseMenu(Response[] responses)
And it works properly

Thanks for help Tony and Happy new year :)

Re: Skip Button ending conversation, instead of stopping on last dialogue element

Posted: Tue Jan 07, 2025 11:10 am
by Tony Li
Glad to help! Happy New Year!