Change delay for responses

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
alexander
Posts: 10
Joined: Tue Feb 16, 2021 6:43 am

Change delay for responses

Post by alexander »

Hello,

currently whenever we send a response the next one appears only after several seconds, how can we change the duration?

Regards
Alexander
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change delay for responses

Post by Tony Li »

Hi,

Inspect your Dialogue Manager GameObject. Set Display Settings > Input Settings > Default Player Sequence to a blank string. If that doesn't remove the delay, check the animation on the response panel. If it's configured to play a hide animation that isn't working, and if the next subtitle panel specifies Wait For Close, then it may wait for a timeout before showing the subtitle.
alexander
Posts: 10
Joined: Tue Feb 16, 2021 6:43 am

Re: Change delay for responses

Post by alexander »

Thank you,

gonna try and post back :)

Alex
alexander
Posts: 10
Joined: Tue Feb 16, 2021 6:43 am

Re: Change delay for responses

Post by alexander »

Hello,

unfortunately your suggestions didn't work. I have removed the Delay Macro as you can see here:
ds.png
ds.png (61.02 KiB) Viewed 406 times
Your other suggestions don't really fit as I have not used any of the prepared UI implementations for they were overkill for my simple needs.

Here is my very simple implementation

Code: Select all

namespace Thrixxx.HappyTreeFriends.Messaging {

    using System;
    using PixelCrushers.DialogueSystem;
    using UniRx;
    using UnityEngine;
    using Zenject;

    public class MessengerDialogUI : MonoBehaviour, IDialogueUI {

        private MessageService messageService;

        [Inject]
        public void Inject(MessageService messageService) {
            this.messageService = messageService;
        }

        #region Implemention of IDialogueUI

        public event EventHandler<SelectedResponseEventArgs> SelectedResponseHandler;

        protected void OnSelectedResponseHandler(SelectedResponseEventArgs e) {
            SelectedResponseHandler?.Invoke(this, e);
        }

        public void Close() {
            // Nada ...
        }

        public void HideAlert() {
            // Nada ...
        }

        public void HideQTEIndicator(int index) {
            // Nada ...
        }

        public void HideResponses() {
            // Nada ...
        }

        public void HideSubtitle(Subtitle subtitle) {
            // Nada ...
        }

        public void Open() {
            // Nada ...
        }

        public void ShowAlert(string message, float duration) {
            // Nada ...
        }

        public void ShowQTEIndicator(int index) {
            // Nada ...
        }

        public void ShowResponses(Subtitle subtitle, Response[] responses, float timeout) {
            messageService.PublishCatalogue(new ResponseCatalogue {
                Responses = responses,
                Timeout = timeout
            });
        }

        public void ShowSubtitle(Subtitle subtitle) {
            var message = new Message {
                Text = subtitle.dialogueEntry.DialogueText,
                DateTime = DateTime.Now,
                IsPlayer = subtitle.speakerInfo.IsPlayer
            };

            messageService.PublishMessage(message);
        }

        #endregion

        #region Unity Lifecycle Events

        public void OnEnable() {
            messageService.Responses.TakeUntilDisable(this).Subscribe(x => {
                OnSelectedResponseHandler(new SelectedResponseEventArgs(x));
            });
        }

        #endregion
    }
}
There is no delay anywhere in the code above, also not in the UI as it responds instantly to changes at the moment. Currently after sending a response, the next ShowSubtitle method call is instant, but the ShowResponses call takes a couple of seconds to arrive.

Regards
Alex
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change delay for responses

Post by Tony Li »

Hi,

Unless you set the Sequence field of every dialogue entry, your Dialogue Manager's Default Sequence should be set to something. Try setting it to:

Code: Select all

None()
alexander
Posts: 10
Joined: Tue Feb 16, 2021 6:43 am

Re: Change delay for responses

Post by alexander »

That did it, thank you !
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change delay for responses

Post by Tony Li »

Happy to help! :-)
Post Reply