Variable Count Up

I tried looking for this topic already, but I couldn't find it.

How do I make the game summon a monster or continue an event after x number of items are in your inventory. The senario I have is:

You need 10 Logs to build a bridge. After 10 Logs have been collected, an enemy appears. Defeat the enemy the bring the logs to the right location to build said bridge.

I know it has something to do with variables, but I can't figure out how those work correctly. Hopefully, after I get some replies to this topic, I'll understand them a bit better...
I would set up one log event something like this, and then just copy/paste that event until I had 10 (the code here assumes your bridge is comprised of four events, but obviously in your case this would be however many you needed) Also be aware that the priority on page 1 should be "same level as characters".

logpage1.png


logpage2.png
Seems to work perfectly! Thanks! And I didn't think the variables would be that easy to understand...
A lot of people seem to think variables are really complex or made of magical pixie dust, but the slightly boring fact of the matter is that they're literally nothing more than a named box into which you can put any value.
You'll need to put in some thought to use variables, but if you do they usually become easy fast.


However, I suggest a change to the event above:


Instead of checking if the number is equal to 10 (== 10), you should check if it is equal or greater than 10 (>= 10), because if you somehow get eleven logs before the event checks, then the event above will not trigger.
Yeah, the code was assuming that you were only ever getting 1 log at a time from each event, but I guess there's no downside to using >= instead.

Original thread: https://forums.rpgmakerweb.com/threads/variable-count-up.39716/