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

Announcements, support questions, and discussion for the Dialogue System.
Saper
Posts: 69
Joined: Tue Jan 12, 2021 11:25 am

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

Post 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
User avatar
Tony Li
Posts: 22762
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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);
    }
}
Saper
Posts: 69
Joined: Tue Jan 12, 2021 11:25 am

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

Post 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);
        }
     }
}
Saper
Posts: 69
Joined: Tue Jan 12, 2021 11:25 am

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

Post 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);
    }
}

 
User avatar
Tony Li
Posts: 22762
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

That looks right!
Saper
Posts: 69
Joined: Tue Jan 12, 2021 11:25 am

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

Post 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 :)
User avatar
Tony Li
Posts: 22762
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Glad to help! Happy New Year!
Post Reply