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

Discussion in 'RPG Maker MV' started by Pipilson, Jul 14, 2019.

  1. Pipilson

    Pipilson Villager Member

    Messages:
    8
    Likes Received:
    3
    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
     
    #1
  2. Bex

    Bex Veteran Veteran

    Messages:
    1,152
    Likes Received:
    248
    First Language:
    German
    Primarily Uses:
    RMMV
    This explanation is confusing.
     
    #2
  3. Andar

    Andar Veteran Veteran

    Messages:
    28,007
    Likes Received:
    6,330
    Location:
    Germany
    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.
     
    #3
    Bex likes this.
  4. Bex

    Bex Veteran Veteran

    Messages:
    1,152
    Likes Received:
    248
    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.
     
    #4
  5. Pipilson

    Pipilson Villager Member

    Messages:
    8
    Likes Received:
    3
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    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
     
    #5
  6. Bex

    Bex Veteran Veteran

    Messages:
    1,152
    Likes Received:
    248
    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.
     
    #6
  7. Pipilson

    Pipilson Villager Member

    Messages:
    8
    Likes Received:
    3
    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
     
    #7
    Bex likes this.

Share This Page