Can I check if the player has enough of an item?

There is a portion of my game where the player has to gather logs, and a scene should start after they gather 4, but the conditional branch option only allows me to check for the player having any logs at all
1733368080189.png

Is there a way I can make the scene trigger after the 4th log is collected?
for the conditional branch, the script you'd use would be
Code:
$gameParty.numItems($dataItems[53]) >= 4

but you could tie a variable to any event where the player gains a log and use that either in a conditional branch or in a page condition as needed
You can also just Control Variables for the number of item then use that variable's value in the Conditional Branch.

1733370270948.png


Conditional Branch is for true or false. Any time your question involves actual values, look at Control Variables.
A simple way would be to create a variable called "log". And then, +1 to it every time the player collects a log and -1 when they use/discard a log. And when you need to check its quantity : Conditional Branch -> Variable -> log >= 4 (or any desired number)
A simple way would be to create a variable called "log". And then, +1 to it every time the player collects a log and -1 when they use/discard a log. And when you need to check its quantity : Conditional Branch -> Variable -> log >= 4 (or any desired number)

Just load the current log amount into your variable when you need to check it, like Turan suggested.
It'll reduce the chance to overlook something and have mismatching values.

Code:
◆Control Variables:#1434 log = The number of Log
◆If:log ≥ 4
  ◆
:End
Just load the current log amount into your variable when you need to check it, like Turan suggested.
It'll reduce the chance to overlook something and have mismatching values.

Code:
◆Control Variables:#1434 log = The number of Log
◆If:log ≥ 4
  ◆
:End
Certainly. ATT_Turan's suggested solution has much less chances of an error.

Original thread: https://forums.rpgmakerweb.com/threads/can-i-check-if-the-player-has-enough-of-an-item.173682/