Counting Items for a Quest

So. I've put a process into making a second quest where the adventurer has to collect a certain amount of the same item then hand it into the quest giver. But the issue I am having with this is I don't know how to have the quest npc recognize that the adventurer has the item, and the correct amount of that item. I know conditional branches can identify which item is required. But I can't seem to find anything that indicates the amount of that item. Would I have to use a custom script? Or is it an event command within the base software?


Sorry I haven't provided screenshots for this, I don't feel its necessary seeming how I'm not having a problem with the event coding itself. If required, I will edit this post for screenshots giving correct reference to the item.
you need to use a control variable command with the game data option to load the number of a specific item in inventory into the variable, then compare that variable to the required number in a conditional branch
Ah, okay. I get it now. Thank you so much!
I know Andar already answered this one, but just in case anyone wanted to know how to do this without scripts/commands..


I use a conditional branch to first check if the player has a Potion, then remove one Potion and add +1 to a variable. Then it checks again and keeps checking until the player no longer has the item. The number in the variable is then the amount of Potions the player has. You can add the amount of Potions back to the player's inventory at the end of the event using the variable, and reset the variable to 0 before the event counts them out.


It's a long way around it, but handy if you can't use commands for whatever reason or if you're just doing it with 100% pure eventing.


ISAvB4V.png



fK1MJtS.png
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/counting-items-for-a-quest.70431/