Event Doesn't Activate

I've just recently started messing around in RPG Maker MZ, and I wanted to create an event where you can interact with carrot tiles to "count" them. The code for it is pretty long, but here it is;
◆If:CarrotCount = 0
◆Text:None, None, Dim, Bottom
: :Four carrots.
◆
:Else
◆If:CarrotCount = 1
◆Text:None, None, Dim, Bottom
: :Eight carrots.
◆
:Else
◆If:CarrotCount = 2
◆Text:None, None, Dim, Bottom
: :Twelve carrots.
◆
:Else
◆If:CarrotCount = 3
◆Text:None, None, Dim, Bottom
: :Sixteen carrots.
◆
:Else
◆If:CarrotCount = 4
◆Text:None, None, Dim, Bottom
: :Twenty carrots.
◆
:Else
◆If:CarrotCount = 5
◆Text:None, None, Dim, Bottom
: :Twenty-four carrots.
◆
:Else
◆If:CarrotCount = 6
◆Text:None, None, Dim, Bottom
: :Twenty-eight carrots.
◆
:Else
◆If:CarrotCount = 7
◆Text:None, None, Dim, Bottom
: :Thirty-two carrots.
◆
:Else
◆If:CarrotCount = 8
◆Text:None, None, Dim, Bottom
: :Thirty-six carrots.
◆
:Else
◆If:CarrotCount = 9
◆Text:None, None, Dim, Bottom
: :Forty carrots.
◆
:Else
◆If:CarrotCount = 10
◆Text:None, None, Dim, Bottom
: :Forty-four carrots.
◆
:Else
◆If:CarrotCount = 11
◆Text:None, None, Dim, Bottom
: :Forty-eight carrots.
◆
:Else
◆If:CarrotCount = 12
◆Text:None, None, Dim, Bottom
: :Fifty-two carrots.
◆
:Else
◆If:CarrotCount = 13
◆Text:None, None, Dim, Bottom
: :Fifty-six carrots.
◆
:Else
◆If:CarrotCount = 14
◆Text:None, None, Dim, Bottom
: :Sixty carrots.
◆
:Else
◆If:CarrotCount = 15
◆Text:None, None, Dim, Bottom
: :Sixty-four carrots.
◆
:Else
◆If:CarrotCount = 16
◆Text:None, None, Dim, Bottom
: :Sixty-eight carrots.
◆
:Else
◆If:CarrotCount = 17
◆Text:None, None, Dim, Bottom
: :Seventy-two carrots.
◆
:Else
◆If:CarrotCount = 18
◆Text:None, None, Dim, Bottom
: :Seventy-six carrots.
◆
:Else
◆If:CarrotCount = 19
◆Text:None, None, Dim, Bottom
: :Eighty carrots.
◆
:Else
◆If:CarrotCount = 20
◆Text:None, None, Dim, Bottom
: :Eighty-four carrots.
◆
:Else
◆If:CarrotCount = 21
◆Text:None, None, Dim, Bottom
: :Eighty-eight carrots.
◆
:Else
◆If:CarrotCount = 22
◆Text:None, None, Dim, Bottom
: :Ninety-two carrots.
◆
:Else
◆If:CarrotCount = 23
◆Text:None, None, Dim, Bottom
: :Ninety-six carrots.
◆
:Else
◆If:CarrotCount = 24
◆Text:None, None, Dim, Bottom
: :One-hundred carrots.
◆
:Else
◆If:CarrotCount = 25
◆Text:None, None, Dim, Bottom
: :One-hundred and four carrots.
◆
:Else
◆If:CarrotCount = 26
◆Text:None, None, Dim, Bottom
: :One-hundred and eight carrots.
◆
:Else
◆If:CarrotCount = 27
◆Text:None, None, Dim, Bottom
: :One-hundred and twelve carrots.
◆
:Else
◆If:CarrotCount = 28
◆Text:None, None, Dim, Bottom
: :One-hundred and sixteen carrots.
◆
:Else
◆If:CarrotCount = 29
◆Text:None, None, Dim, Bottom
: :One-hundred and twenty carrots.
◆
:Else
◆If:CarrotCount = 30
◆Text:None, None, Dim, Bottom
: :One-hundred and twenty-four carrots.
◆
:Else
◆If:CarrotCount = 31
◆Text:None, None, Dim, Bottom
: :One-hundred and twenty-eight carrots.
◆
:Else
◆If:CarrotCount = 32
◆Text:None, None, Dim, Bottom
: :One-hundred and thirty-two carrots.
◆
:Else
◆If:CarrotCount = 33
◆Text:None, None, Dim, Bottom
: :One-hundred and thirty-six carrots.
◆
:Else
◆If:CarrotCount = 34
◆Text:None, None, Dim, Bottom
: :One-hundred and forty carrots.
◆
:Else
◆If:CarrotCount = 35
◆Text:None, None, Dim, Bottom
: :One-hundred and forty-four carrots.
◆
:Else
◆If:CarrotCount = 36
◆Text:None, None, Dim, Bottom
: :One-hundred and forty-eight carrots.
◆
:Else
◆If:CarrotCount = 37
◆Text:None, None, Dim, Bottom
: :One-hundred and fifty-two carrots.
◆
:Else
◆If:CarrotCount = 38
◆Text:None, None, Dim, Bottom
: :One-hundred and fifty-six carrots.
◆
:Else
◆If:CarrotCount = 39
◆Text:None, None, Dim, Bottom
: :One-hundred and sixty carrots.
◆
:Else
◆If:CarrotCount = 40
◆Text:None, None, Dim, Bottom
: :One-hundred and sixty-four carrots.
◆
:Else
◆If:CarrotCount = 41
◆Text:None, None, Dim, Bottom
: :One-hundred and sixty-eight carrots.
◆
:Else
◆If:CarrotCount = 42
◆Text:None, None, Dim, Bottom
: :One-hundred and seventy-two carrots.
◆
:Else
◆If:CarrotCount = 43
◆Text:None, None, Dim, Bottom
: :One-hundred and seventy-six carrots.
◆
:Else
◆If:CarrotCount = 44
◆Text:None, None, Dim, Bottom
: :One-hundred and eighty carrots!
◆
:Else
◆Text:None, None, Dim, Bottom
: :There are one-hundred and eighty carrots here.
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End
◆
:End

