[SOLVED] Couldn't Find A Quest with ID
Posted: Tue Dec 22, 2020 9:04 am
Hi,
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:
Any ideas why I get this message?
Thank you in advance.
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:
Code: Select all
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()
{
}
}
}
Thank you in advance.