I get a warning message when entering a scene:
Quest Machine: GetQuestState(rescueEzmore): Couldn't find a quest with ID 'rescueEzmore'.
RescueEzmore occurs in a later scene. There are 2 references to rescueEzmore in the scene with the error, one in a Lua dialogue and the other in a custom script. The custom script did get a patch sent out earlier, but I'm wondering if it's a similar issue to my previous post: https://www.pixelcrushers.com/phpbb/vie ... f=9&t=3814
I believe the warning message happens because I'm checking to see if rescueEzmore is Successful (not unassigned) and Quest Machine isn't seeing any quest yet for rescueEzmore. Here's the updated script:
using UnityEngine;
namespace PixelCrushers.QuestMachine
{
public class SpawnOnStart : MonoBehaviour
{
public StringField questID;
public QuestState requiredState = QuestState.Active;
public GameObject prefabToSpawn;
GameObject player;
// Start is called before the first frame update
void Start()
{
player = GameObject.FindWithTag("Player");
var playerQuestJournal = player.GetComponent<QuestJournal>();
//if (QuestMachine.GetQuestState(questID) == requiredState)
if (QuestMachine.GetQuestJournal().FindQuest(questID) != null && QuestMachine.GetQuestState(questID) == requiredState)
{
Instantiate(prefabToSpawn);
}
}
// Update is called once per frame
void Update()
{
}
}
}
Any ideas why I get this message?
Thank you in advance.
Last edited by mschoenhals on Wed Dec 23, 2020 5:28 pm, edited 1 time in total.
Is the rescueEzmore quest assigned to the Quest Machine GameObject's quest database? I'll assume so and move on.
Does your SpawnOnStart script generate the warning message?
Please click on the message in the Console, press Ctrl+C (Cmd+C on Mac) to copy its details to the clipboard, then paste it into a reply. I suspect it's another instance of Quest Machine crying wolf when it doesn't really need to report the warning. If so, I'll fix it in the next update.
It looks like you have a custom script named CheckQuestState.cs in Quest Machine's Scripts folder. I recommend moving it out of Quest Machine's folder structure. That way if you delete Quest Machine at some point to import a fresh, updated copy, you won't lose your custom script. Normally you can just import Quest Machine updates right on top of the existing installation. But you never know when you might want to clear it out for some reason, so this just helps prevent confusion with your own scripts.
If everything else is working fine, you can ignore that warning message. It's a case of Quest Machine showing a warning when it really doesn't need to. I've removed the warning in the next update, which is due for release on Monday.
Happy to help! If you notice any issues (I don't expect you will), please let me know ASAP as I'm working on the next Quest Machine update now. Thanks!