I am getting a stack overflow on "EnsureRunningOnMainThread" when QM is initializing. The version being used is the most current as I had to fix the issue of Dialogue System Alerts replaying on already completed quests.
(also in the current version, if you put those alerts on the whole quest's success state instead of the success node, they will continue to replay).
This is the print out of the exception.
Code: Select all
StackOverflowException: The requested operation caused a stack overflow.
UnityEngine.Object.EnsureRunningOnMainThread () (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Object.GetInstanceID () (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at <e414e10bfe5f45729ff122f3359de21b>:0)
UnityEngine.Object.op_Inequality (UnityEngine.Object x, UnityEngine.Object y) (at <e414e10bfe5f45729ff122f3359de21b>:0)
PixelCrushers.QuestMachine.QuestJournal.get_questJournalUI () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestJournal.cs:38)
PixelCrushers.QuestMachine.QuestJournal.RepaintUIs () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestJournal.cs:214)
PixelCrushers.QuestMachine.QuestJournal.OnMessage (PixelCrushers.MessageArgs messageArgs) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestJournal.cs:103)
PixelCrushers.MessageSystem.SendMessageWithTarget (System.Object sender, System.Object target, System.String message, System.String parameter, System.Object[] values) (at Assets/Plugins/Pixel Crushers/Common/Scripts/Message System/MessageSystem.cs:350)
PixelCrushers.MessageSystem.SendMessage (System.Object sender, System.String message, PixelCrushers.StringField parameter, System.Object[] values) (at Assets/Plugins/Pixel Crushers/Common/Scripts/Message System/MessageSystem.cs:450)
PixelCrushers.QuestMachine.QuestMachineMessages.QuestNodeStateChanged (System.Object sender, PixelCrushers.StringField questID, PixelCrushers.StringField questNodeID, PixelCrushers.QuestMachine.QuestNodeState state) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Utility/QuestMachineMessages.cs:165)
PixelCrushers.QuestMachine.QuestNode.SetState (PixelCrushers.QuestMachine.QuestNodeState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Node/QuestNode.cs:428)
PixelCrushers.QuestMachine.QuestNode.SetState (PixelCrushers.QuestMachine.QuestNodeState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Node/QuestNode.cs:445)
PixelCrushers.QuestMachine.Quest.SetState (PixelCrushers.QuestMachine.QuestState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:886)
PixelCrushers.QuestMachine.Quest.Autostart () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:790)
PixelCrushers.QuestMachine.QuestConditionSet.SetTrue () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Condition Set/QuestConditionSet.cs:178)
PixelCrushers.QuestMachine.QuestConditionSet.OnTrueCondition () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Condition Set/QuestConditionSet.cs:173)
PixelCrushers.QuestMachine.QuestCondition.SetTrue () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Subasset/Quest Condition/QuestCondition.cs:63)
PixelCrushers.QuestMachine.QuestStateQuestCondition.StartChecking (System.Action trueAction) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Subasset/Quest Condition/QuestStateQuestCondition.cs:53)
PixelCrushers.QuestMachine.QuestConditionSet.StartChecking (System.Action trueAction) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest Condition Set/QuestConditionSet.cs:128)
PixelCrushers.QuestMachine.Quest.SetStartChecking (System.Boolean enable) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:771)
PixelCrushers.QuestMachine.Quest.SetState (PixelCrushers.QuestMachine.QuestState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:865)
PixelCrushers.QuestMachine.Quest.BecomeOfferable () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:797)
PixelCrushers.QuestMachine.Quest.SetStartChecking (System.Boolean enable) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:778)
PixelCrushers.QuestMachine.Quest.SetState (PixelCrushers.QuestMachine.QuestState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:865)
"PixelCrushers.QuestMachine.Quest.SetStartChecking (System.Boolean enable) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:778)
PixelCrushers.QuestMachine.Quest.SetState (PixelCrushers.QuestMachine.QuestState newState, System.Boolean informListeners) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest/Quest.cs:865)"
This is what I use to save and load the data from the systems (JIC that is also needed):
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using OutbackGames.ARPG.Core;
using PixelCrushers;
using Sirenix.OdinInspector;
namespace OutbackGames.ARPG.Thirdparty
{
public class PixelCrushersSaveManager : MonoBehaviour
{
[SerializeField, ReadOnly, Multiline, BoxGroup("Debug")] string _savedData = "";
private void Start()
{
//LoadSavedData(); //does not work, must call from game manager when it is initializing.
}
public void LoadSavedData()
{
string prevSavedData = GameStateSaver.LoadKeyFromFile<string>(Constants.PXC_DIAG_QUEST, Constants.questDataFileName);
_savedData = prevSavedData;
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(prevSavedData));
}
private void OnDisable()
{
//SaveData(); //does not work, must call from gamemanager before transition coroutine.
}
public void SaveData()
{
//Ensure Data Is Collected and objects are notified
SaveSystem.BeforeSceneChange();
//SaveSystem.RecordSavedGameData();
string serializedData = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
GameStateSaver.SaveKeyToFile<string>(Constants.PXC_DIAG_QUEST, serializedData, Constants.questDataFileName);
}
}
}
