Page 1 of 1

Change delay for responses

Posted: Wed Mar 17, 2021 8:27 am
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

Re: Change delay for responses

Posted: Wed Mar 17, 2021 9:12 am
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.

Re: Change delay for responses

Posted: Thu Mar 18, 2021 1:18 pm
by alexander
Thank you,

gonna try and post back :)

Alex

Re: Change delay for responses

Posted: Fri Mar 19, 2021 6:40 am
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 409 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

Re: Change delay for responses

Posted: Fri Mar 19, 2021 9:31 am
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()

Re: Change delay for responses

Posted: Tue Mar 23, 2021 11:27 am
by alexander
That did it, thank you !

Re: Change delay for responses

Posted: Tue Mar 23, 2021 11:33 am
by Tony Li
Happy to help! :-)