Conditional brench by number of items

What I trying to do. User have to get 5 ball(items), when we get all of them a box open. 


Curently, I add item for each box taken. In box I put a parallel event and I want it to open the box if player have 5 of that item.


But I can't make a condition without the script so I need to know how to do it with script condition.


Also... I have a question for performance reason, it's better to avoid parallele event? It's better if each time a item is taken I check if the 5 items is in inventory and then trigger the opening of the box?


I tryed: $game_party.item_number($data_items[6]) =5 but game_party not recognized with mv.


also, I already know that I can put quantity in variable and then do a condition but it's what I want to avoid, because I dont want to use a variable for that.
Yes, it's better to look for other ways, for performance reasons.  And if you HAVE to use a parallel event, look for ways to reduce the performance impact.


In this case, you don't need a parallel process event at all.  Just increment a variable each time the user gets a ball/item.  Then put a second event page on the box event, conditioned by that variable being equal to 5.
You got a point..... I guest that will be better like you say, but that require me tu use a variable. 


I try to avoid using varaible because last time I use to much of them I got a mess.


But you solution is far superior for performance.
There is no reason to avoid using variables.  One variable can take the place of many switches.  Far better to spend some time learning what they are and how to use them correctly, than to do what you've been doing, which seems to be causing just as much of a problem for you  🙂

Original thread: https://forums.rpgmakerweb.com/threads/conditional-brench-by-number-of-items.62908/