MV How do I...keep Unknown Quests hidden from fail commands in Yanfly's Quest Journal Plugin?

So in my game, there's a 'cut-off point' where some sidequests are unable to be done anymore. Hence I want to set those sidequests to "Failed" if it's too late.
Screen Shot 2022-01-10 at 7.20.25 PM.png

However, when I use the command "Quest Set Failed x", after some conditional branch check, it makes quests that are unknown fail perfectly, but all of a sudden....they appear in the quest journal afterwards...which is a problem.
Screen Shot 2022-01-10 at 7.21.06 PM.png

I don't want players to be able to see quests they failed if they never even discovered it in the first place. It would be really out of nowhere for players.

What could be the issue for this? To my knowledge, all quests should remain hidden until added directly via "Quest Set Added x" command.
I didn't encounter this before so it really threw me for a loop.
Unless I'm mistaken, if you set a quest as failed, the plugin assumes the player knew about the quest because in theory you can't fail a quest you weren't on.

You may have to check whether the player actually has the quest before setting it as failed.
If a quest simply becomes impossible, but was unknown, it doesn't have to be Failed because it doesn't show up in the journal. It just remains impossible.
There is a line of code in the function that is called, when you set a quest as failed that will add this quest to the known quests if the player didn't know it already.
The easy solution would be to only set quests as failed if the player already knows them. You should be able to check this with the script option of the conditional branch event command. Try:
JavaScript:
$gameSystem._questsKnown.contains(questId)
There is a line of code in the function that is called, when you set a quest as failed that will add this quest to the known quests if the player didn't know it already.
The easy solution would be to only set quests as failed if the player already knows them. You should be able to check this with the script option of the conditional branch event command. Try:
JavaScript:
$gameSystem._questsKnown.contains(questId)

Hey, I tried this code piece out, and it does work if the player doesn't know the side quest which is good.

The only thing is, I tested it out more and I came across a problem where even if the quest was "Finished", it would revert back to "Failed" when using this Script code as a conditional branch. I will show below:


Here I made it to where Omar's Quest #9 was added, then set to "finished".

Screen Shot 2022-01-10 at 8.25.24 PM.png


Here's the new code:
Screen Shot 2022-01-10 at 8.26.02 PM.png


After the cutoff point:
Screen Shot 2022-01-10 at 8.25.52 PM.png





In case I'm not mistaken, (please correct me if I'm wrong):
-The code only checks for the quest itself if it's known. (If Quest #9 is known....set #9 to fail).
I think that's why it flags it as Missed even if it was Finished.


The thing is, the sidequests could be finished or not at the cut-off point, and it's optional to do most of them. I only want to set the "still active" sidequests to failed, while leaving the finished ones alone.
Is there a way to only check for quests that are both discovered, and active, but not finished to fail?
Hey, I tried this code piece out, and it does work if the player doesn't know the side quest which is good.

The only thing is, I tested it out more and I came across a problem where even if the quest was "Finished", it would revert back to "Failed" when using this Script code as a conditional branch. I will show below:


Here I made it to where Omar's Quest #9 was added, then set to "finished".

View attachment 212447

Here's the new code:
View attachment 212448

After the cutoff point:
View attachment 212450




In case I'm not mistaken, (please correct me if I'm wrong):
-The code only checks for the quest itself if it's known. (If Quest #9 is known....set #9 to fail).
I think that's why it flags it as Missed even if it was Finished.


The thing is, the sidequests could be finished or not at the cut-off point, and it's optional to do most of them. I only want to set the "still active" sidequests to failed, while leaving the finished ones alone.
Is there a way to only check for quests that are both discovered, and active, but not finished to fail?
Turn on a switch if it's failed and if that switch is on don't offer the quest.
Yes, the code I gave you only checks whether the quest is known. Your OP seemed to me like you already had established a way to check whether a given quest was completed or not. The condition I gave you was meant to be used inn addition to that.

However you could also try the following as a generic condition:
JavaScript:
$gameSystem._questsKnown.contains(questId) && !$gameSystem._questsCompleted.contains(questId)
This should be true only if the given quest is known to the player (I assume that is equivalent to active?) and the quest is not marked as completed.
Moved to: Plugin Support

I haven't read through this thread - just looked at your first screenshot.

You realise you have the trigger set to Action Button and there is no sprite, right? That means that event will only run if the player interacts with an event they can't see.
It's okay guys! I think I figured it out.

What I ended up doing was creating an objective (1), and just using those singular objectives for every sidequest to check conditional branches for the fails/objectives. Apparently there is a code just for this:

$gameSystem.isQuestObjectiveUncleared(questId, objectiveId)

So it's all good now!

You realise you have the trigger set to Action Button and there is no sprite, right? That means that event will only run if the player interacts with an event they can't see.

Yes, I am fully aware of how my own event works, thanks.
Yes, I am fully aware of how my own event works, thanks.

Well, that's good, but you'd be surprised how many people can't figure out why an event won't work, and that's exactly the reason 😉 So we can never assume, especially when requiring the player to interact with an invisible event is such an odd thing to do.

Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-keep-unknown-quests-hidden-from-fail-commands-in-yanflys-quest-journal-plugin.143822/