---
And then here's a screenshot of the event page:-
1709071715010.png


The issue is that when I try and interact with the carrot tile, nothing happens at all. I don't have any plugins or anything like that. I'm hoping I'm just missing something small because this was really tedious to do.

Originally I had a second event page that would bump up the variable, inside a self-switch so the count doesn't go up when interacting with the same carrot tile over and over again. So any advice moving forward would be very much appreciated too.
If your count text is just (CarrotCount+1)*4 it'd be a lot easier to just write that in one line of code instead of dozens of if else statements

Also, press F9 to check what the value of your CarrotCount variable actually is and see if it's not 0
You're not getting a text message at all, correct? You have the priority set as 'Below Player' and the Trigger is 'Action Button'. So you need to be standing on top of the Carrot Tile and press Enter for the event to happen. If you intended to stand next to the Carrot Tile and press Enter to receive a message, then you need to change priority to 'Same as Player.' Once you get a text message to show, then you can work on @AquaEcho 's suggestion.
You're not getting a text message at all, correct? You have the priority set as 'Below Player' and the Trigger is 'Action Button'. So you need to be standing on top of the Carrot Tile and press Enter for the event to happen. If you intended to stand next to the Carrot Tile and press Enter to receive a message, then you need to change priority to 'Same as Player.' Once you get a text message to show, then you can work on @AquaEcho 's suggestion.

That fixed it, thank you

