Quest Machine UI isn't showing up

Announcements, support questions, and discussion for Quest Machine.
Post Reply
chairiko
Posts: 3
Joined: Mon Nov 05, 2018 1:34 am

Quest Machine UI isn't showing up

Post by chairiko »

Hello, I added the Quest Machine prefab to my scene, I am also using Invector's item manager, in which the UI for that shows up. I was wondering if this has anything to do with the Quest Machine UI not showing up at all.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine UI isn't showing up

Post by Tony Li »

Hi,

Here's an example scene:

QM_InvectorShooterUIExample_2018-11-05.unitypackage

You can press (J) to toggle the quest journal. If you bump into the NPC (capsule), it will show the dialogue UI.

To set this up, I used these steps:

1. I added the Quest Machine prefab to the scene.

2. I added the small script below to the Quest Machine GameObject. It has one method: SetTimeScale. I configured the Quest Dialogue UI's and Quest Journal UI's OnOpen() event to SetTimeScale 0, and OnClose() to SetTimeScale 1.

3. Created a new GameObject named PLAYER QUEST JOURNAL, and added a Quest Journal component. This is because the Quest Journal should be part of the scene, but Invector can treat the player GameObject as an Instance, meaning it can come from another scene.

4. Added TEST CANVAS with a button to toggle the Quest Journal. Added a UI Button Key Trigger to add (J) as a hotkey.

5. Added a test NPC. It offers the carrot quest, but I didn't bother to add carrots to the scene.

SetTimeScale.cs

Code: Select all

using UnityEngine;

public class ControlTimeScale : MonoBehaviour
{
    public void SetTimeScale(float timeScale)
    {
        Time.timeScale = timeScale;
        Cursor.visible = Mathf.Approximately(0, timeScale);
        Cursor.lockState = Mathf.Approximately(0, timeScale) ? CursorLockMode.None : CursorLockMode.Locked;
    }
}
chairiko
Posts: 3
Joined: Mon Nov 05, 2018 1:34 am

Re: Quest Machine UI isn't showing up

Post by chairiko »

Thank you very much for the quick response. Will this make it so hat the mouse isn't showing unless Dialogue comes up? Because when I use Invector Shooter I want it so that the cursor doesn't show up until the Quest Manager UI pops up.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine UI isn't showing up

Post by Tony Li »

Yes, that's correct.
Post Reply