Quest Journal breaking between scenes
Quest Journal breaking between scenes
Hey Tony, my quest journal gets empty and unresponsive (no buttons or input can close it after its opened) when loading a different scene, also the quest HUD goes missing. How can I make sure those are consistent between scenes?
Re: Quest Journal breaking between scenes
additional note: getting no errors in console, be it Quest Machine related or not.
Re: Quest Journal breaking between scenes
Hi,
Can you set up the save system? (The Dialogue System Extras page has a SaveSystemPrefabs package that's compatible with Quest Machine, too. It has preconfigured prefabs that you can just drop into the scene.)
If so, change scenes using one of the save system methods:
Can you set up the save system? (The Dialogue System Extras page has a SaveSystemPrefabs package that's compatible with Quest Machine, too. It has preconfigured prefabs that you can just drop into the scene.)
If so, change scenes using one of the save system methods:
- ScenePortal component
- C#: SaveSystem.LoadScene()
- Hook up a UnityEvent to a SaveSystemMethods component's LoadScene method
Re: Quest Journal breaking between scenes
I will start using Easy Save 3 soon, is there any additional steps for Easy Save 3? Do I have to set it up now or can I implement the compatibility later when I install Easy Save 3?
Re: Quest Journal breaking between scenes
You can install compatibility later. It's just a matter of removing the PlayerPrefsSavedGameDataStorer component and adding an ESSavedGameDataStorer in its place.
Re: Quest Journal breaking between scenes
Understood, I'm using a loading screen script for changing scenes, how can I replace the
That this script uses?
Heres the full script:
Code: Select all
SceneManager.LoadSceneAsync(scene);
Heres the full script:
Code: Select all
using UnityEngine;
using Lovatto.SceneLoader;
#if UNITY_5_3|| UNITY_5_4 || UNITY_5_3_OR_NEWER || UNITY_2017
using UnityEngine.SceneManagement;
#endif
public static class bl_SceneLoaderUtils
{
/// <summary>
///
/// </summary>
public static bl_SceneLoader GetLoader
{
get
{
bl_SceneLoader sl = GameObject.FindObjectOfType<bl_SceneLoader>();
if(sl == null)
{
Debug.LogWarning("Don't have any scene loader in this scene.");
}
return sl;
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public static bl_SceneLoaderManager GetSceneLoaderManager()
{
bl_SceneLoaderManager slm = Resources.Load("SceneLoaderManager", typeof(bl_SceneLoaderManager)) as bl_SceneLoaderManager;
if(slm == null)
{
Debug.LogWarning("Not found any scene loader manager in resources folder!");
}
return slm;
}
/// <summary>
///
/// </summary>
/// <param name="scene"></param>
public static AsyncOperation LoadLevelAsync(int scene)
{
#if UNITY_5_3 || UNITY_5_4|| UNITY_5_3_OR_NEWER || UNITY_2017
return SceneManager.LoadSceneAsync(scene);
#else
return Application.LoadLevelAsync(scene);
#endif
}
/// <summary>
///
/// </summary>
/// <param name="scene"></param>
public static AsyncOperation LoadLevelAsync(string scene)
{
#if UNITY_5_3 || UNITY_5_4|| UNITY_5_3_OR_NEWER || UNITY_2017
return SceneManager.LoadSceneAsync(scene);
#else
return Application.LoadLevelAsync(scene);
#endif
}
}
Re: Quest Journal breaking between scenes
Replace this:
with this:
(BTW, Quest Machine's save system has an optional scene transition / loading screen component. The SaveSystem GameObject in the SaveSystemPrefabs package is preconfigured with it.)
Code: Select all
return SceneManager.LoadSceneAsync(scene);
Code: Select all
PixelCrushers.SaveSystem.LoadScene(scene);
return PixelCrushers.SaveSystem.currentAsyncOperation;
Re: Quest Journal breaking between scenes
Everything is working now! Thank you Tony.
Another small question: where can I edit the Journal UI Hide function? (Used for closing the Journal)
I have some things I would like to add to the function, such as unhiding the cursor, stop character from moving while the menu is open and so on.
But when I try to edit the script that calls the hide function, this i what I get:
Should I add overrides to this script?
Another small question: where can I edit the Journal UI Hide function? (Used for closing the Journal)
I have some things I would like to add to the function, such as unhiding the cursor, stop character from moving while the menu is open and so on.
But when I try to edit the script that calls the hide function, this i what I get:
Code: Select all
// Copyright (c) Pixel Crushers. All rights reserved.
using UnityEngine;
namespace PixelCrushers.QuestMachine.Wrappers
{
/// <summary>
/// This wrapper class keeps references intact if you switch between the
/// compiled assembly and source code versions of the original class.
/// </summary>
[AddComponentMenu("Pixel Crushers/Quest Machine/UI/Unity UI Quest Journal UI")]
public class UnityUIQuestJournalUI : PixelCrushers.QuestMachine.UnityUIQuestJournalUI
{
}
}
Re: Quest Journal breaking between scenes
Hi,
That (PixelCrushers.QuestMachine.Wrappers.UnityUIQuestJournalUI) a subclass of the real class
(PixelCrushers.QuestMachine.UnityUIQuestJournalUI). You can subclass it:
However, it already has a UIPanel component with OnOpen() and OnClose() UnityEvents that you can hook up in the inspector or in script. Example in script:
That way you don't need to subclass anything.
That (PixelCrushers.QuestMachine.Wrappers.UnityUIQuestJournalUI) a subclass of the real class
(PixelCrushers.QuestMachine.UnityUIQuestJournalUI). You can subclass it:
Code: Select all
using PixelCrushers.QuestMachine;
public class MyQuestJournalUI : UnityUIQuestJournalUI
{
// Override methods here
}
Code: Select all
var journalUI = QuestMachine.defaultQuestJournalUI as UnityUIQuestJournalUI;
var uiPanel = journalUI.GetComponent<UIPanel>();
uiPanel.onOpen.AddListener(DisablePlayerMovement);
uiPanel.onClose.AddListener(EnablePlayerMovement);
Re: Quest Journal breaking between scenes
Ok,
But where would I put this? In the wrapper subclass?
And if I understood correctly all I would have to do is:
Since this is the specific script and method I want to call whenever the journal is opened or closed.
Code: Select all
var journalUI = QuestMachine.defaultQuestJournalUI as UnityUIQuestJournalUI;
var uiPanel = journalUI.GetComponent<UIPanel>();
uiPanel.onOpen.AddListener(DisablePlayerMovement);
uiPanel.onClose.AddListener(EnablePlayerMovement);
And if I understood correctly all I would have to do is:
Code: Select all
var journalUI = QuestMachine.defaultQuestJournalUI as UnityUIQuestJournalUI;
var uiPanel = journalUI.GetComponent<UIPanel>();
var uiManager = FindObjectOfType<UIManager>();
uiPanel.onOpen.AddListener(uiManager.ToggleJournal);
uiPanel.onClose.AddListener(uiManager.ToggleJournal);