Page 1 of 1

Dialog does not start

Posted: Fri Apr 26, 2024 7:34 am
by dkrusenstrahle
Hello,

I have setup Dialog manager and it works great on simple 3D cubes. I can start and run dialogs from these simple cubes. But I have real characters that I add Dialogue System Trigger and Usable components to and set them exactly as I do for the cubes (I also tried copying the exact components from the cubes). The problem is that when I put the mouse on the character it does not show the messages saying "hit space". And hitting space those not start a conversation.

Why cant I start a conversation for more complex objects than a cube?
How can I change the trigger key from space to E key (like I do for quests).

Re: Dialog does not start

Posted: Fri Apr 26, 2024 8:03 am
by dkrusenstrahle
I solved the selection issue by setting the charcters layer (enemies) to the selector component on the Player character. But I still need to change from Space to E key.

Re: Dialog does not start

Posted: Fri Apr 26, 2024 8:17 am
by Tony Li
Hi,

To change the "use" input from Space to E, inspect your Selector component and set the Use Key to E. You can also change the Use Message to tell the player to press E.

Re: Dialog does not start

Posted: Fri Apr 26, 2024 8:19 am
by dkrusenstrahle
Great, where can I set other quick keys like ESC for skipping?
Also how can I speed up the fade in and out of the dialog?

Re: Dialog does not start

Posted: Fri Apr 26, 2024 8:35 am
by Tony Li
Hi,

There are two ways to skip:

1. Dialogue Manager GameObject's Display Settings > Input Settings > Cancel Subtitle Input -- which I don't recommend in most cases. Instead, use:

2. Continue button. See: How To: Continue Without UI Button

Re: Dialog does not start

Posted: Fri Apr 26, 2024 1:38 pm
by dkrusenstrahle
Thank you!

I ended up adding this script to my text (Subtitle text field):

Code: Select all

using PixelCrushers.DialogueSystem;
using UnityEngine;

public class DialogContinueFastForward : MonoBehaviour
{
    public KeyCode[] continueKeys = new KeyCode[] { KeyCode.Space, KeyCode.Return };

    void Update()
    {
        foreach (var key in continueKeys)
        {
            if (Input.GetKeyDown(key))
            {
                FastForward();
                return;
            }
        }
    }

    void FastForward()
    {
        var typewriterEffect = GetComponent<AbstractTypewriterEffect>();
        if ((typewriterEffect != null) && typewriterEffect.isPlaying)
        {
            typewriterEffect.Stop();
        }
        else
        {
            GetComponentInParent<AbstractDialogueUI>().OnContinue();
        }
    }
}

Re: Dialog does not start

Posted: Fri Apr 26, 2024 3:04 pm
by Tony Li
Thanks for sharing!