Can I run a common event when opening the main menu?

Pipilson

Villager
Member
Joined
Jul 8, 2019
Messages
14
Reaction score
4
First Language
Portuguese
Primarily Uses
RMMV
Im using Yanfly's MainMenuManager to recreate the menu buttons so each page has its own window color, so I replaced the default "Item" button with my own version of it which changes the window color and then open the item screen. However, this means that when you pause again the window color will be set to the same one of the menu you acessed last time, I tried using Yanfly's UtilityCommonEvents to set run a common event when you close the menu, but since I am not usuing the default menu button, closing a menu unpause the game instead of taking you back to the main menu, so that didnt worked. So I was hoping there was a way for me to run a common event upon opening the main menu
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
333
First Language
German
Primarily Uses
RMMV
This explanation is confusing.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,026
Reaction score
7,026
First Language
German
Primarily Uses
RMMV
as said your description is confusing - but I don't need to understand what you're trying to do to answer the question:

no

there is a game-interpreter on the map, and another one on the battlescreen. Those are needed to process any event, and no other screen has them included.
So no, none of the screens can run a common event by default.

your two options are only:
1) replace the menues completely by disabling access to them and have a common event create your entire menu
That is a lot of work
2) use a plugin that installs additional interpreters on the other screens to enable using common events on them
This can become a configuration nightmare, especially if mixing in other menu-manipulating plugins

so there is no simple solution, but it can be done.
 
  • Like
Reactions: Bex

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
333
First Language
German
Primarily Uses
RMMV
Are you talking about this:
Eventcommand disable menu access, execute at game start.
Than parallel common event which also gets activated at game start.
Code for CE:
If Menu Button is pressed? if yes: do your stuff, like calling a common event, turning switch X on and than opening standard menu with event or script command. While menu is open the common event will not run but we turned the switch on directly before we opened it.
That means when we close the menu, that switch helps us knowing that the menu was open, so we can use it in a if statement and let something happen again.
But a common Event cant run while a Menu Screen is Open, like Andar explained.
But this is just a Guess, maybe it helps.
 

Pipilson

Villager
Member
Joined
Jul 8, 2019
Messages
14
Reaction score
4
First Language
Portuguese
Primarily Uses
RMMV
This explanation is confusing.
Yeah thanks, this helps a lot. I can totally try to give you a better explanation when you don't say what you couldnt understand. But its okay, I was already able to solve this problem, I just forgot to update this thread
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
333
First Language
German
Primarily Uses
RMMV
Would you mind telling us the solution, it could be very interesting.
And I should have avoided to make such Post. No hard feelings, i was just short on time and it somehow happened, my apologies.
 

Pipilson

Villager
Member
Joined
Jul 8, 2019
Messages
14
Reaction score
4
First Language
Portuguese
Primarily Uses
RMMV
Yeah I apologise too, I was having a rough and busy week, hence why I took so long to reply. My solution was kinda similar to what you proposed, but simplier (since I could understand the problem): When you open a submenu (items menu, equip menu, etc) it does its thing and set a switch on, and Ive also made a common event that runs when that switch is on, doing its thing and turning it off.

When that switch is set to "on" you are at the main menu, so the common event tied to it will only run when you exit it
 
  • Like
Reactions: Bex

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,400
Members
129,255
Latest member
RPGLordLight
Top