[RMMZ] Need help with my event !!

Sorry if this is in wrong area, not really sure what this falls into, gathered it wouldn't be plugin help.
So, anyone know whats wrong with this event code? or what it's missing..? NOOB eventer here so
I totally winged that code below by trial and error by re-purposing the mobile phone menu code, but now i'm stuck.

The Issue: When I try to press on a monster button I have to press a few times before it loads up any of that buttons actions, like its having some sort of delayed reaction to button presses. Short of that, everything else works with it.
Spoiler: My Code
◆Play SE:Book1 (100, 100, 0)
◆Control Switches:#0032 MENU-BESTIARY = ON
◆If:MENU-BESTIARY is ON
◆Show Picture:#1, MimobBestiaryBG, Upper Left (-72,-8), (43%,45%), 255, Normal
◆Show Picture:#11, Bestiary-HillHornetIcon2, Upper Left (65,153), (62%,65%), 255, Normal
◆Show Picture:#12, Bestiary-ShroomIcon2, Upper Left (105,153), (62%,65%), 255, Normal
◆Show Picture:#13, Bestiary-HillHornetIcon2, Upper Left (147,153), (62%,65%), 255, Normal
◆Show Picture:#14, Bestiary-HillHornetIcon2, Upper Left (186,153), (62%,65%), 255, Normal
◆Wait:10 frames
◆Control Variables:#0012 MENU-BestiaryBtnSelect = 1
◆Loop
◆Comment:Keep player from moving whilst menu is open
◆Set Movement Route:Player
: :◇Wait:5 frames
◆Comment:Change variable based on button pressed
◆If:Button
is being pressed
◆Control Variables:#0012 MENU-BestiaryBtnSelect -= 1
◆Play SE:Cursor3 (90, 100, 0)
◆Wait:7 frames
◆
:End
◆If:Button
is being pressed
◆Control Variables:#0012 MENU-BestiaryBtnSelect += 1
◆Play SE:Cursor3 (90, 100, 0)
◆Wait:7 frames
◆
:End
◆If:MENU-BestiaryBtnSelect = 0
◆Control Variables:#0012 MENU-BestiaryBtnSelect = 4
◆
:End
◆If:MENU-BestiaryBtnSelect = 5
◆Control Variables:#0012 MENU-BestiaryBtnSelect = 1
◆
:End
◆Comment:Change highlighted picture
◆Show Picture:#11, Bestiary-HillHornetIcon2, Upper Left (65,153), (62%,65%), 255, Normal
◆Show Picture:#12, Bestiary-ShroomIcon2, Upper Left (105,153), (62%,65%), 255, Normal
◆Show Picture:#13, Bestiary-HillHornetIcon2, Upper Left (147,153), (62%,65%), 255, Normal
◆Show Picture:#14, Bestiary-HillHornetIcon2, Upper Left (186,153), (62%,65%), 255, Normal
◆If:MENU-BestiaryBtnSelect = 1
◆Show Picture:#11, Bestiary-HillHornetIcon1, Upper Left (65,153), (62%,65%), 255, Normal
◆Wait:1 frame
◆
:End
◆If:MENU-BestiaryBtnSelect = 2
◆Show Picture:#12, Bestiary-ShroomIcon1, Upper Left (105,153), (62%,65%), 255, Normal
◆Wait:1 frame
◆
:End
◆If:MENU-BestiaryBtnSelect = 3
◆Show Picture:#13, Bestiary-HillHornetIcon1, Upper Left (147,153), (62%,65%), 255, Normal
◆Wait:1 frame
◆
:End
◆If:MENU-BestiaryBtnSelect = 4
◆Show Picture:#14, Bestiary-HillHornetIcon1, Upper Left (186,153), (62%,65%), 255, Normal
◆Wait:1 frame
◆
:End
◆Comment:Branches for 'Ok' & 'Cancel' button presses.
: :What happnes when these buttons are pressed.
◆If:Button [OK] is being triggered
◆If:MENU-BestiaryBtnSelect = 1
◆Play SE:Decision3 (90, 100, 0)
◆Show Picture:#2, Bestiary-HillHornet, Upper Left (456,144), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = \c[17]Hill Hornet\c[0]
◆Show Picture:#3, None, Upper Left (160,115), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = Hill of Destiny
◆Show Picture:#4, None, Upper Left (80,465), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = HP: ??? / SP: ??? / MP: ??? STR: ??? / DEF: ??? / A…
◆Show Picture:#5, None, Upper Left (444,104), (70%,70%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = \c[12]Stinger\c[0]
◆Show Picture:#6, None, Upper Left (450,464), (100%,100%), 255, Normal
◆
:End
◆If:MENU-BestiaryBtnSelect = 2
◆Play SE:Decision3 (90, 100, 0)
◆Show Picture:#2, Bestiary-Shroom, Upper Left (457,139), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = Shroom
◆Show Picture:#3, None, Upper Left (170,115), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = Forestia Woods (East)
◆Show Picture:#4, None, Upper Left (80,465), (100%,100%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = HP: ??? / SP: ??? / MP: ??? STR: ??? / DEF: ??? / A…
◆Show Picture:#5, None, Upper Left (444,104), (70%,70%), 255, Normal
◆Plugin Command:TextPicture, Set Text Picture
: :Text = ???
◆Show Picture:#6, None, Upper Left (450,464), (100%,100%), 255, Normal
◆
:End
◆If:MENU-BestiaryBtnSelect = 3
◆Play SE:Decision3 (90, 100, 0)
◆
:End
◆If:MENU-BestiaryBtnSelect = 4
◆Play SE:Decision3 (90, 100, 0)
◆
:End
◆
:End
◆If:Button [Cancel] is being triggered
◆Play SE:Decision4 (90, 100, 0)
◆Erase Picture:#1
◆Erase Picture:#2
◆Erase Picture:#3
◆Erase Picture:#11
◆Erase Picture:#12
◆Erase Picture:#13
◆Erase Picture:#14
◆Break Loop
◆
:End
◆Wait:2 frames
◆
:Repeat Above
◆Wait:5 frames
◆
:End
​



