common event when opening menu

yo, there doesn't seem to be anything about this elsewhere so i'm asking here


is there a way to run a common event as the in-game menu is opened to set variables and other similiar things right before it opens? i have tried messing with the base menu script a bit and added a common event call there but it just makes the event run after closing the menu, so it seems that the menu opening blocks the common event until it closes? is there some way to run it before instead, without of course the menu opening being interfered?
The only parts of the game that can run common events are battles and the map, as those are the only ones that have the event interpreter built in. If you want to have a common event-based menu, you could probably have a few parallel common events checking for the escape key being pressed to trigger the menu, but you'll also have to then manage making everything pause while the menu is active. But from there, you should have complete control over how the menu works via events, which sounds like what you want.
The only parts of the game that can run common events are battles and the map, as those are the only ones that have the event interpreter built in. If you want to have a common event-based menu, you could probably have a few parallel common events checking for the escape key being pressed to trigger the menu, but you'll also have to then manage making everything pause while the menu is active. But from there, you should have complete control over how the menu works via events, which sounds like what you want.



i meant more as in just running a common event before the standard rpg maker in game menu shows up, still on the map and not for any kind of custom menu. there just needs to be a common event that runs with the same button as the menu, goes through and then the normal basic menu opens up afterwards. it's for changing things that appear within the menu that aren't meant to actually change before the menu is opened.
can't be done without a script change.


But I suggest you take a step back - can you tell us what you want to do instead of how you want to do it?


Because by default, nothing in the menues uses game variables or anything from eventing - that is why there is absolutely no need to run a common event before opening the menues.


If you tell us what you want to happen in the game as a result of those changes, we might be able to tell you other ways to do that.


Otherwise someone will have to move this into script requests.
can't be done without a script change.


But I suggest you take a step back - can you tell us what you want to do instead of how you want to do it?


Because by default, nothing in the menues uses game variables or anything from eventing - that is why there is absolutely no need to run a common event before opening the menues.


If you tell us what you want to happen in the game as a result of those changes, we might be able to tell you other ways to do that.


Otherwise someone will have to move this into script requests.



it's mostly for a script call to fix a little bit of a problem with windowskins. the windowskin is changed quite often and needs to be set to a certain one while in the menu. the yanfly status menu script allows for a tab in the status menu that lets you change an actor's name. this tab matches the windowskin set by galv's menu themes script the first time you visit it, but if you enter into it again it seems to switch to the current windowskin instead of that menu theme. thus the common event is needed to change the current windowskin into the same one as the menu theme. it would also be an easy way to change some variables used in the actor status screen that need to be randomized when the menu is opened at the same time
yes, you were overthinking it - but probably because you don't have the background.


You need to add a script modification into the menu scripts for that effect anyway, and having it call a common event (which is a lot of problem because those don't work in menus and are asynchron to anything else) just in order to execute another script line?


It's easier to enter the script call directly without ever bothering about a common event to do that.


That said, what you really need is a compatibility fix between the two scripts you're using, so that the status menu script takes its data from the menu themes instead of the defaults.


I suggest you make a new topic in script request, specifically asking for a compatibility fix between the two scripts, giving links to both websites so that people do know which scripts you're talking about. You can mention the workaround you thought of there, it might help to get it done faster - but believe me, such a compatibility fix (especially considering that you have already pinpointed most of the problem) is a lot easier than calling a common event before switching to menu screens.


I'm not moving this topic because the info you need to give is much different compared to what you originally asked for.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-when-opening-menu.72812/