Need help with a simple counter in an event?

I'm guessing it's incredibly simple and I'm just a newbie.

Pretty much the event is going Page 1, 2, 3, 4, 5.

On page 3, you get an item. It self switches to page 4 to prevent you from grabbing another item.

Page 3 Contents
1653801682251.png

Page 4 is a conditional branch that checks to see if you already have a package and if not.. It turns off Control Self Switch C so that it goes back to page 3.

Page 4 Contents
1653801747892.png


Page 5 is what I want to happen after 5 packages are delivered.

Page 5 Contents
1653801817954.png



Pretty much I don't know what I should do in page 3 or 4 to make it count how many packages were delivered, especially since I'm making it switch between pages.

Questions
Will switching event pages effect the count?
How do I even set up the count?

I feel like this has to be in here, but I just can't figure out what I'm not seeing. Thank you in advance for your assistance!
The key here is the Control Variables command. All variables start at 0; you can track deliveries by increasing a variable in the event that handles the delivery, e.g.

◆Change Items:Package - 1 ◆Control Variables:#0030 packages delivered += 1 ◆Text:None, None, Window, Bottom : :Package delivered!
Then use a Conditional Branch command to check the value of that variable in the NPC event.

Additional notes:
  1. Switches, self-switches, and variables are all persistent throughout a playthrough: they won't change except when you tell them to change.

  2. Generally you only need to change pages if you want the event to undergo a persistent change in behaviour (e.g. Direction Fix/Through, trigger, auto-movement) or appearance. Otherwise you can just use Conditional Branch commands in a single page.

  3. Page conditions are checked from high (page 5 in this case) to low (page 1). The first page whose conditions are met will become active. I assume you've got this right, but can't be sure because of the way you've cropped your screenshots.
The key here is the Control Variables command. All variables start at 0; you can track deliveries by increasing a variable in the event that handles the delivery, e.g.

◆Change Items:Package - 1 ◆Control Variables:#0030 packages delivered += 1 ◆Text:None, None, Window, Bottom : :Package delivered!


So something like...
1653851358592.png


I'm assuming this would mean if there are 5 or more packages delivered, then it would activate Control Self Switch D which would activate page 5, whereas if it was less (or Else) it would just continue acting normally and giving me packages to deliver.

Then, I would just make a control variable on the delivery site that adds one to the delivery itself which would look like this..
1653851597852.png


Which would in turn make the event itself look like this, in a very barebones way as I am still planning the wordage that is to be used since this is a One Page Game. But effectively, this would work correctly by increasing the variable I have assigned to Packages delivered by 1.
Note: Do not forget to subtract the item if you are giving it away, especially if using a repeatable event to increase the variable as it can cause you to effectively speedrun the game with just one package.

1653852917237.png


---

Now just making sure this looks correct, so that anybody in the future who uses this thread as a means to help them learn I will post the full event pages from 3-5 for the delivery event as well as the Delivery site again.

Keep in mind that like stated by the user caethyril, that event pages trigger from high to low if their CONDITIONS has been enabled, which is why I disable a self control switch to flip the page back to an earlier page. The goal here is to use an earlier page to trigger a later page once the requirements for that page have been hit.

Page 3 of the Package Gain Event
1653852298956.png

Page 4 of the Package Gain Event
Note: Walking tag does not matter here because the object is static.
1653852341517.png


Page 5 of the Package Gain Event
Read note underneath
1653852431326.png


As shown in the pictures above, I use the condition on page 3 to flip to page 5, but I could have also just set the condition for page 5 to be activated to the variable the same way I trigger page 5 on page 3.

How I'm doing it:
1653852537050.png


How I should be doing it:
1653852566209.png


Packaged Delivered Event


1653852904315.png

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-a-simple-counter-in-an-event.148023/