This is what it looks like running in game.
Spoiler: In Game
1737061094804.png

Any clue guys?

Thanks in advance 😀​
it's better by screenshot as the text is totally messed up.
so it's hard to see what's going on and what you try to achieve.

changing a variable and picture ID is mostly instantly, but pressing shouldn't
be an issue.

so replace the textwall with screenshots so it's easier to find the cause.
but I think you use the phone menu event to create this bestiary?
Could you insert your code using the </> button?
1737061591067.png
◆If:MENU-BestiaryBtnSelect = 0
◆Control Variables:#0012 MENU-BestiaryBtnSelect = 4
◆
:End
◆If:MENU-BestiaryBtnSelect = 5
◆Control Variables:#0012 MENU-BestiaryBtnSelect = 1
also this bit is incorrect, as 5 = never reached, and so this also should be matched
correctly.

while you have 4 enemies, is should be 0 and 3 and 3 to 0.
but I think there are more mistakes inside your event.
as said above, without seeing the event properties it is difficult to say what went wrong.

but at a guess it's the loop, because loops can override parallels.

in most cases it is much better to split the event into an initial event for setting up and a listener event that is parallel and only reacts to the buttons, effectively eliminating the need for a loop inside the single event you have.
One other thing I have noticed when I experiment with something like this is how long of a WAIT you can use. Too long, and it might not catch when the player presses something. So you have to press a bunch of times until it just happens to catch the press at the right moment.

I see WAITS of 10, 7, and 5 (not counting the 1s).

But I could be completely wrong about that.
Sry guys here's screenshot of the full event..
Yea, i kinda tweaked the phone menu thing and repurposed it for this bestiary.

Spoiler: full script
1737069811007.png

One other thing I have noticed when I experiment with something like this is how long of a WAIT you can use. Too long, and it might not catch when the player presses something. So you have to press a bunch of times until it just happens to catch the press at the right moment.

I see WAITS of 10, 7, and 5 (not counting the 1s).

But I could be completely wrong about that.

I think this is exactly whats happening.. to be fair. It's missing the player pressing something. I changed the ones in the right and left press codes to '7' cos any lower and movements just way too fast. The 10 frames 'wait' one.. is not inside the loop so that wont effect the looped code.
Are you running all of this in a Parallel?
Try to turn it into an Autostart, so you don't have to prevent the player from moving.

But yeah, your observation of "hitting several times until it works" shows, your key hits aren't recocnized, if you don't hit the right frame.
Are you running all of this in a Parallel?
Try to turn it into an Autostart, so you don't have to prevent the player from moving.

But yeah, your observation of "hitting several times until it works" shows, your key hits aren't recocnized, if you don't hit the right frame.
No, its player action, when i talk to an NPC it calls the event stuff. I did it that way because I want to have this accessed through examining a shelf of books.
No, its player action, when i talk to an NPC it calls the event stuff. I did it that way because I want to have this accessed through examining a shelf of books.

I'm not sure if this will help. But if you want to stop the player from being able to move during a menu-based event you might want to try moving four impassable events around the player for the duration of the event, thus blocking them from being able to move in any direction. Because I think I ran into a similar problem myself one time when I tried to make the player wait during an event that involved accessing the menu and using items.
I'm not sure if this will help. But if you want to stop the player from being able to move during a menu-based event you might want to try moving four impassable events around the player for the duration of the event, thus blocking them from being able to move in any direction. Because I think I ran into a similar problem myself one time when I tried to make the player wait during an event that involved accessing the menu and using items.
No, that's not a solution. The player could still turn around, which looks like a bug, and if you can turn, you probably also can call the menu and break things.

