Quest event broken - can't return an item to an NPC

I'm new to RPG Maker. Followed a tutorial on YouTube on making a quest, tried to implement my own quest with a different flow with what I learnt. It isn't working as expected.

Can someone please take a look?
Why doesn't NPC event 2 trigger?

Goal:
I find a book. I retrieve the book to the NPC. NPC gives me gold. Quest is complete.

Current flow:

I approach the NPC
I accept the quest
I walk into the hut
The book is present
I interact with the book
I receive the correct text and events
I approach the NPC again
NPC Event 2 is ignored.
Game gives me the NPC Event 3 response.

Screenshots below:

NPC EVENT 1

NPC event 1.png


NPC EVENT 2 (this doesn't trigger)

NPC event 2.png


NPC event 3

NPC event 3.png


Book retrieved event 1

Book retrieved event 1.png


Book retrieved event 2

Book retrieved event 2.png
most likey because page 3 is triggered, "variable Find Book = 1" is triggered,
same as page 2, so page 3 takes priority.
sp make event page 2, bottom is find book = 2, and page 3 as well.
most likey because page 3 is triggered, "variable Find Book = 1" is triggered,
same as page 2, so page 3 takes priority.
sp make event page 2, bottom is find book = 2, and page 3 as well.
Thanks for the help! I removed NPC Event 3 and it works now!
I have a new problem where I can keep giving him the book. Endless free coins! Haha. I'll make him disappear once the quest is done.
like I said, if the bottom is find book = 2 or +1, and page 3 = variable 2
it should stop, otherwise, use a selfswitch A, B, C, D and page 3 with this
switch triggered and it's done too 🙂
What ShadowDragon is saying is that RPG Maker checks your event pages in descending order. So it looks at the highest number page (page 3) first, and if that condition is true, it does that, and it will never look at the other pages. So you just need to change which order your event pages are in.

Also, as a bit of a logic tip - you are making things more complicated than they need to be (and causing yourself confusion) by using multiple variables for this. For a quest like this, you only need to use one variable. For example:
Variable = 1: quest received
Variable = 2:book picked up
Variable= 3: book returned, quest complete

If you use two different variables for this, you're just increasing the number of things you need to track and reference. So your quest-giving NPC would have event pages, in order, that directly correspond to those numbers.
Event page 1, no condition: gives them the quest
Event page 2, Variable = 1: asks them if they've gone to look for the book
Event page 3, Variable = 2: accepts the book and gives a reward
Event page 4, Variable = 3: says I love my book, thank you again for your help

You can even continue to use that same variable, if it's appropriate. For example, in my project, I have a single variable that tracks the progress of the player through the main storyline. I would then have separate variables for the side quests (except I've moved to using a quest journal plugin for that).

Original thread: https://forums.rpgmakerweb.com/threads/quest-event-broken-cant-return-an-item-to-an-npc.135141/