The self-switch thing doesn't exactly work ideally. Once the number variable increases you can go back to a previous carrot tile and it'll show the updated text, which completely obliterates the carrot counting immersion, and I'm blanking on how I'd fix this without just having individualized events for each carrot tile, which sounds like a nightmare.
If your count text is just (CarrotCount+1)*4 it'd be a lot easier to just write that in one line of code instead of dozens of if else statements

Also, press F9 to check what the value of your CarrotCount variable actually is and see if it's not 0

I wish I'd known this beforehand :headshake:
That fixed it, thank you

The self-switch thing doesn't exactly work ideally. Once the number variable increases you can go back to a previous carrot tile and it'll show the updated text, which completely obliterates the carrot counting immersion, and I'm blanking on how I'd fix this without just having individualized events for each carrot tile, which sounds like a nightmare.
Use a Common Event and have each carrot tile call the common event. The common event 'knows' which map/event called it, so if the player clicks on CarrotTile01 and the common event has a 'Set Self Switch A ON' then CarrotTile01 gets its self switch A set to ON. If the player then clicks on CarrotTile02, the common event will set the self switch of CarrotTile02 to ON.

Have you used the built in tutorial at all? It will help a lot. You're going to want to use variables in your text box message. I'm going to use variable 11 for Carrot Count, but it doesn't matter what variable you use, so long as it's dedicated to Carrot Count and not used for anything else.

Psuedo code for your common event
Carrot Count = Carrot Count +4
Text Box: \v[11] Carrots
Set Self Switch A to ON

This will give you a numerical output (e.g. 16 Carrots, not sixteen Carrots). I do urge you to watch/read a few tutorials. There are several on Youtube you can watch. And continue to ask questions here. 🙂
Use a Common Event and have each carrot tile call the common event. The common event 'knows' which map/event called it, so if the player clicks on CarrotTile01 and the common event has a 'Set Self Switch A ON' then CarrotTile01 gets its self switch A set to ON. If the player then clicks on CarrotTile02, the common event will set the self switch of CarrotTile02 to ON.

Have you used the built in tutorial at all? It will help a lot. You're going to want to use variables in your text box message. I'm going to use variable 11 for Carrot Count, but it doesn't matter what variable you use, so long as it's dedicated to Carrot Count and not used for anything else.

Psuedo code for your common event
Carrot Count = Carrot Count +4
Text Box: \v[11] Carrots
Set Self Switch A to ON

This will give you a numerical output (e.g. 16 Carrots, not sixteen Carrots). I do urge you to watch/read a few tutorials. There are several on Youtube you can watch. And continue to ask questions here. 🙂

I found a workaround, I put the whole thing into a self-switch and then made a second event page that coincides with the switch being on, where all the variable numbers are bumped up by 1.

1709096015723.png


1709096050283.png


I didn't want to come back right away without trying stuff first, because I don't want to be a nuisance. I have consumed a lot of YouTube tutorials, and I did watch one on common events specifically, but the example they used was just showing the text "hello world!", and didn't really clarify the niche functionalities common events would have over normal events. So the whole thing is pretty confusing to me. I'll definitely check out the built in tutorials though. - I think I just understood that first paragraph. I was going to ask if there's a larger benefit to using a common event over just copy/pasting a normal event, but then I realized that you can edit it without having to delete all the events and having to re-paste the new version.

Thank you for all the help
Common events are just blocks of code you can call from any map. Theyre useful for things that happen on multiple maps like weather, map transfer effects, functions tied to pressing buttons, etc. Regular events are more appopriate for things specific to that map like NPCs, treasure chests, doors, etc. and are stuck on the map they're on. They can have multiple pages to change what set of instructions they're currently following.
I found a workaround, I put the whole thing into a self-switch and then made a second event page that coincides with the switch being on, where all the variable numbers are bumped up by 1.
Sounds like you're really getting the hang of game dev then. 😂

Original thread: https://forums.rpgmakerweb.com/threads/event-doesnt-activate.166235/