During player action, you shouldn't be able to walk off, if the event is still ongoing. But you could still set your book event to autostart with a Switch as condition. And this Switch will be turned ON, when you want the book to appear.
No, that's not a solution. The player could still turn around, which looks like a bug, and if you can turn, you probably also can call the menu and break things.

During player action, you shouldn't be able to walk off, if the event is still ongoing. But you could still set your book event to autostart with a Switch as condition. And this Switch will be turned ON, when you want the book to appear.
Ok. I wasn't sure exactly of the problem, so didn't know if it would help or not. I just remembered one time I had an issue using Player Wait during an event where I wanted the player to stand still while they accessed the menu and selected certain items and that was the fix I came up with.
No, that's not a solution. The player could still turn around, which looks like a bug, and if you can turn, you probably also can call the menu and break things.

During player action, you shouldn't be able to walk off, if the event is still ongoing. But you could still set your book event to autostart with a Switch as condition. And this Switch will be turned ON, when you want the book to appear.
But.. this seems like just a solution to stop player moving, which my player ain't moving and they cant open the main menu either.
Is this going to sort out the problem with the having to press the 'OK' button multiple times over to load the monster button info? Just noticed it also happens when I try to close the bestiary down, have to press 'cancel' a few times too.


EDIT: Tried your solution.. moved all the code to 2nd page, set it to autorun and made it a switch. Put the switch to activate on page 1 when player interacts with event. Removed the disbable player movement lines. Book loads up, left and right movement works as it should, but still the same issue with having to press the buttons multiple times before it loads the monster information.
Mhh... Have you tried to set the wait 2 at the end of your event to wait 1?
Or the 5 to 1. I can't really see which one belongs where.
Mhh... Have you tried to set the wait 2 at the end of your event to wait 1?
Or the 5 to 1. I can't really see which one belongs where.
AH! okay so i deleted the wait 1, and changed the wait 5 to wait 1 AND... it all seems to work properly now. Weird, i tried that before and it didnt work. ???? No clue why it's working now. Only thin is now the movements left and right are a little fast so i'll have to maybe add a +1 wait to the other waits just to slow the movement left and right down a little.

UPDATE: Okay, it's all working well now 🙂 thanks everyone who helped solve this.
All I did was remove the 'wait 1' near the end of the event, changed the 'wait 5' at the bottom of event also to 'wait 2' and then changed the two 'wait 7' on the left/right sections to 'wait 10' to slow down the movements left and right, and it all works fine now.
The waits at the end delayed the repetition of the loop.
It checks for 1 frame, if you hit the button. If not, you had to wait through the 2 - 5 frames at the end of the event before you went back up in the code and could try again.

The waits after a key hit (left and right) can be longer, as they aren't repeated constantly.
Sry guys here's screenshot of the full event..
no, that isn't the full event but again it's only the contents and missing all the other properties.
In the case of common events that is not much, but still needed: the trigger set above the content window.
you could have spared yourself the delay and posts later where someone asked how the event was started, because that was the main part of the missing information.
no, that isn't the full event but again it's only the contents and missing all the other properties.
In the case of common events that is not much, but still needed: the trigger set above the content window.
you could have spared yourself the delay and posts later where someone asked how the event was started, because that was the main part of the missing information.
NOT quite sure where your going with this, the issue was solved. I stated above how the event was started but NOT on the original post, i admit that, so it WAS answered how the event started, just not on the OP.

1. I stated I was a noob at first post, and I wasn't kidding, been using RMMZ for like 2 weeks? So I didn't understand what was meant by "screenshots", I just assumed SS the code as that's what I was having issues with, not you wanting an SS of the entire event window and code together.. you should have been more clearer on that, sorry about that. At least I know now for future problems that when asked for SS to show full event window and code.

2. It's was all in a regular event, NOT a Common Event, so not sure why you think it was a Common Event? As I stated a few posts up, it was called by me talking to an NPC event, and that it wasn't set to autorun, if it was a Common Event I woulda said. Again though, my bad for not providing enough info on OP, noob here.
I get the idea of it being put into a common event though, 'cos rather than putting entire code in a regular event you can just 'call common event', saves room, easier to edit/add, and such... I just didn't do it that way but nothing stopping me from copy/paste it all into a Common Event, and change the regular character event to call the 'common Event' instead, now its all fixed and working as should.

In any case, this issue has been solved, all's working, so it can be locked/closed.
I know that the problem was solved, my post was for the future.

I assumed it was a common event because a map event has many more properties

In case of a map event, the entire left half of the event is missing from the screenshots - the content (the right half) is only half of the event.
To help solving a map event we would need to see every setting in the left half: trigger, priority, checkboxes, the numbering of the event pages and more - all that are important parts of the events that should never be cut away from screenshots.

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-need-help-with-my-event.174765/