MZ Visustella Quest System - How to run a script to check a quest's status i.e. completed, known, or failed.

Greetings,

I am looking for someone in the know on how to run a script to check the current status of a quest created with the Visustella quest system plugin, and then take an action based on that status.

Ultimately, I want to run an event that would work something like this:
questpic.png


In essence, the idea behind it is to create time-sensitive quests that will fail if a certain part of the game has been reached. What the above event would do is check if the quest has already been completed, and if so, do nothing. Otherwise, mark the quest as failed.

If anyone happens to know of or can point me in the right direction to the correct script to run to check the status of a quest created by the plugin, i would greatly appreciate the knowledge 🙂.

Thank you in advance,
-Niniann
It is somewhat disappointing that this isn't presented, given that I think it's a pretty common need...but, judging from the script calls that are provided, I'm gonna make a guess 😉

Try $gameSystem.getQuestStatus("Hello World")=="completed"
I think it's:

$gameSystem.isQuestCompleted('Key')

EDIT:
Well, that solves the problem if you only want to check if the quest is complete, like in your example. Checking for "known" requires something else.
I think it's this one:

isQuestObjectiveCompleted(questKey, objectiveID)

- Returns a true/false value depending on the selected quest's objective
and if it is completed.
- Replace 'questKey' with the 'Quest ID Key' of the desired quest to gather
data from. You can find out what the 'Quest ID Key' is in the plugin's
parameters > Quest Categories > target category > Quests > selected quest
> Quest ID Key.
- Insert quotes around the 'questKey' to ensure it works.
- Replace 'objectiveID' with the numeric ID of the quest objective you want
to check.
- Example: isQuestObjectiveCompleted('Welcome', 1)
Source: http://www.yanfly.moe/wiki/Quest_Journal_System_VisuStella_MZ
Hmmm, I haven't used this plugin, but that script just checks if some quest objective is marked as complete, but not if the whole quest is marked as complete?

I tested it, and the script call I wrote above returns true after I used the plugin command to mark the whole quest as completed.
I think it's this one:
I see where you found them now. Seems like it would be logical for them to actually be in the Script Calls section, rather than a completely different place with the word "Script" buried in the middle 😉

But I take back the original complaint, clearly they did think about the code being needed and provided it in the instructions.
Super busy day yesterday so didn't have time to check back in on this thread. Thank you everyone for your responses.

So the specific thing I was looking for is not in the documentation that I can see, but Aerosys is certainly right that I could use his suggestion to get in essence what I want through objectives.

That being said, RPGLord69's suggestion is perfectly what I needed, since I specifically am looking for checking if a quest in its entirety is completed.

As a follow up, checking if a quest is known is also something that I needed, but using RPGLord69's suggestion was easy to tweak to figure that out.

Here is a final, working and finished event that will first check if a quest is completed, then check if a quest is known, and if known, mark it as failed:
quest pic.png


Thanks again everyone for your input, it is much appreciated 🙂. The problem is solved!

Cheers,
Niniann

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-quest-system-how-to-run-a-script-to-check-a-quests-status-i-e-completed-known-or-failed.161747/