Main Menu & Quest Machine

Announcements, support questions, and discussion for Quest Machine.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Main Menu & Quest Machine

Post by Mchia_Soo »

Hey Tony!

I have a doubt regarding the Main Menu and Quest Machine. I built another scene for my main menu and at the same time, I create an Option button in the game which contains Quest Machine and Dialogue System.

Everything works fine except when I press on the Option button to return back to main menu. The Option panel that I created do not disappear, as well as all the buttons & HUD text in the game.

The steps that I have tried to solve this issue:
1. Set inactive to all the buttons. But I found out that when I click Play to restart the game, the game is actually in paused mode (not end).

2. Set the Time.timeScale to 1 in my main menu scene. However, it didn't help to fix it.

3. Create another canvas and put all the buttons into it. This deactivates all the buttons and could not be clicked at all.

4. Create another scene for Pause Menu - same problems are still there and Resume button become Restart.

Also, if I manage to resume the game, there's no response after clicking on the buttons.

Is this actually related to any option in Quest Machine or Dialogue System? Hope you can provide me some advice/suggestions to resolve it. Have been solving it for few weeks.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Main Menu & Quest Machine

Post by Tony Li »

Hi,

The Quest Machine GameObject and the Dialogue Manager GameObject both survive scene changes. Can you put them on their own GameObjects instead of Options?
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Main Menu & Quest Machine

Post by Mchia_Soo »

Sorry, I don't get what you meant.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Main Menu & Quest Machine

Post by Tony Li »

Maybe I misunderstood.

Do you want to hide the Dialogue System and Quest Machine UIs when you return to the title menu scene?

If so:
  • Dialogue System: Deactivate the Canvas GameObject. When returning to a gameplay scene, reactivate it.
  • Quest Machine: Deactivate the Quest Machine Canvas GameObject. When returning to a gameplay scene, reactivate it.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Main Menu & Quest Machine

Post by Mchia_Soo »

Is there any coding or button that can deactivate and reactivate it back?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Main Menu & Quest Machine

Post by Tony Li »

Yes. In code:

Code: Select all

DialogueManager.instance.GetComponentInChildren<Canvas>().enabled = ...
QuestMachineConfiguration.instance.GetComponentInChildren<Canvas>().enabled = ...
where ... is true or false depending on whether you want to show or hide the UIs.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Main Menu & Quest Machine

Post by Mchia_Soo »

Tony Li wrote: Sun Aug 25, 2019 9:00 pm Yes. In code:

Code: Select all

DialogueManager.instance.GetComponentInChildren<Canvas>().enabled = ...
QuestMachineConfiguration.instance.GetComponentInChildren<Canvas>().enabled = ...
where ... is true or false depending on whether you want to show or hide the UIs.
What you meant is to add these two line codes in my coding right? I have checked these scripts and both of them are using namespace. How to add them into my script as the red lines appear below the DialogueManager and the QuestMachineConfiguration?

Sorry, I am not familiar with the namespace.

//Update: Manage to solve the error - add the 'using PixelCrushers.QuestMachine;' will do.
Just wondering why do my buttons deactivate after restarting the game, but the HUD and alert texts work fine?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Main Menu & Quest Machine

Post by Tony Li »

Mchia_Soo wrote: Sun Aug 25, 2019 10:55 pmJust wondering why do my buttons deactivate after restarting the game, but the HUD and alert texts work fine?
If I understand you correctly, this is because the Dialogue Manager and Quest Machine GameObjects survive scene changes, so they are present and ready to display content when needed after restarting the game.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Main Menu & Quest Machine

Post by Mchia_Soo »

Can you explain more about the survive scene? And how can I solve this issue?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Main Menu & Quest Machine

Post by Tony Li »

Can you describe the problem again please? If possible, please add some screenshots that show the issue.
Post Reply